ui.SplitPanel

  • The ui.SplitPanel widget divides a UI element into two resizable panels, horizontally or vertically.

  • Panel sizes can be customized using width/height and min/max dimensions, expressed in pixels or percentages.

  • The wipe option allows for a transition-like effect, ideal for comparing two map panels by overlaying them.

  • The split panel's default layout divides the space equally between the two panels.

  • Users can specify custom CSS styles to further customize the appearance of the ui.SplitPanel.

A widget containing two panels with a divider between them. The divider can be dragged, allowing the panels to be resized. One or both panels may be ui.Map objects.

By default the layout initializes with a 50/50 split. The width and max/minWidth styles on the panels control the split sizing for horizontal orientations. Similarly, use height and max/minHeight for vertical. These can be given in pixels as '{n}px' or as a percentage of the containing SplitPanel as '{n}%'.

Note that the given size for the second panel will be ignored if the first panel size is specified, since the overall width of the split panel is controlled independently. Max/min sizes may be set for both panels.

UsageReturns
ui.SplitPanel(firstPanel, secondPanel, orientation, wipe, style)ui.SplitPanel
ArgumentTypeDetails
firstPanelui.Panel, optionalThe left or top panel. Defaults to a new instance of ui.Panel.
secondPanelui.Panel, optionalThe bottom or right panel. Defaults to a new instance of ui.Panel.
orientationString, optionalOne of "horizontal" or "vertical". Defaults to "horizontal".
wipeBoolean, optionalWhether to enable the wiping effect. When this mode is enabled, both panels take up all available space, and dragging the divider doesn't set the size of the panels but rather determines how much of each panel is shown. This effect is analogous to a "wipe transition". This mode is useful for comparing two maps. Defaults to false.
styleObject, optionalAn object of allowed CSS styles with their values to be set for this panel. Defaults to an empty object.