diff --git a/docs/css/style.css b/docs/css/style.css new file mode 100644 index 00000000..f0c251df --- /dev/null +++ b/docs/css/style.css @@ -0,0 +1,87 @@ +html, body { + width: 100%; + height: 100%; + padding: 0; + margin: 0; +} + +body, td, th { + font-family: arial, sans-serif; + font-size: 11pt; + color: #4D4D4D; + line-height: 1.7em; +} + +#container { + margin: 0 auto; + padding-bottom: 50px; + width: 900px; +} + +h1 { + font-size: 180%; + font-weight: bold; + padding: 0; + margin: 1em 0 1em 0; +} + +h2 { + padding-top: 20px; + padding-bottom: 10px; + border-bottom: 1px solid #a0c0f0; + color: #2B7CE9; +} + +h3 { + font-size: 140%; +} + + +a { + color: #2B7CE9; + text-decoration: none; +} +a:visited { + color: #2E60A4; +} +a:hover { + color: red; + text-decoration: underline; +} + +hr { + border: none 0; + border-top: 1px solid #abc; + height: 1px; +} + +pre { + display: block; + font-size: 10pt; + line-height: 1.5em; + font-family: monospace; +} + +pre, code { + background-color: #f5f5f5; +} + +table +{ + border-collapse: collapse; +} + +th { + font-weight: bold; + border: 1px solid lightgray; + background-color: #E5E5E5; + text-align: left; + vertical-align: top; + padding: 5px; +} + +td { + border: 1px solid lightgray; + padding: 5px; + vertical-align: top; +} diff --git a/docs/graph.html b/docs/graph.html new file mode 100644 index 00000000..25ada445 --- /dev/null +++ b/docs/graph.html @@ -0,0 +1,1532 @@ + + + + + Graph documentation + + + + + + + + + +
+ +

Graph documentation

+ + + + + + + + + + + + + + +
AuthorJos de Jong, Almende B.V.
Webpagehttp://visjs.org
License Apache License, Version 2.0
+ + +

Contents

+ + +

Overview

+

+ Graph is a visualization to display graphs and networks consisting of nodes + and edges. The visualization is easy to use and supports custom styles, + colors, sizes, images, and more. +

+ +

+ The graph visualization works smooth on any modern browser for up to a + few hundred nodes and edges. +

+ +

+ To get started with Graph, install or download the + vis.js library. +

+ +

Example

+

+ Here a basic graph example. More examples can be found in the + examples directory. +

+ +
<!doctype html>
+    <html>
+    <head>
+        <title>Graph | Basic usage</title>
+
+        <script type="text/javascript" src="../../vis.js"></script>
+    </head>
+
+    <body>
+
+    <div id="mygraph"></div>
+
+    <script type="text/javascript">
+        // create an array with nodes
+        var nodes = [
+            {id: 1, text: 'Node 1'},
+            {id: 2, text: 'Node 2'},
+            {id: 3, text: 'Node 3'},
+            {id: 4, text: 'Node 4'},
+            {id: 5, text: 'Node 5'}
+        ];
+
+        // create an array with edges
+        var edges = [
+            {from: 1, to: 2},
+            {from: 1, to: 3},
+            {from: 2, to: 4},
+            {from: 2, to: 5}
+        ];
+
+        // specify options
+        var options = {
+            width: '400px',
+            height: '400px'
+        };
+
+        // create a graph
+        var graph = new vis.Graph(document.getElementById('mygraph'));
+
+        // draw the graph with the created data and options
+        graph.draw(nodes, edges, options);
+    </script>
+
+    </body>
+    </html>
+
+ + +

Loading

+

+ Install or download the vis.js library. + in a subfolder of your project. Include the library script in the head of your html code: +

+ +
+<script type="text/javascript" src="vis/vis.js"></script>
+
+ + +The class name of the Graph is vis.Graph +
var graph = new vis.Graph(container);
+ +After being loaded, the graph can be drawn via the function draw(), +provided with data and options. +
graph.draw(nodes, edges, packages, options);
+where nodes, edges, and packages are +an Array, and options is a name-value map in the +JSON format. Both edges and packages are optional. + + + + +

Data Format

+

+ Graph accepts the following data +

+ + +

Nodes

+ +

+ The node array is required for the graph visualization. + + The array must contain at least a property id. + The array can have extra properties, used to define the type and style of + individual nodes. +

+ +

+ A JavaScript Array with nodes is constructed like: +

+
+var nodes = [
+    {
+      'id': 1,
+      'text': 'Node 1'
+    },
+    // ... more data
+];
+
+ + +

+ The node properties are defined as: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeRequiredDescription
actionstringnoBy specifying action, a node can be created, updated, + or deleted. This is useful in combination with timestamp + to animate history, or for dynamically updating the graph. + + Available values are: create, + update (default), or delete. +
backgroundColorString"#97C2FC"Background color for the node.
borderColorString"#2B7CE9"Border color for the node.
group*noA group number or name. The type can be number, + string, or an other type. All nodes with the same group get + the same color schema.
fontColorString"black"Font color for text in the node.
fontFaceString"sans"Font face for text in the node, for example "verdana" or "arial".
fontSizeNumber14Font size in pixels for text in the node.
highlightColorString"#D2E5FF"Background color of the node when selected.
id*yesA unique id for this node. + Nodes may not have duplicate id's. + Id's do not need to be consecutive. + An id is normally a number, but may be any type.
imagestringnoUrl of an image. Only applicable when the style of the node is + image.
radiusnumbernoRadius for the node. Applicable for all styles except rect, + circle, and database. + The value of radius will override a value in + property value.
stylestringnoDefine the shape for the node. + Choose from rect (default), circle, + database, image, text, + dot, star, triangle, + triangleDown, and square. +

+ + In case of image, a property with name image must + be provided, containing image urls. +

+ + The shapes dot, star, triangle, + triangleDown, and square, are scalable. + The size is determined by the properties radius or + value. +

+ + When a property text is provided, + this text will be displayed inside the shape in case of styles + rect, circle, and database. + For all other shapes, the text will be displayed right below the shape. + +
textstringnoText to be displayed in the node or under the image of the node. + Multiple lines can be separated by a newline character \n .
timestampDate | NumbernoTimestamp used for filtering nodes when animating. + See section Animation for more information.
titlestringnoTitle to be displayed when the user hovers over the node. + The title can contain HTML code.
valuenumbernoA value for the node. + The radius of the nodes will be scaled automatically from minimum to + maximum value. + Only applicable when the style of the node is dot. + If a radius is provided for the node too, it will override the + radius calculated from the value.
xnumbernoHorizontal position in pixels. + The horizontal position of the node will be fixed. + The vertical position y may remain undefined.
ynumbernoVertical position in pixels. + The vertical position of the node will be fixed. + The horizontal position x may remain undefined.
+ + +

Edges

+ +

+ The array with edges must at least contain properties from and + to. + The array can have extra properties, used to define the type and style of + individual edges. +

+ +

+ A JavaScript Array with edges is constructed as: +

+
+var edges= [
+    {
+      'from': 1,
+      'to': 3
+    },
+    // ... more data
+];
+
+ +

+ The edge properties are defined as: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeRequiredDescription
actionstringnoBy specifying action, a link can be created, updated, + or deleted. This is useful in combination with timestamp + to animate history, or for dynamically updating the graph. + + An action on a link can only be used when the link has an id. + + Available values are: create (default), + update, or delete. + +
altdashlengthnumbernoLength of the alternated dash in pixels on a dashed line. + Specifying altdashlength allows for creating + a dashed line with a dash-dot style, for example when + dashlength=10 and altdashlength=5. + See also the option dashlength. + Only applicable when the line style is dash-line.
colorstringnoA HTML color for the link.
dashlengthnumbernoLength of a dash in pixels on a dashed line. + Only applicable when the line style is dash-line.
dashgapnumbernoLength of a gap in pixels on a dashed line. + Only applicable when the line style is dash-line.
fontColorString"black"Font color for the text label of the link. + Only applicable when "text" is defined.
fontFaceString"sans"Font face for the text label of the link, + for example "verdana" or "arial". + Only applicable when "text" is defined.
fontSizeNumber14Font size in pixels for the text label of the link. + Only applicable when "text" is defined.
from*yesThe id of a node where the link starts. The type must correspond with + the type of the node id's. This is normally a number, but can be any + type.
lengthnumbernoThe length of the link in pixels.
stylestringnoDefine a drawing style for the link. + Choose from line (default), arrow, + arrow-end, moving-arrows, + or dash-line. +
textstringnoText to be displayed halfway the link.
timestampDate | NumbernoTimestamp used for filtering edges when animating. + See section Animation for more information.
titlestringnoTitle to be displayed when the user hovers over the link. + The title can contain HTML code.
to*yesThe id of a node where the link ends. The type must correspond with + the type of the node id's. This is normally a number, but can be any + type.
valuenumbernoA value for the link. + The width of the edges will be scaled automatically from minimum to + maximum value. + If a width is provided for the link too, it will override the + width calculated from the value.
widthnumbernoWidth of the line in pixels. The width will + override a specified value, if a value is + specified too.
+ + + +

Packages

+

+ The array with packages must at least contain properties from and + to. + The array can have extra properties, used to define the type and style of + individual packages. +

+ +

+ There are two types of packages: +

+ + + +

+ A JavaScript Array with packages is constructed as: +

+
+var packages = [
+    {
+        'from': 1,
+        'to': 3
+    }
+    // ... more data
+];
+
+ + +

+ The package properties are defined as: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeRequiredDescription
actionstringnoBy specifying action, a package can be created or deleted. + + Available values are: create (default), + update, or delete. + + When a package is created with an id which already exists, the existing + package will be updated. The action property can be used in + combination with timestamp to animate history. +
colorstringnoA HTML color for the package.
durationnumbernoDuration in seconds the animation of the package moving from start to + end node. Only applicable when progress is not provided. +
from*yesThe id of a node where the link starts. The type must correspond with + the type of the node id's. This is normally a number, but can be any + type.
id*yesA unique id for the package. Packages cannot have duplicate id's. + An id is required for packages with manually defined progress, + in order to be able to update or delete them lateron. +
imagestringnoUrl of an image. Only applicable when style is image.
progressnumbernoA number between 0 and 1 which determines the progress of the package + between the start and end node. If progress is defined, the package must + also have an id defined. +
radiusnumbernoThe radius of the package. Only applicable when style is dot.
stylestringnoDefine a drawing style for the package. + Choose from dot (default), image, + star, triangle, triangleDown, or + square. + + In case of an image, a property with image url must be provided in the package. +
titlestringnoTitle to be displayed when the user hovers over the package. + The title can contain HTML code.
to*yesThe id of a node where the link ends. The type must correspond with + the type of the node id's. This is normally a number, but can be any + type.
timestampDate or numbernoThe time on which this package is added or removed. + Only applicable in combination with the property action. + When timestamp is provided, a slider with start and stop button is created + to enable playing history. +
valuenumbernoA value for the package. + The radius of the packages will be scaled automatically from minimum to + maximum value. + Only applicable when the style of the node is dot. + If a parameter radius is provided for the node too, + this will override the radius calculated from the value.
+ +

Data Import

+ +

+ Graph contains parser to import data in the + DOT language. + There following methods are available: +

+ + + + + + + + + + + + + + + + + + +
MethodReturn TypeDescription
vis.Graph.util.parseDOT(data)Object + Parse a string containing data in DOT language into a JSON object. + The returned object contains two arrays, nodes, + edges, containing the parsed nodes and edges. +
vis.Graph.util.DOTToGraph(data)Object + Convert a string containing a graph in DOT language into a map + containing with nodes and edges in the format of Graph. + The returned object contains parameters nodes, + edges, and options, which can be used + directly to draw a graph using draw(nodes, edges, options). +
+ +

+Example usage: +

+ +
+    // create a graph view
+    var graph = new vis.Graph(container);
+
+    // parse data in DOT-notation
+    var dot = 'digraph {1 -> 1 -> 2; 2 -> 3; 2 -- 4; 2 -> 1 }';
+    data = vis.Graph.util.DOTToGraph(dot);
+
+    // draw the data
+    graph.draw(data.nodes, data.edges, data.options);
+
+ + +

Configuration Options

+ +

+ Options can be used to customize the graph. Options are defined as a JSON object. + All options are optional. +

+ +
+var options = {
+    'width':  '100%',
+    'height': '400px',
+    'edges': {
+        'color': 'red',
+        'width': 2
+    }
+};
+
+ +

+ The following options are available. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
backgroundColorString or Object"white"The background color for the main area of the chart. + Can be either a simple HTML color string, for example: 'red' or '#00cc00', + or an object with optional properties stroke, strokeWidth, and fill.
backgroundColor.strokeString"#666"The color of the chart border, as an HTML color string.
backgroundColor.strokeWidthNumber1The border width, in pixels.
backgroundColor.fillString"white"The chart fill color, as an HTML color string.
groupsObjectnoneIt is possible to specify custom styles for groups. + Each node assigned a group gets the specified style. + See Groups for an overview of the available styles + and an example. +
heightString"400px"The height of the graph in pixels or as a percentage.
edges.altdashlengthnumbernoneLength of the alternated dash in pixels on a dashed line. + Specifying altdashlength allows for creating + a dashed line with a dash-dot style, for example when + dashlength=10 and altdashlength=5. + See also the option dashlength. + Only applicable when the line style is dash-line.
edges.colorString"#2B7CE9"The default color of a link.
edges.dashlengthnumber10Length of a dash in pixels on a dashed line. + Only applicable when the line style is dash-line.
edges.dashgapnumber5Length of a gap in pixels on a dashed line. + Only applicable when the line style is dash-line.
edges.lengthNumber100The default length of a link.
edges.styleString"line"The default style of a link. + Choose from line (default), arrow, + moving-arrows, dash-line.
edges.widthNumber1The default width of a link.
nodes.borderColorString"#2B7CE9"Default border color of the nodes
nodes.backgroundColorString"#97C2FC"Default background color of the nodes
nodes.highlightColorString"#D2E5FF"Default background color of the node when the node is selected.
nodes.fontColorString"black"Default font color for text in the nodes.
nodes.fontFaceString"sans"Default font face for text in the nodes, for example "verdana" or "arial".
nodes.fontSizeNumber14Default font size in pixels for text in the nodes.
nodes.groupStringnoneDefault group for the nodes.
nodes.imageStringnoneDefault image url for the nodes. only applicable with style image.
nodes.widthMinNumber16The minimum width for a scaled image. Only applicable with style image.
nodes.widthMaxNumber64The maximum width for a scaled image. Only applicable with style image.
nodes.styleString"rect"The default style for all nodes. + Choose from rect (default), circle, + database, image, text, dot. + This style can be overridden by a group style, or by a style of an individual node.
nodes.radiusNumber5The default radius for a node. Only applicable with style dot.
nodes.radiusMinNumber5The minimum radius for a scaled node. Only applicable with style dot.
nodes.radiusMaxNumber20The maximum radius for a scaled node. Only applicable with style dot.
packages.colorString"#2B7CE9"Default color for all packages
packages.durationNumber1.0Default duration of animated packages in seconds.
packages.imageStringnoneDefault image for all packages. + Style of the packages must be set to image
packages.widthMinNumber16The minimum width for a scaled package. Only applicable with style image.
packages.widthMaxNumber64The maximum width for a scaled package. Only applicable with style image.
packages.radiusNumber5Default radius for all packages.
packages.radiusMinNumber5The minimum radius for a scaled package. Only applicable with style dot.
packages.radiusMaxNumber20The maximum radius for a scaled package. Only applicable with style dot.
packages.styleString"dot"Default style for all packages. + Choose from dot (default) or image. + In case of an image, a property with image url must be provided in the package.
selectableBooleantrueIf true, nodes in the graph can be selected by clicking them, or + by keeping the Shift key down and dragging a selection area around them. + When the Ctrl key is down, the new selection is appended to the + previous selection. If not, the new selection replaces the previous selection.
stabilizeBooleantrueIf true, the graph is stabilized before displaying it. If false, + the nodes move to a stabe position visibly in an animated way.
widthString"400px"The width of the graph in pixels or as a percentage.
+ +
+ +

Groups

+ +

It is possible to specify custom styles for groups of nodes. + Each node having assigned to this group gets the specified style. + The options groups is an object containing one or multiple groups, + identified by a unique string, the groupname. +

+

+ A group can have the following styles: +

+ +
+var options = {
+  // ...
+
+  'groups': {
+    'mygroup': {
+      'style': 'circle',
+      'borderColor': 'black',
+      'backgroundColor': 'white',
+      'fontColor': 'red',
+      'fontSize': 18,
+      'highlightColor': 'yellow'
+    }
+    // add more groups here
+  }
+};
+
+var nodes = [
+    {id: 1, text: 'Node 1'},                    // will get the default style
+    {id: 2, text: 'Node 2', group: 'mygroup'},  // will get the style from 'mygroup'
+    // ... more data
+];
+
+ + +

The following styles are available for groups:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
borderColorString"#2B7CE9"Border color of the node
backgroundColorString"#97C2FC"Background color of the node
highlightColorString"#D2E5FF"Background color of the node when the node is selected.
imageStringnoneDefault image for the nodes. Only applicable in combination with + style image.
fontColorString"black"Font color of the node.
fontFaceString"sans"Font name of the node, for example "verdana" or "arial".
fontSizeNumber14Font size for the node in pixels.
styleString"rect"Choose from rect (default), circle, + database, image, text, + dot. + In case of image, a property with name image must be provided, containing + image urls.
radiusNumber5Default radius for the node. Only applicable in combination with + styles rect and dot.
+ + + +

Dynamic Data

+ +

+ The Graph is normally rendered using the method draw. + The graph can handle dynamic data in two ways: +

+ + + +

Animation

+

+ Historical data can be animated over time. + To create an animation, the data sets with nodes, edges, and + packages must have a property timestamp, + and has a property action describing the + change (create, update, or delete). + The Graph will automatically create an animation which runs from + the earliest to the latest encountered timestamp. + When the Graph is rendered at a certain timestamp, + all elements with a timestamp older than the current time will be rendered, + and all elements without a timestamp. +

+ +

+ The animation state and speed can be manipulated using methods + animationSetAcceleration, + animationSetDuration, + animationSetFramerate, + animationStart, + and animationStop. +

+ +

+ The following package table shows how to change the state of a package over time: +

+ +
+var packageTable = new google.visualization.DataTable();
+packageTable.addColumn('number', 'id');
+packageTable.addColumn('number', 'from');
+packageTable.addColumn('number', 'to');
+packageTable.addColumn('string', 'action');
+packageTable.addColumn('string', 'title');
+packageTable.addColumn('number', 'progress');
+packageTable.addColumn('datetime', 'timestamp');
+
+// package with id 7 moved over time from node 1 to node 2
+//                   id, from, to, action,  title,              progress,  timestamp
+packageTable.addRow([7,  1,    2, 'create', 'Copy data [0%]',   0.00,      new Date(2012,6,4,14,0,0)]);
+packageTable.addRow([7,  1,    2, 'update', 'Copy data [10%]',  0.10,      new Date(2012,6,4,14,10,0)]);
+packageTable.addRow([7,  1,    2, 'update', 'Copy data [20%]',  0.20,      new Date(2012,6,4,14,15,0)]);
+packageTable.addRow([7,  1,    2, 'update', 'Copy data [50%]',  0.50,      new Date(2012,6,4,14,20,0)]);
+packageTable.addRow([7,  1,    2, 'update', 'Copy data [80%]',  0.80,      new Date(2012,6,4,14,30,0)]);
+packageTable.addRow([7,  1,    2, 'update', 'Copy data [100%]', 1.00,      new Date(2012,6,4,14,35,0)]);
+packageTable.addRow([7,  1,    2, 'delete', undefined,          undefined, new Date(2012,6,4,14,40,0)]);
+
+ +

Changeset

+

+ The data of a rendered Graph can be changed dynamically. + Data can be updated by appending a changeset to the Graph + using methods addNodes, addEdges, and addPackages. + + The appended data can contain new nodes, edges, and packages, but can + also adjust existing elements. + For example, the title of a Node or the width of a link can be updated. +

+ +

+ The changeset is a regular Array like used + The action property describes one of the following changes +

+ + + + +

Methods

+

+ Graph supports the following methods. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodReturn TypeDescription
addEdges(edges)noneDynamically appends edges to the graph. + Parameter edges contains an Array. + A link can be created, updated, or deleted by specifying the property + action and choose a value create, + update, or delete. +
addNodes(nodes)noneDynamically adds nodes to the graph. + Parameter nodes contains an Array. + A node can be created, updated, or deleted by specifying the property + action and choose a value create, + update, or delete. +
addPackages(packages)noneDynamically appends packages to the graph. + Parameter packages contains an Array. + A package can be created, updated, or deleted by specifying the property + action and choose a value create, + update, or delete. +
animationSetAcceleration(acceleration)noneSet the time acceleration for animation of history. + Only applicable when packages with a timestamp are available. + When acceleration is 1, history is played in real time. + And for example acceleration of 10 will play history then times the speed of + real time.
animationSetDuration(duration)noneDuration of the animation in seconds. + Only applicable when packages with a timestamp are available. + The animation speed is scaled such that the total duration of playing the + history equals the set duration.
animationSetFramerate(framerate)noneSet the framerate in frames per second for animation of history. + Only applicable when packages with a timestamp are available. +
animationStart()noneStart animation of history. + Only applicable when packages with a timestamp are available. +
animationStop()noneStop animation of history. + Only applicable when packages with a timestamp are available. +
draw(nodes, edges, packages, options)noneLoads data, sets the provided options, and draws the graph. + Parameters nodes, edges, and packages are an Array, + and options is a name-value map in the JSON format. + Both edges and packages are optional and can be left undefined. +
getSelection()Array of selection elementsStandard getSelection() implementation. + Returns an array with one or multiple selections. Each selection contains + the property row. The selections are not ordered. +
redraw()noneRedraw the graph. Useful after the camera position is changed externally, + when data is changed, or when the layout of the webpage changed.
setSelection(selection)noneStandard setSelection(selection) implementation. + selection is an array with selection elements. The visualization + accepts one or multiple selection elements, which must have the property row. + Example usage: graph.setSelection([{"row": 3}]);. +
setSize(width, height)noneParameters width and height are strings, + containing a new size for the visualization. Size can be provided in pixels + or in percentages.
start()noneStart animation. + Only applicable when there are animated edges or nodes, + or when the nodes are not yet moved to a stable position.
stop()noneStop animation. + Only applicable when there are animated edges or nodes.
+ +

Events

+

+ Graph fires events after one or multiple nodes are selected. + The event can be catched by creating a listener. +

+ +

+ Here an example on how to catch a select event. +

+ +
+function onselect() {
+  var sel = graph.getSelection();
+
+  var info = 'selected row(s): ';
+  for (var i = 0; i < sel.length; i++) {
+    info += sel[i].row + ' ';
+  }
+
+  alert(info);
+}
+
+vis.events.addListener(graph, 'select', onselect);
+
+ +

+ The following events are available. +

+ + + + + + + + + + + + + + + + + + + + + + + +
nameDescriptionProperties
selectFired after the user selects or unselects a node by clicking it, + or when selecting a number of nodes by dragging a selection area + around them. Not fired when the method setSelection + is executed. The corresponding rows in the Array are selected. +
+ The selected rows can be retrieved via the method getSelection. +
none
readyThe graph is loaded and ready for external method calls. + If you want to interact with the graph, and call methods after you draw it, + you should set up a listener for this event before you call the draw method, + and call them only after the event was fired.none
+ + +

Data Policy

+

+ All code and data are processed and rendered in the browser. No data is sent to any server. +

+ +
+ + diff --git a/docs/img/graph.png b/docs/img/graph.png new file mode 100644 index 00000000..3acaa131 Binary files /dev/null and b/docs/img/graph.png differ diff --git a/docs/img/graph120x60.png b/docs/img/graph120x60.png new file mode 100644 index 00000000..5a8aa291 Binary files /dev/null and b/docs/img/graph120x60.png differ diff --git a/docs/prettify/lang-apollo.js b/docs/prettify/lang-apollo.js new file mode 100644 index 00000000..bfc0014c --- /dev/null +++ b/docs/prettify/lang-apollo.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]) \ No newline at end of file diff --git a/docs/prettify/lang-css.js b/docs/prettify/lang-css.js new file mode 100644 index 00000000..61157f38 --- /dev/null +++ b/docs/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\u000c"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], +["com",/^(?: