Example: A table with rowClick and context menu.

Label: Example_5 This example illustrates the setup of a rowClick and a context-menu, linked to table row. Once the interaction has been created, you can:

  • Get a count of all types of  :TRIGGER relations between functions, with an output to a TableView
  • Click on a table row to trigger a CypherQuery with output to a NetworkView, to display all individual instances
  • Right-click on a on a table row to trigger a CypherQuery with output to a TableView, to display the details of the individual instances. In this second table, a click on a table row triggers a display of the selected instance of the trigger

This example also illustrates how you can re-use :IA_Function nodes that were created during the install procedure, in this case the :IA_NetworkView node. This is an efficient way to take advantage of the interactions that are built in, like the display of node and relations properties in the KeysView panel.

To build the example, set the Output of the Neo4j SearchView panel in the left sidebar to "Network" and paste the following Cypher into the Cypher statement control. Then click [Execute]. The required functions are created (all have label :Example_5) and displayed together with the :IA_NetworkView node that was created during install.


MATCH (nv:IA_NetworkView:IA_Install)
WITH nv

CREATE (_180421:Example_5:IA_Function:IA_Neo4jQuery {`name`:'Get trigger type counts', `cypher`:'MATCH (from:IA_Function)-[trigger:TRIGGER]->(to:IA_Function)
RETURN labels(from) AS labelsFrom,trigger.type AS triggerType,labels(to) AS labelsTo,count(trigger) AS countTrigger
ORDER BY countTrigger DESC '})
CREATE (_180423:Example_5:IA_Function:IA_TableView {`$container.id`:'triggertypes', `name`:'Trigger types'})
CREATE (_180425:Example_5:IA_Function:IA_Neo4jQuery {`name`:'Get triggers', `process`:'true', `cypher`:'MATCH (from:IA_Function)-[trigger:TRIGGER]->(to:IA_Function)
WHERE labels(from)={labelsFrom}
AND labels(to)={labelsTo}
AND trigger.type={triggerType}
RETURN trigger
'})
CREATE (_180429:Example_5:IA_Function:IA_Neo4jQuery {`name`:'Get trigger details', `cypher`:'MATCH (from:IA_Function)-[trigger:TRIGGER]->(to:IA_Function)
WHERE labels(from)={labelsFrom}
AND labels(to)={labelsTo}
AND trigger.type={triggerType}
RETURN from,trigger,to
'})
CREATE (_180431:Example_5:IA_Function:IA_TableView {`$container.id`:'triggerdetails', `name`:'Trigger details'})
CREATE (_180434:Example_5:IA_Function:IA_Neo4jQuery {`name`:'Get trigger', `process`:'true', `cypher`:'MATCH ()-[trigger:TRIGGER]->()
WHERE id(trigger)={idTrigger}
RETURN trigger
'})
CREATE (_180421)-[_546695:TRIGGER {`type`:'success', `#data`:'(%).data'}]->(_180423)
CREATE (_180425)-[_546697:TRIGGER {`#relations`:'(%).processed.relations', `#nodes`:'(%).processed.nodes', `type`:'success',`$autoComplete`:'false'}]->(nv)
CREATE (_180423)-[_546698:TRIGGER {`$params.triggerType`:'(%).data.triggerType', `#params.labelsTo`:'(%).data.labelsTo', `#params.labelsFrom`:'(%).data.labelsFrom', `type`:'rowClick'}]->(_180425)
CREATE (_180423)-[_59819:TRIGGER {`$params.triggerType`:'(%).target.triggerType', `#params.labelsTo`:'(%).target.labelsTo', `menu`:'row', `#params.labelsFrom`:'(%).target.labelsFrom', `action`:'Get details', `type`:'context'}]->(_180429)
CREATE (_180429)-[_63191:TRIGGER {`type`:'success', `#data`:'(%).data'}]->(_180431)
CREATE (_180434)-[_65025:TRIGGER {`#relations`:'(%).processed.relations', `#nodes`:'(%).processed.nodes', `type`:'success',`$autoComplete`:'false'}]->(nv)
CREATE (_180431)-[_63196:TRIGGER {`$params.idTrigger`:'(%).data.trigger.id', `type`:'rowClick'}]->(_180434)
WITH COUNT(*) AS foo
MATCH (n:Example_5)--(m) RETURN n,m

The functions involved in this example show up. Note that the :IA_NetworkView node (the yellow square)does NOT have a :Example_5 label.

To run the example, select the "Get trigger type counts" :IA_Neo4jQuery node. Its properties will be displayed in the KeysView panel, in which you find an [Execute query] button.

When you click the [Execute query] button, the "Trigger types" table appears.

After clicking on a row, a NetworkView appears with the instances of the selected trigger.

When you right-click on a row and subsequently select "Get details" in the context-menu, a "Trigger details" table is displayed with the details of instances of the selected trigger.

The "Trigger details" table has a rowClick trigger linked to it, to display an individual instance in a NetworkView.