Graph. | |
Graph. | An interface for plotting/hiding/showing labels. |
Graph. | Implements labels natively, using the Canvas text API. |
Functions | |
plotLabel | Plots a label for a given node. |
Graph. | Abstract Class implementing some DOM label methods. |
Functions | |
getLabelContainer | Lazy fetcher for the label container. |
getLabel | Lazy fetcher for the label element. |
hideLabels | Hides all labels (by hiding the label container). |
clearLabels | Clears the label container. |
disposeLabel | Removes a label. |
hideLabel | Hides the corresponding Graph.Node label. |
Graph. | Implements HTML labels. |
Functions | |
plotLabel | Plots a label for a given node. |
Graph. | Implements SVG labels. |
Functions | |
plotLabel | Plots a label for a given node. |
An interface for plotting/hiding/showing labels.
This is a generic interface for plotting/hiding/showing labels. The Graph.Label interface is implemented in multiple ways to provide different label types.
For example, the Graph.Label interface is implemented as Graph.Label.HTML to provide HTML label elements. Also we provide the Graph.Label.SVG interface for SVG type labels. The Graph.Label.Native interface implements these methods with the native Canvas text rendering functions.
All subclasses (Graph.Label.HTML, Graph.Label.SVG and Graph.Label.Native) implement the method plotLabel.
plotLabel: function( canvas, node, controller )
Plots a label for a given node.
canvas | (object) A Canvas instance. |
node | (object) A Graph.Node. |
controller | (object) A configuration object. |
var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config);
Abstract Class implementing some DOM label methods.
Graph.Label.HTML and Graph.Label.SVG.
Functions | |
getLabelContainer | Lazy fetcher for the label container. |
getLabel | Lazy fetcher for the label element. |
hideLabels | Hides all labels (by hiding the label container). |
clearLabels | Clears the label container. |
disposeLabel | Removes a label. |
hideLabel | Hides the corresponding Graph.Node label. |
getLabel: function( id )
Lazy fetcher for the label element.
id | (string) The label id (which is also a Graph.Node id). |
The label element.
var viz = new $jit.Viz(options); var label = viz.labels.getLabel('someid'); alert(label.innerHTML);
disposeLabel: function( id )
Removes a label.
id | (string) A label id (which generally is also a Graph.Node id). |
var viz = new $jit.Viz(options); viz.labels.disposeLabel('labelid');
hideLabel: function( node, show )
Hides the corresponding Graph.Node label.
node | (object) A Graph.Node. Can also be an array of Graph.Nodes. |
show | (boolean) If true, nodes will be shown. Otherwise nodes will be hidden. |
var rg = new $jit.Viz(options); viz.labels.hideLabel(viz.graph.getNode('someid'), false);
plotLabel: function( canvas, node, controller )
Plots a label for a given node.
canvas | (object) A Canvas instance. |
node | (object) A Graph.Node. |
controller | (object) A configuration object. |
var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config);
plotLabel: function( canvas, node, controller )
Plots a label for a given node.
canvas | (object) A Canvas instance. |
node | (object) A Graph.Node. |
controller | (object) A configuration object. |
var viz = new $jit.Viz(options); var node = viz.graph.getNode('nodeId'); viz.labels.plotLabel(viz.canvas, node, viz.config);
Plots a label for a given node.
plotLabel: function( canvas, node, controller )
Lazy fetcher for the label container.
getLabelContainer: function()
Lazy fetcher for the label element.
getLabel: function( id )
Hides all labels (by hiding the label container).
hideLabels: function ( hide )
Clears the label container.
clearLabels: function( force )
Removes a label.
disposeLabel: function( id )
Hides the corresponding Graph.Node label.
hideLabel: function( node, show )
Plots a label for a given node.
plotLabel: function( canvas, node, controller )
Plots a label for a given node.
plotLabel: function( canvas, node, controller )