Current Node Types

Search
Feedback

CurrentNodeTypes is a module for the Graph-Browser that displays all node types that are currently shown in the Graph-Browser as buttons in a given html container. Each button has the backgroundcolor of the nodetype it represents and will highlight all nodes of the type, when it’s hovered and hide/unhide them when it’s clicked.

Settings

Fields Type Description
containerstringThe id of the container in wich the nodeTypeButtons can be put
classesstringOptional css classes for the nodeTypeButton-elements

Example

var graphSettings = {
    graphContainer: 'graph-container',
    moduleSettings: {'currentNodeTypes': {'container': 'graph-container', 'classes': 'btn btn-block'} }  
};
var graphBrowser = new GraphBrowser(graphSettings);

Functions

Name Parameters Description
getCurrentNodeTypes()Returns the node types that are currently present in the Graph-Browser
getCurrentRelTypes()Returns the relationship types that are currently present in the Graph-Browser
highlightNodeType(nodeType){string} nodeType the node type that should be highlightedHighlights all nodes of the given node type
unhighlightNodeType(nodeType){string} nodeType the node type that shouldn’t be highlighted anymoreUnhighlights all nodes of the given node type
highlightRelType(relType){string} relType the relationship type that should be highlightedHighlights all edges of the given relationship type
unhighlightRelType(relType){string} relType the relationship type that shouldn’t be highlighted anymoreUnhighlights all edges of the given relationship type

Created HTML fields

TagHTML IDsClassesPurpose
<div>currentNodeTypes-displayTypescurrentNodeTypes-displayTypesWill be put in the settings’ container and filled with <a>-elements for each datatype shown in the graph
<div>currentNodeTypes-nodeType-Btn{NodeType}currentNodeTypesButtonOne <a>-element for each type in the graphview. can be hovered for node highlighting, or clicked to hide/unhide the nodes of one type. The coler-style property of each button will be set to the color of the node Type.

Graph-Browser

About this article
Last change 2017-07-17
Topics ExperimentalStructr 2.0