Constructor
new BaseWidget(parent)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layout.position |
'left' | 'right' |
<optional> |
'left' | Whether to float the widget left or right. |
layout.group_position |
'start' | 'middle' | 'end' |
<optional> |
Buttons can optionally be gathered into a visually distinctive group whose elements are closer together. If a button is identified as the start or end of a group, it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group. For example, the region_nav_plot toolbar is a defined as a group. |
|
layout.color |
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' |
<optional> |
'gray' | Color scheme for the widget. Applies to buttons and menus. |
layout.style |
<optional> |
CSS styles that will be applied to the widget |
||
parent |
Toolbar | The toolbar that contains this widget |
- Source:
Members
button :null|Button
If this is an interactive widget, it will contain a button or menu instance that handles the interactivity. There is a 1-to-1 relationship of toolbar widget to button
Type:
- null | Button
- Source:
layout :Object
Type:
- Object
- Source:
parent :Toolbar|*
Type:
- Toolbar | *
- Source:
parent_panel :Panel|null
Some widgets are attached to a panel, rather than directly to a plot
Type:
- Panel | null
- Source:
parent_plot :Plot
Type:
- Source:
parent_svg :Plot|Panel
This is a reference to either the panel or the plot, depending on what the toolbar is tied to. Useful when absolutely positioning toolbar widgets relative to their SVG anchor.
Type:
- Source:
(protected) persist :Boolean
If any single widget is marked persistent, it will bubble up to prevent automatic hide behavior on a
widget's parent toolbar. Check via shouldPersist
Type:
- Boolean
- Source:
selector :d3.selection
Type:
- d3.selection
- Source:
Methods
destroy(forceopt) → {Toolbar}
Completely remove widget and button. (may be overridden by persistence settings)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
force |
Boolean |
<optional> |
false | If true, will ignore persistence settings and always destroy the toolbar |
- Source:
Returns:
- Type
- Toolbar
hide() → {BaseWidget}
Toggle visibility to hidden, unless marked as persistent
- Source:
Returns:
- Type
- BaseWidget
position() → {BaseWidget}
Place the widget correctly in the plot
- Source:
Returns:
- Type
- BaseWidget
shouldPersist() → {boolean}
Determine whether the widget should persist (will bubble up to parent toolbar)
- Source:
Returns:
- Type
- boolean
show()
Perform all rendering of widget, including toggling visibility to true. Will initialize and create SVG element if necessary, as well as updating with new data and performing layout actions.
- Source:
update()
Update the toolbar widget with any new data or plot state as appropriate. This method performs all necessary rendering steps.
- Source: