New Feature: Perspective Split Container

Hey everyone, I’m happy to announce that the Split Container component is now available on the nightly builds. This component has exactly two children panels that are separated by a draggable divider handle that is used to resize the panels at runtime. Like the other available containers in Perspective the Split Container will be available as a root container for views as well as a container to use as a nested container.

The default properties of the split container are as follows:

Screen Shot 2022-05-31 at 10.16.42 AM

To dig a bit deeper into these properties and what they are used for:

  • orientation: Determines the orientation in which the container is fixed. Horizontal allows the user to resize the children panels from left to right while Vertical allows for the opposite directions of top to bottom.

  • split.position: Bidirectionally represents the current position of the split handle within the container. This property can be represented in one of two ways. The first, and default way, is as a string percentage value ranging from 0 to 100. Where the second is as a numeric pixel value ranging from handleSize / 2 to containerDimension - (handleSize / 2) where containerDimension represents either the width or height of the container depending on the currently set orientation.

  • split.size: The size of the split handle in pixels

  • split.visible: Determines if the split handle is visible. Something to note: regardless of the value of this property the handle is still able to be dragged.

  • split.draggable: Determines if the split handle is draggable or not.

The split container also currently has two component specific events:

  • onMinBoundReached - Fired when the minimum bound on the container is reached by the split handle

  • onMaxBoundReached - Fired when the maximum bound on the container is reached by the split handle

That is a general overview of the Split Container, please give this component a try and feel free to post any feedback below. Thank you!

16 Likes

I gotta say, this is awesome! I’ve been hoping something like this was implemented and here it is!

1 Like

A few features I could see being really nice to use after playing with it a bit.

  1. Manage the styling of the resizing, so if we changed the split position programmatically we could control the movement speed in a transform, would allow for cleaner styling.
  2. Allowing for multiple splits, you could do this with nesting the containers but then you can’t control them as one, and you increase the number of components that need to be added into a screen, therefore loading time.
  3. Defining a min/max expansion size per-pane, would be nice if you didn’t want to make subviews responsive down to minuscule sizes.
  4. Customizing the styling of the split would be nice, take the split in the forums for typing a draft for instance, it’s thinner and cleaner looking in a tight environment. I can’t seem to figure out how to customize it other than making it invisible and so the default highlight is blue.
  5. Changing the default highlight through styling, I’m sure this is possible through theming (so is 4) but that’s a bit of a “super user task” still at this point.

All in all, super useful component and I look forward to augmenting builds with this!

Definitely will be nice to create pseudo-docked views that we have a bit more control over.

4 Likes

Good stuff!

1 Like

That’s awesome component.

Could add a new property for changing the icon of split handler?

And style the vertical split line

2 Likes

Ahh nice!
I’ve tried making this component myself a while ago, unfortunatly making containers is rather undocumented and hard so i had settle for “just the bar” and put it in the middle of a flex container which than manipulated the containers next to it.
It basicly works identical, but it needs a little more setup. So this is nice!

1 Like

I appreciate the feedback, and those are some good ideas! Especially regarding the general styling access and the min/max size. Going to take a look into those and get some tickets made regarding potential updates.

I appreciate it! I think both of those are good ideas and are doable for sure. I’ll take a look into it

1 Like

I have noticed when using this container my CPU usage spikes when I adjust the location on the split. This causes the dragging motion to seem a bit jumpy on the lower powered computer I typically use for HMIs. Is this something IA is aware of? Are there future performance improvements for this container in the works?

I see same issue

Thanks for bringing this to our attention, I was unaware of the CPU spikes while the split handle is moving. Ill create a ticket to take a look into some potential performance improvements on how that is implemented

1 Like

Hi @ghaugen

Is it possible to expose style option for both left and right containers. Right now applying style only effect the right side container.

So in nutshell we have 5 style sections:

1 splitter area
support following properties:
border
width

2 left side container
3 right side container
4 whole component
5 icon section

For icon we have property to change the icon

1 Like

+1 for user definable min/max

It’s just as awesome as i thought it would be! Thank you again :slight_smile:

2 Likes

Hi @ghaugen
It seems after updating to 8.1.18 the split container doesn’t work and doesn’t accept embedded view any more.

Hi @nader.chinichian,

I was not aware of that, thanks for pointing this out. Is it just not working in general and not accepting any component or just the embedded view component?

I work fine in general but I can’t drag and drop view into it.
I close and open view several times and some time randomly it accept embedded view.

Huh okay Im seeing a little bit of inconsistency as well, Im going to dig into this a bit deeper at some point today and get a ticket made for it.

1 Like

I happened to see this while looking for something else today, made a mental note, then later, I thought of exactly the place where I need to use this!

I went home and tried it on 8.1.19 Maker and am having no problems dropping an embedded view to both sides. I'm looking forward to putting it into this special place I have envisioned at work.

One question: Is it possible to make either side either shrinkable or cut it off as the split is moving, as if there is a shrink = 0 or 1 when components are being used in a Flex container?

Thanks!

It depends on the layout of the View being embedded, but this is very easy to do with Coordinate Container layouts in the View being embedded. If your View being embedded is a Flex layout, then you're only going to get the behavior you're looking for if the flex direction is the same as the handle movement, ie: direction = row in a Split Container with orientation = horizontal.

1 Like

Any updates on performance improvements?