popoto.graph

This package contains all the code related to graph generation.

Content:
link, node,


popoto.graph.containerId

This property contains the ID of the HTML element where to generate the graph component. If the HTML page contains an element with this ID the graph elements will be generated.

Default value is "popoto-graph"


popoto.graph.Events

Define the list of listenable events on graph. The list of event

popoto.graph.Events.NODE_ROOT_ADD: Triggered when root node is added on graph.

popoto.graph.Events.NODE_EXPAND_RELATIONSHIP: Triggered when relationships are expanded on a node (click on plus sign).


popoto.graph.WHEEL_ZOOM_ENABLED

Define whether the zoom on graph is modifiable by mouse wheel. Set to false to disable it.

Default value is "true"


popoto.graph.LINK_DISTANCE

Defines the distance between two nodes in the graph. Default value is 150.
See D3 force layout wiki for more details.


popoto.graph.LINK_STRENGTH

Defines the strength (rigidity) of links. The value must be in the range [0,1]. Default value is 1.
See D3 force layout wiki for more details.


popoto.graph.FRICTION

Defines the friction coefficient. The value must be in the range [0,1]. Default value is 0.8.
See D3 force layout wiki for more details.


popoto.graph.CHARGE

Defines the nodes charge. A negative value results in node repulsion, while a positive value results in node attraction. Default value is -1400.
See D3 force layout wiki for more details.


popoto.graph.THETA

Defines the Barnes-Hut approximation criterion. Default value is 0.8.
See D3 force layout wiki for more details.


popoto.graph.GRAVITY

Defines the gravitational strength. Default value is 0 (no gravity).
See D3 force layout wiki for more details.


popoto.graph.on (event, listener)

Add a listener to the specified event.

The list of events is defined in popoto.graph.Events


popoto.graph.link

This package contains all the code related to links generation in the graph.


popoto.graph.link.RADIUS

Defines the radius around the node to start link drawing. If set to 0 links will start from the middle of the node.


popoto.graph.link.LinkTypes

Contains all the different type of links:
RELATION: is a relation link between two nodes.
VALUE: is a link between a generic node and a value.


popoto.graph.node

This package contains all the code related to nodes generation in the graph.


popoto.graph.node.NodeTypes

Contains all the different type of nodes:
ROOT: Node used as graph root. It is the target of the query. Only one node of this type should be available in graph.
CHOOSE: Nodes defining a generic node label. From these node is is possible to select a value or explore relations.
VALUE: Unique node containing a value constraint. Can be stored in a CHOOSE nodes once a value as been selected.
GROUP: Empty node used to group relations. No value can be selected but relations can be explored. These nodes doesn't have count.


popoto.graph.node.CountBox

Defines the SVG rectangle position and size of the count box on a node.
Default value is {x: 16, y: 33, w: 52, h: 19}


popoto.graph.node.PAGE_SIZE

Defines the Number of value nodes displayed on click on a choose node.
Default value is 10.


popoto.graph.node.TEXT_Y

Defines the offset to add on Y axis for node displayed text label. This property can be use customize text position on nodes.


popoto.graph.node.BACK_CIRCLE_R

Defines the radius of the highlighting circle displayed on node background on mouse over.


popoto.graph.node.NODE_MAX_CHARS

Defines the maximum number of character used to display node label on graph if no customization have been done on "getTextValue" function in provider.
Default value is 11.


popoto.graph.node.ELLIPSE_RX

Defines the node SVG ellipse rx size for nodes using popoto.provider.NodeDisplayTypes.TEXT display type.
Default value is 50.


popoto.graph.node.ELLIPSE_RY

Defines the node SVG ellipse ry size for nodes using popoto.provider.NodeDisplayTypes.TEXT display type.
Default value is 25.