Selection Tools

Search
Feedback

Grouping nodes can be usefull when the same action should be executed on more that one or a few nodes. With the Selection Tools module it is possible to create different node groups, that can be hidden, fixed (they are not effected by layout algorithms) or dragged at once.

Dependencies for this module:

  • jquery
  • sigma.min.js
  • sigma.plugins.dragListener.min.js
  • sigma.plugins.activeState.min.js
  • sigma.plugins.keyboard.min.js
  • sigma.plugins.select.min.js
  • sigma.plugins.lasso.min.js
  • sigma.renderers.halo.min.js
  • graph.browser.core.js
  • graph.browser.modulecontrol.js
  • graph.browser.modules.selectiontools.js

Settings

fields type description
onActivate function Will be called, when the element with the id `selectiontools-controlElement` is clicked and the module is activated
onDeactivate function Will be called, when the element with the id `selectiontools-controlElement` is clicked and the module is deactivated
onNewSelectionGroup function Will be called, when a new node selection group was created
onDeleteSelectionGroup function Will be called, when a node selection group was deleted
onClearSelectionGroup function Will be called, when the selection of a node selection group was cleared
onToggleLasso function Will be called, when lasso tool was activated or deactivated

Example

var graphSettings = {
    graphContainer: 'graph-container',
    moduleSettings: {'selectionTools': {'onActivate': control.selectionsOnActivate, 'onDeactivate': control.selectionsOnDeactivate}}
};

var graphBrowser = new GraphBrowser(graphSettings);

Needed HTML fields

HTML IDs description
selectiontools-controlElement When this element is clicked, the control elements for the selsction tools are shown. The current standard implementation will set the elements visibibility attribute to false!
selectionTools-btnCreateNewSelectionGroup When clicked, a new selection will be created
selectionTools-btnDeleteSelectedSelectionGroup When clicked, the selescted selection group will be deleted
selectionTools-btnToggleLasso When clicked, the lasso tool will be activated / deactivated. The can be also achieved by the key combination “space+s”
selectiontools-selectionTable-groupSelectionItems This element should be a tablebody, because it will be filled with a tr element. Inside of this element will be 3 different td elements. A radiobutton that represents a selection group with a label that indicates the name of the selection group. A checkbox wich fixates/unfixates the nodes of the selection group. A checkbox that hides/unhides the nodes of the selection group

Created HTML fields

tag classes purpose
<td> selectiontools-selectionTable-selectionGroup-radioButton These are the radiobuttons with wich the selection groups can be switched
<td> selectiontools-selectionTable-selectionGroup-fixate These are the checkboxes with wich the nodes of a selection group can be fixated (They still can be replaced by dragging them with the mouse)
<td> selectiontools-selectionTable-selectionGroup-hide These are the checkboxes with wich the nodes of a selsction can be hidden or unhidden

Graph-Browser

About this article
Last change 2016-08-29
Topics ExperimentalStructr 2.0