Browse Source

Merge remote-tracking branch 'origin/gh-pages' into alex_dev

Conflicts:
	.gitignore
	dist/vis.js
	dist/vis.min.js
	examples/graph/02_random_nodes.html
	examples/graph/18_fully_random_nodes_clustering.html
	examples/graph/19_scale_free_graph_clustering.html
css_transitions
Alex de Mulder 10 years ago
parent
commit
a41fb8013d
46 changed files with 1033 additions and 1 deletions
  1. +1
    -0
      CNAME
  2. +94
    -0
      css/style.css
  3. +323
    -0
      dist/vis.js
  4. +16
    -1
      dist/vis.min.js
  5. BIN
      download/vis.zip
  6. +5
    -0
      examples/graph/02_random_nodes.html
  7. +5
    -0
      examples/graph/18_fully_random_nodes_clustering.html
  8. +5
    -0
      examples/graph/19_scale_free_graph_clustering.html
  9. BIN
      favicon.ico
  10. BIN
      img/external-link-icons/external-link-icon.png
  11. +40
    -0
      img/external-link-icons/license.txt
  12. BIN
      img/forkme_right_darkblue_121621.png
  13. BIN
      img/gallery/graph/01_basic_usage.png
  14. BIN
      img/gallery/graph/02_random_nodes.png
  15. BIN
      img/gallery/graph/03_images.png
  16. BIN
      img/gallery/graph/04_shapes.png
  17. BIN
      img/gallery/graph/05_social_network.png
  18. BIN
      img/gallery/graph/06_groups.png
  19. BIN
      img/gallery/graph/07_selections.png
  20. BIN
      img/gallery/graph/08_mobile_friendly.png
  21. BIN
      img/gallery/graph/09_sizing.png
  22. BIN
      img/gallery/graph/10_multiline_text.png
  23. BIN
      img/gallery/graph/11_custom_style.png
  24. BIN
      img/gallery/graph/12_scalable_images.png
  25. BIN
      img/gallery/graph/13_dashed_lines.png
  26. BIN
      img/gallery/graph/14_dot_language.png
  27. BIN
      img/gallery/graph/15_dot_language_playground.png
  28. BIN
      img/gallery/graph/15_dot_language_playground2.png
  29. BIN
      img/gallery/graph/16_dynamic_data.png
  30. BIN
      img/gallery/graph/17_network_info.png
  31. BIN
      img/gallery/graph/graphviz_gallery.png
  32. BIN
      img/gallery/timeline/01_basic.png
  33. BIN
      img/gallery/timeline/02_dataset.png
  34. BIN
      img/gallery/timeline/03_much_data.png
  35. BIN
      img/gallery/timeline/04_html_data.png
  36. BIN
      img/gallery/timeline/05_groups.png
  37. +169
    -0
      img/logo/vis.svg
  38. BIN
      img/logo/vis128.png
  39. BIN
      img/logo/vis16.png
  40. BIN
      img/logo/vis256.png
  41. BIN
      img/logo/vis32.ico
  42. BIN
      img/logo/vis32.png
  43. BIN
      img/logo/vis64.png
  44. +317
    -0
      index.html
  45. +0
    -0
      package.js
  46. +58
    -0
      updateversion.js

+ 1
- 0
CNAME View File

@ -0,0 +1 @@
visjs.org

+ 94
- 0
css/style.css View File

@ -0,0 +1,94 @@
#menu {
position: absolute;
left: -170px;
top: 35px;
background-color: #a7c8f9;
padding: 15px;
border-radius: 3px;
}
#forkme {
position: fixed;
top: 0;
right: 0;
border: 0;
}
div.nav {
text-align: center;
}
div.nav ul {
text-decoration: none;
text-transform: uppercase;
margin-bottom: 30px;
padding-left: 0;
}
li.nav {
}
div.nav ul li {
text-decoration: none;
text-transform: uppercase;
font-weight: normal;
font-size: 11pt;
list-style: none;
margin-top: 5px;
}
div.nav ul li ul li {
text-decoration: none;
text-transform: none;
font-weight: normal;
font-size: 11pt;
color: #4D4D4D;
list-style: none;
}
div.nav a {
color: #2B7CE9;
color: white;
font-weight: bold;
}
.subtitle {
color: gray;
text-transform: uppercase;
font-size: 11pt;
}
.download td {
border: none;
padding: 5px 20px 5px 0;
}
.gallery .thumb {
display: inline-block;
text-align: center;
margin-right: 10px;
margin-bottom: 20px;
}
.gallery .thumb img {
border: 1px solid white;
border-radius: 5px;
height: 90px;
margin: 0;
}
.gallery .thumb a:hover img {
border-color: lightgray;
}
.gallery .thumb div {
margin: 0;
}
img {
border: 0;
}

+ 323
- 0
dist/vis.js View File

@ -4,8 +4,13 @@
*
* A dynamic, browser-based visualization library.
*
<<<<<<< HEAD
* @version 0.5.0-SNAPSHOT
* @date 2014-02-04
=======
* @version 0.4.0
* @date 2014-01-31
>>>>>>> origin/gh-pages
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -9117,8 +9122,13 @@ Node.prototype.setProperties = function(properties, constants) {
}
}
<<<<<<< HEAD
this.xFixed = this.xFixed || (properties.x !== undefined && properties.fixed);
this.yFixed = this.yFixed || (properties.y !== undefined && properties.fixed);
=======
this.xFixed = this.xFixed || (properties.x !== undefined);
this.yFixed = this.yFixed || (properties.y !== undefined);
>>>>>>> origin/gh-pages
this.radiusFixed = this.radiusFixed || (properties.radius !== undefined);
if (this.shape == 'image') {
@ -9940,7 +9950,10 @@ function Edge (properties, graph, constants) {
this.width = constants.edges.width;
this.value = undefined;
this.length = constants.edges.length;
<<<<<<< HEAD
this.selected = false;
=======
>>>>>>> origin/gh-pages
this.from = null; // a node
this.to = null; // a node
@ -10177,7 +10190,11 @@ Edge.prototype._drawLine = function(ctx) {
* @private
*/
Edge.prototype._getLineWidth = function() {
<<<<<<< HEAD
if (this.selected == true) {
=======
if (this.from.selected || this.to.selected) {
>>>>>>> origin/gh-pages
return Math.min(this.width * 2, this.widthMax)*this.graphScaleInv;
}
else {
@ -10527,6 +10544,7 @@ Edge._dist = function (x1,y1, x2,y2, x3,y3) { // x3,y3 is the point
Edge.prototype.setScale = function(scale) {
this.graphScaleInv = 1.0/scale;
};
<<<<<<< HEAD
Edge.prototype.select = function() {
@ -10536,6 +10554,8 @@ Edge.prototype.select = function() {
Edge.prototype.unselect = function() {
this.selected = false;
}
=======
>>>>>>> origin/gh-pages
/**
* Popup is a class to create a popup window with some text
* @param {Element} container The container object.
@ -10766,6 +10786,7 @@ Images.prototype.load = function(url) {
};
/**
<<<<<<< HEAD
* Created by Alex on 2/4/14.
*/
@ -10894,6 +10915,8 @@ var manipulationMixin = {
}
/**
=======
>>>>>>> origin/gh-pages
* Creation of the SectorMixin var.
*
* This contains all the functions the Graph object can use to employ the sector system.
@ -11777,10 +11800,13 @@ var ClusterMixin = {
// if child node has been added on smaller scale than current, kick out
if (childNode.formationScale < this.scale || force == true) {
<<<<<<< HEAD
// remove the selection, first remove the selection from the connected edges
this._unselectConnectedEdges(parentNode);
parentNode.unselect();
=======
>>>>>>> origin/gh-pages
// put the child node back in the global nodes object
this.nodes[containedNodeId] = childNode;
@ -11829,9 +11855,12 @@ var ClusterMixin = {
// recalculate the size of the node on the next time the node is rendered
parentNode.clearSizeCache();
<<<<<<< HEAD
// this unselects the rest of the edges
this._unselectConnectedEdges(parentNode);
=======
>>>>>>> origin/gh-pages
}
// check if a further expansion step is possible if recursivity is enabled
@ -12577,7 +12606,11 @@ var SelectionMixin = {
_getNodeAt : function (pointer) {
// we first check if this is an navigation controls element
var positionObject = this._pointerToPositionObject(pointer);
<<<<<<< HEAD
var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
=======
overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
>>>>>>> origin/gh-pages
// if there are overlapping nodes, select the last one, this is the
// one which is drawn on top of the others
@ -12591,6 +12624,7 @@ var SelectionMixin = {
/**
<<<<<<< HEAD
* retrieve all edges overlapping with given object, selector is around center
* @param {Object} object An object with parameters left, top, right, bottom
* @return {Number[]} An array with id's of the overlapping nodes
@ -12621,6 +12655,8 @@ var SelectionMixin = {
},
/**
=======
>>>>>>> origin/gh-pages
* Place holder. To implement change the _getNodeAt to a _getObjectAt. Have the _getObjectAt call
* _getNodeAt and _getEdgesAt, then priortize the selection to user preferences.
*
@ -12629,6 +12665,7 @@ var SelectionMixin = {
* @private
*/
_getEdgeAt : function(pointer) {
<<<<<<< HEAD
var positionObject = this._pointerToPositionObject(pointer);
var overlappingEdges = this._getAllEdgesOverlappingWith(positionObject);
@ -12638,16 +12675,27 @@ var SelectionMixin = {
else {
return null;
}
=======
return null;
>>>>>>> origin/gh-pages
},
/**
<<<<<<< HEAD
* Add object to the selection array.
=======
* Add object to the selection array. The this.selection id array may not be needed.
>>>>>>> origin/gh-pages
*
* @param obj
* @private
*/
_addToSelection : function(obj) {
<<<<<<< HEAD
=======
this.selection.push(obj.id);
>>>>>>> origin/gh-pages
this.selectionObj[obj.id] = obj;
},
@ -12659,6 +12707,15 @@ var SelectionMixin = {
* @private
*/
_removeFromSelection : function(obj) {
<<<<<<< HEAD
=======
for (var i = 0; i < this.selection.length; i++) {
if (obj.id == this.selection[i]) {
this.selection.splice(i,1);
break;
}
}
>>>>>>> origin/gh-pages
delete this.selectionObj[obj.id];
},
@ -12674,9 +12731,16 @@ var SelectionMixin = {
doNotTrigger = false;
}
<<<<<<< HEAD
for (var objectId in this.selectionObj) {
if (this.selectionObj.hasOwnProperty(objectId)) {
this.selectionObj[objectId].unselect();
=======
this.selection = [];
for (var objId in this.selectionObj) {
if (this.selectionObj.hasOwnProperty(objId)) {
this.selectionObj[objId].unselect();
>>>>>>> origin/gh-pages
}
}
this.selectionObj = {};
@ -12696,6 +12760,7 @@ var SelectionMixin = {
* @private
*/
_selectionIsEmpty : function() {
<<<<<<< HEAD
for(var objectId in this.selectionObj) {
if(this.selectionObj.hasOwnProperty(objectId)) {
return false;
@ -12743,21 +12808,39 @@ var SelectionMixin = {
var edge = node.dynamicEdges[i];
edge.unselect();
this._removeFromSelection(edge);
=======
if (this.selection.length == 0) {
return true;
}
else {
return false;
>>>>>>> origin/gh-pages
}
},
<<<<<<< HEAD
=======
>>>>>>> origin/gh-pages
/**
* This is called when someone clicks on a node. either select or deselect it.
* If there is an existing selection and we don't want to append to it, clear the existing selection
*
<<<<<<< HEAD
* @param {Node || Edge} object
=======
* @param {Node} node
>>>>>>> origin/gh-pages
* @param {Boolean} append
* @param {Boolean} [doNotTrigger] | ignore trigger
* @private
*/
<<<<<<< HEAD
_selectObject : function(object, append, doNotTrigger) {
=======
_selectNode : function(node, append, doNotTrigger) {
>>>>>>> origin/gh-pages
if (doNotTrigger === undefined) {
doNotTrigger = false;
}
@ -12766,6 +12849,7 @@ var SelectionMixin = {
this._unselectAll(true);
}
<<<<<<< HEAD
if (object.selected == false) {
object.select();
this._addToSelection(object);
@ -12776,6 +12860,16 @@ var SelectionMixin = {
else {
object.unselect();
this._removeFromSelection(object);
=======
if (node.selected == false) {
node.select();
this._addToSelection(node);
}
else {
node.unselect();
this._removeFromSelection(node);
>>>>>>> origin/gh-pages
}
if (doNotTrigger == false) {
this._trigger('select', {
@ -12814,6 +12908,7 @@ var SelectionMixin = {
_handleTap : function(pointer) {
var node = this._getNodeAt(pointer);
if (node != null) {
<<<<<<< HEAD
this._selectObject(node,false);
}
else {
@ -12824,6 +12919,12 @@ var SelectionMixin = {
else {
this._unselectAll();
}
=======
this._selectNode(node,false);
}
else {
this._unselectAll();
>>>>>>> origin/gh-pages
}
this._redraw();
},
@ -12855,6 +12956,7 @@ var SelectionMixin = {
_handleOnHold : function(pointer) {
var node = this._getNodeAt(pointer);
if (node != null) {
<<<<<<< HEAD
this._selectObject(node,true);
}
else {
@ -12862,6 +12964,9 @@ var SelectionMixin = {
if (edge != null) {
this._selectObject(edge,true);
}
=======
this._selectNode(node,true);
>>>>>>> origin/gh-pages
}
this._redraw();
},
@ -12883,18 +12988,27 @@ var SelectionMixin = {
/**
*
<<<<<<< HEAD
* retrieve the currently selected objects
=======
* retrieve the currently selected nodes
>>>>>>> origin/gh-pages
* @return {Number[] | String[]} selection An array with the ids of the
* selected nodes.
*/
getSelection : function() {
<<<<<<< HEAD
var nodeIds = this.getSelectedNodes();
var edgeIds = this.getSelectedEdges();
return {nodes:nodeIds, edges:edgeIds};
=======
return this.selection.concat([]);
>>>>>>> origin/gh-pages
},
/**
*
<<<<<<< HEAD
* retrieve the currently selected nodes
* @return {String} selection An array with the ids of the
* selected nodes.
@ -12931,6 +13045,19 @@ var SelectionMixin = {
/**
=======
* retrieve the currently selected nodes as objects
* @return {Objects} selection An array with the ids of the
* selected nodes.
*/
getSelectionObjects : function() {
return this.selectionObj;
},
/**
* // TODO: rework this function, it is from the old system
*
>>>>>>> origin/gh-pages
* select zero or more nodes
* @param {Number[] | String[]} selection An array with the ids of the
* selected nodes.
@ -12951,7 +13078,11 @@ var SelectionMixin = {
if (!node) {
throw new RangeError('Node with id "' + id + '" not found');
}
<<<<<<< HEAD
this._selectObject(node,true,true);
=======
this._selectNode(node,true,true);
>>>>>>> origin/gh-pages
}
this.redraw();
@ -12959,10 +13090,16 @@ var SelectionMixin = {
/**
<<<<<<< HEAD
=======
* TODO: rework this function, it is from the old system
*
>>>>>>> origin/gh-pages
* Validate the selection: remove ids of nodes which no longer exist
* @private
*/
_updateSelection : function () {
<<<<<<< HEAD
for(var objectId in this.selectionObj) {
if(this.selectionObj.hasOwnProperty(objectId)) {
if (this.selectionObj[objectId] instanceof Node) {
@ -12979,6 +13116,66 @@ var SelectionMixin = {
this.selection = [];
}
}
=======
var i = 0;
while (i < this.selection.length) {
var nodeId = this.selection[i];
if (!this.nodes.hasOwnProperty(nodeId)) {
this.selection.splice(i, 1);
delete this.selectionObj[nodeId];
}
else {
i++;
}
}
}
/**
* Unselect selected nodes. If no selection array is provided, all nodes
* are unselected
* @param {Object[]} selection Array with selection objects, each selection
* object has a parameter row. Optional
* @param {Boolean} triggerSelect If true (default), the select event
* is triggered when nodes are unselected
* @return {Boolean} changed True if the selection is changed
* @private
*/
/* _unselectNodes : function(selection, triggerSelect) {
var changed = false;
var i, iMax, id;
if (selection) {
// remove provided selections
for (i = 0, iMax = selection.length; i < iMax; i++) {
id = selection[i];
if (this.nodes.hasOwnProperty(id)) {
this.nodes[id].unselect();
}
var j = 0;
while (j < this.selection.length) {
if (this.selection[j] == id) {
this.selection.splice(j, 1);
changed = true;
}
else {
j++;
}
}
}
}
else if (this.selection && this.selection.length) {
// remove all selections
for (i = 0, iMax = this.selection.length; i < iMax; i++) {
id = this.selection[i];
if (this.nodes.hasOwnProperty(id)) {
this.nodes[id].unselect();
}
changed = true;
}
this.selection = [];
}
>>>>>>> origin/gh-pages
if (changed && (triggerSelect == true || triggerSelect == undefined)) {
// fire the select event
@ -12988,9 +13185,14 @@ var SelectionMixin = {
}
return changed;
<<<<<<< HEAD
}
}
=======
},
*/
>>>>>>> origin/gh-pages
/**
* select all nodes on given location x, y
* @param {Array} selection an array with node ids
@ -13015,6 +13217,7 @@ var SelectionMixin = {
if (selection[i] != this.selection[i]) {
selectionAlreadyThere = false;
break;
<<<<<<< HEAD
>>>>>>> develop
}
}
@ -13024,14 +13227,47 @@ var SelectionMixin = {
<<<<<<< HEAD
=======
=======
}
}
}
if (selectionAlreadyThere) {
return changed;
}
if (append == undefined || append == false) {
// first deselect any selected node
var triggerSelect = false;
changed = this._unselectNodes(undefined, triggerSelect);
}
for (i = 0, iMax = selection.length; i < iMax; i++) {
// add each of the new selections, but only when they are not duplicate
var id = selection[i];
var isDuplicate = (this.selection.indexOf(id) != -1);
if (!isDuplicate) {
this.nodes[id].select();
this.selection.push(id);
changed = true;
}
}
>>>>>>> origin/gh-pages
if (changed) {
// fire the select event
this._trigger('select', {
nodes: this.getSelection()
});
}
<<<<<<< HEAD
>>>>>>> develop
=======
return changed;
},
*/
>>>>>>> origin/gh-pages
};
@ -13395,19 +13631,29 @@ function Graph (container, data, options) {
this.yIncrement = 0;
this.zoomIncrement = 0;
<<<<<<< HEAD
=======
>>>>>>> origin/gh-pages
// create a frame and canvas
this._create();
// load the sector system. (mandatory, fully integrated with Graph)
this._loadSectorSystem();
<<<<<<< HEAD
=======
// apply options
this.setOptions(options);
>>>>>>> origin/gh-pages
// load the cluster system. (mandatory, even when not using the cluster system, there are function calls to it)
this._loadClusterSystem();
// load the selection system. (mandatory, required by Graph)
this._loadSelectionSystem();
<<<<<<< HEAD
// load the data manipulation system
this._loadManipulationSystem();
@ -13420,6 +13666,8 @@ function Graph (container, data, options) {
=======
>>>>>>> origin/gh-pages
// other vars
var graph = this;
this.freezeSimulation = false;// freeze the simulation
@ -13841,7 +14089,10 @@ Graph.prototype._create = function () {
this.frame.className = 'graph-frame';
this.frame.style.position = 'relative';
this.frame.style.overflow = 'hidden';
<<<<<<< HEAD
this.frame.style.zIndex = "1";
=======
>>>>>>> origin/gh-pages
// create the graph canvas (HTML canvas element)
this.frame.canvas = document.createElement( 'canvas' );
@ -13877,7 +14128,10 @@ Graph.prototype._create = function () {
// add the frame to the container element
this.containerElement.appendChild(this.frame);
<<<<<<< HEAD
=======
>>>>>>> origin/gh-pages
};
@ -13913,6 +14167,17 @@ Graph.prototype._createKeyBinds = function() {
this.mousetrap.bind("pagedown",this._zoomOut.bind(me),"keydown");
this.mousetrap.bind("pagedown",this._stopZoom.bind(me), "keyup");
}
<<<<<<< HEAD
=======
/*
this.mousetrap.bind("=",this.decreaseClusterLevel.bind(me));
this.mousetrap.bind("-",this.increaseClusterLevel.bind(me));
this.mousetrap.bind("s",this.singleStep.bind(me));
this.mousetrap.bind("h",this.updateClustersDefault.bind(me));
this.mousetrap.bind("c",this._collapseSector.bind(me));
this.mousetrap.bind("f",this.toggleFreeze.bind(me));
*/
>>>>>>> origin/gh-pages
}
/**
@ -13959,6 +14224,7 @@ Graph.prototype._onDragStart = function () {
drag.nodeId = node.id;
// select the clicked node if not yet selected
if (!node.isSelected()) {
<<<<<<< HEAD
this._selectObject(node,false);
}
@ -13985,6 +14251,33 @@ Graph.prototype._onDragStart = function () {
}
}
}
=======
this._selectNode(node,false);
}
// create an array with the selected nodes and their original location and status
var me = this;
this.selection.forEach(function (id) {
var node = me.nodes[id];
if (node) {
var s = {
id: id,
node: node,
// store original x, y, xFixed and yFixed, make the node temporarily Fixed
x: node.x,
y: node.y,
xFixed: node.xFixed,
yFixed: node.yFixed
};
node.xFixed = true;
node.yFixed = true;
drag.selection.push(s);
}
});
>>>>>>> origin/gh-pages
}
};
@ -14062,7 +14355,10 @@ Graph.prototype._onDragEnd = function () {
Graph.prototype._onTap = function (event) {
var pointer = this._getPointer(event.gesture.touches[0]);
this._handleTap(pointer);
<<<<<<< HEAD
=======
>>>>>>> origin/gh-pages
};
@ -14411,8 +14707,11 @@ Graph.prototype.setSize = function(width, height) {
this.frame.canvas.width = this.frame.canvas.clientWidth;
this.frame.canvas.height = this.frame.canvas.clientHeight;
<<<<<<< HEAD
this.manipulationDiv.style.width = this.frame.canvas.clientWidth;
=======
>>>>>>> origin/gh-pages
if (this.constants.navigation.enabled == true) {
this._relocateNavigation();
}
@ -14477,7 +14776,11 @@ Graph.prototype._addNodes = function(ids) {
var node = new Node(data, this.images, this.groups, this.constants);
this.nodes[id] = node; // note: this may replace an existing node
<<<<<<< HEAD
if (!node.isFixed() && this.createNodeOnClick != true) {
=======
if (!node.isFixed()) {
>>>>>>> origin/gh-pages
// TODO: position new nodes in a smarter way!
var radius = this.constants.edges.length * 2;
var count = ids.length;
@ -14493,7 +14796,10 @@ Graph.prototype._addNodes = function(ids) {
this._updateNodeIndexList();
this._reconnectEdges();
this._updateValueRange(this.nodes);
<<<<<<< HEAD
this.updateLabels();
=======
>>>>>>> origin/gh-pages
};
/**
@ -14762,7 +15068,11 @@ Graph.prototype._redraw = function() {
this._doInAllSectors("_drawAllSectorNodes",ctx);
this._doInAllSectors("_drawEdges",ctx);
<<<<<<< HEAD
this._doInAllSectors("_drawNodes",ctx,true);
=======
this._doInAllSectors("_drawNodes",ctx);
>>>>>>> origin/gh-pages
// restore original scaling and translation
ctx.restore();
@ -15257,9 +15567,15 @@ Graph.prototype.start = function() {
}
};
<<<<<<< HEAD
/**
* Debug function, does one step of the graph
*/
=======
>>>>>>> origin/gh-pages
Graph.prototype.singleStep = function() {
if (this.moving) {
this._initializeForceCalculation();
@ -15338,6 +15654,10 @@ Graph.prototype._loadSectorSystem = function() {
* @private
*/
Graph.prototype._loadSelectionSystem = function() {
<<<<<<< HEAD
=======
this.selection = [];
>>>>>>> origin/gh-pages
this.selectionObj = {};
for (var mixinFunction in SelectionMixin) {
@ -15348,6 +15668,7 @@ Graph.prototype._loadSelectionSystem = function() {
}
<<<<<<< HEAD
/**
* Mixin the navigationUI (User Interface) system and initialize the parameters required
@ -15372,6 +15693,8 @@ Graph.prototype._loadManipulationSystem = function() {
}
=======
>>>>>>> origin/gh-pages
/**
* Mixin the navigation (User Interface) system and initialize the parameters required
*

+ 16
- 1
dist/vis.min.js
File diff suppressed because it is too large
View File


BIN
download/vis.zip View File


+ 5
- 0
examples/graph/02_random_nodes.html View File

@ -94,6 +94,7 @@
graph = new vis.Graph(container, data, options);
// add event listeners
<<<<<<< HEAD
<<<<<<< HEAD
vis.events.addListener(graph, 'select', function(params) {
document.getElementById('selection').innerHTML =
@ -102,6 +103,10 @@
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> develop
=======
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> origin/gh-pages
});
}
</script>

+ 5
- 0
examples/graph/18_fully_random_nodes_clustering.html View File

@ -64,6 +64,7 @@
graph = new vis.Graph(container, data, options);
// add event listeners
<<<<<<< HEAD
<<<<<<< HEAD
vis.events.addListener(graph, 'select', function(params) {
document.getElementById('selection').innerHTML =
@ -72,6 +73,10 @@
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> develop
=======
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> origin/gh-pages
});
}
</script>

+ 5
- 0
examples/graph/19_scale_free_graph_clustering.html View File

@ -100,6 +100,7 @@
graph = new vis.Graph(container, data, options);
// add event listeners
<<<<<<< HEAD
<<<<<<< HEAD
vis.events.addListener(graph, 'select', function(params) {
document.getElementById('selection').innerHTML =
@ -108,6 +109,10 @@
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> develop
=======
graph.on('select', function(params) {
document.getElementById('selection').innerHTML = 'Selection: ' + params.nodes;
>>>>>>> origin/gh-pages
});
}
</script>

BIN
favicon.ico View File

Before After

BIN
img/external-link-icons/external-link-icon.png View File

Before After
Width: 9  |  Height: 9  |  Size: 194 B

+ 40
- 0
img/external-link-icons/license.txt View File

@ -0,0 +1,40 @@
/**************************************\
Shapes4FREE License
http://www.shapes4free.com/ - visit us to get free photoshop shapes, read our easy-to-understand shapes tutorials and tips, and view beautiful examples of using shapes in all kinds of design
More about the license: http://www.shapes4free.com/license/
\**************************************/
This resource was created by Oksana Khristenko
This resource has been downloaded from Shapes4FREE.com and is free for personal or commercial projects. You may use it for web and print design.
No attribution or backlinks are required, but we would certainly appreciate it if you bookmarked www.shapes4free.com and shared the link to it with your friends:
www.shapes4free.com - free photoshop shapes
You may not resell or distribute this resource. Uploading it to another website
or offering them for download on another website is not allowed. If you would like to feature this resource on
your website or share them with friends, do not link directly to the resource files,
please link to the appropriate page on Shapes4FREE.com where it is possible to download the freebie.
/**************************************\
Shapes4FREE Ëèöåíçèÿ
http://www.shapes4free.com/ - áåñïëàòíûå ôèãóðû äëÿ Ôîòîøîïà, óðîêè è ïîäñêàçêè, à òàêæå êðàñèâûå ïðèìåðû èñïîëüçîâàíèÿ ôèãóð âî âñåõ âèäàõ äèçàéíà
Ëèöåíçèÿ: http://www.shapes4free.com/license-ru/
\**************************************/
Àâòîð: Îêñàíà Õðèñòåíêî
Âñå áåñïëàòíûå ðåñóðñû êîòîðûå ìîæíî ñêà÷àòü íà Shapes4FREE.com, âêëþ÷àÿ ïðîèçâîëüíûå ôèãóðû äëÿ Ôîòîøîïà
(photoshop custom shapes) áåñïëàòíû äëÿ èñïîëüçîâàíèÿ â ëè÷íûõ è êîììåð÷åñêèõ ïðîåêòàõ. Ðàçðåøåíî èñïîëüçîâàòü
áåñïëàòíûå ðåñóðñû Shapes4FREE â âåá äèçàéíå è ïå÷àòíûõ ìàòåðèàëàõ.
Ññûëêà íà ñàéò Shapes4FREE.com íå òðåáóåòñÿ íî ïðèâåòñòâóåòñÿ. Ìû áóäåì ðàäû åñëè âû ðàññêàæåòå î íàñ äðóçüÿì:
www.shapes4free.com - áåñïëàòíûå ôèãóðû äëÿ Ôîòîøîïà
Çàïðåùåíî ïðîäàâàòü èëè ðàñïðîñòðàíÿòü áåñïëàòíûå ðåñóðñû ñîçäàííûå Shapes4FREE.
Çàïðåùåíî çàãðóæàòü èõ íà äðóãèå ñàéòû è ïîçâîëÿòü ïîëüçîâàòåëÿì èõ ñêà÷èâàòü. Åñëè âû õîòèòå ðàññêàçàòü î íàøåì
áåñïëàòíîì ðåñóðñå íà ñàéòå èëè ïîäåëèòüñÿ ñ äðóçüÿìè, íå ñîçäàâàéòå ïðÿìûõ ññûëîê íà ôàéë, ñîçäàéòå ññûëêó íà
ñîîòâåòñòâóþùóþ ñòðàíèöó ñàéòà Shapes4FREE.com ãäå ìîæíî áóäåò ñêà÷àòü ýòîò ðåñóðñ.

BIN
img/forkme_right_darkblue_121621.png View File

Before After
Width: 149  |  Height: 149  |  Size: 7.6 KiB

BIN
img/gallery/graph/01_basic_usage.png View File

Before After
Width: 400  |  Height: 400  |  Size: 21 KiB

BIN
img/gallery/graph/02_random_nodes.png View File

Before After
Width: 600  |  Height: 600  |  Size: 58 KiB

BIN
img/gallery/graph/03_images.png View File

Before After
Width: 600  |  Height: 600  |  Size: 88 KiB

BIN
img/gallery/graph/04_shapes.png View File

Before After
Width: 797  |  Height: 600  |  Size: 50 KiB

BIN
img/gallery/graph/05_social_network.png View File

Before After
Width: 600  |  Height: 600  |  Size: 76 KiB

BIN
img/gallery/graph/06_groups.png View File

Before After
Width: 600  |  Height: 600  |  Size: 40 KiB

BIN
img/gallery/graph/07_selections.png View File

Before After
Width: 400  |  Height: 400  |  Size: 14 KiB

BIN
img/gallery/graph/08_mobile_friendly.png View File

Before After
Width: 605  |  Height: 551  |  Size: 45 KiB

BIN
img/gallery/graph/09_sizing.png View File

Before After
Width: 600  |  Height: 600  |  Size: 27 KiB

BIN
img/gallery/graph/10_multiline_text.png View File

Before After
Width: 600  |  Height: 600  |  Size: 40 KiB

BIN
img/gallery/graph/11_custom_style.png View File

Before After
Width: 600  |  Height: 600  |  Size: 59 KiB

BIN
img/gallery/graph/12_scalable_images.png View File

Before After
Width: 600  |  Height: 600  |  Size: 104 KiB

BIN
img/gallery/graph/13_dashed_lines.png View File

Before After
Width: 600  |  Height: 600  |  Size: 26 KiB

BIN
img/gallery/graph/14_dot_language.png View File

Before After
Width: 381  |  Height: 330  |  Size: 13 KiB

BIN
img/gallery/graph/15_dot_language_playground.png View File

Before After
Width: 429  |  Height: 384  |  Size: 31 KiB

BIN
img/gallery/graph/15_dot_language_playground2.png View File

Before After
Width: 842  |  Height: 595  |  Size: 41 KiB

BIN
img/gallery/graph/16_dynamic_data.png View File

Before After
Width: 504  |  Height: 370  |  Size: 17 KiB

BIN
img/gallery/graph/17_network_info.png View File

Before After
Width: 871  |  Height: 648  |  Size: 60 KiB

BIN
img/gallery/graph/graphviz_gallery.png View File

Before After
Width: 1237  |  Height: 729  |  Size: 262 KiB

BIN
img/gallery/timeline/01_basic.png View File

Before After
Width: 544  |  Height: 195  |  Size: 9.0 KiB

BIN
img/gallery/timeline/02_dataset.png View File

Before After
Width: 544  |  Height: 195  |  Size: 9.0 KiB

BIN
img/gallery/timeline/03_much_data.png View File

Before After
Width: 544  |  Height: 263  |  Size: 14 KiB

BIN
img/gallery/timeline/04_html_data.png View File

Before After
Width: 544  |  Height: 248  |  Size: 16 KiB

BIN
img/gallery/timeline/05_groups.png View File

Before After
Width: 711  |  Height: 459  |  Size: 24 KiB

+ 169
- 0
img/logo/vis.svg View File

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="vis.svg"
inkscape:export-filename="/home/jos/projects/vis-pages/img/logo/vis256.png"
inkscape:export-xdpi="180"
inkscape:export-ydpi="180">
<defs
id="defs4">
<filter
inkscape:collect="always"
id="filter3765">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.098994946"
id="feGaussianBlur3767" />
</filter>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3765-8">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.098994946"
id="feGaussianBlur3767-2" />
</filter>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3765-8-3">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.098994946"
id="feGaussianBlur3767-2-9" />
</filter>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3765-3">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.098994946"
id="feGaussianBlur3767-3" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="13.788283"
inkscape:cy="60.335199"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="true"
inkscape:window-width="1600"
inkscape:window-height="850"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:showpageshadow="false"
borderlayer="false"
showborder="true">
<inkscape:grid
type="xygrid"
id="grid2987"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-924.36217)">
<path
sodipodi:type="arc"
style="fill:#109618;fill-opacity:1;stroke:none;opacity:0.01587302"
id="path4104"
sodipodi:cx="64.25"
sodipodi:cy="64.5"
sodipodi:rx="63.75"
sodipodi:ry="64"
d="m 128,64.5 a 63.75,64 0 1 1 -127.5,0 63.75,64 0 1 1 127.5,0 z"
transform="matrix(0.93139646,0,0,0.83984375,-189.81956,958.94835)" />
<path
style="fill:#ffcf00;fill-opacity:1;stroke:#ffcf00;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 3.3795626,993.2579 C 22.563164,969.55671 64.941101,938.83212 101.8906,932.98778 c 15.01437,32.97153 15.80482,65.24066 11.89745,97.27812 -53.04371,-1.7716 -84.489701,-14.912 -110.4084874,-37.008 z"
id="path2991"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:#109618;fill-opacity:1;stroke:#109618;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 4.586161,1010.1966 c 29.519439,19.0948 61.669847,32.8593 114.396079,29.9232 6.98138,-4.9614 5.91066,-11.2031 3.61936,-17.6388 -37.656342,4.9772 -79.514689,1.6063 -118.015439,-12.2844 z"
id="path3761"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
sodipodi:type="arc"
style="fill:#ff9900;fill-opacity:1;stroke:none;filter:url(#filter3765-8)"
id="path3763-6"
sodipodi:cx="66.998367"
sodipodi:cy="63.476505"
sodipodi:rx="10.429825"
sodipodi:ry="9.3691645"
d="m 77.428192,63.476505 a 10.429825,9.3691645 0 1 1 -20.85965,0 10.429825,9.3691645 0 1 1 20.85965,0 z"
transform="matrix(3.7791753,0,0,4.159068,-180.52628,715.8869)" />
<path
sodipodi:type="arc"
style="fill:#dc3912;fill-opacity:1;stroke:none;filter:url(#filter3765-8-3)"
id="path3763-6-3"
sodipodi:cx="66.998367"
sodipodi:cy="63.476505"
sodipodi:rx="10.429825"
sodipodi:ry="9.3691645"
d="m 77.428192,63.476505 a 10.429825,9.3691645 0 1 1 -20.85965,0 10.429825,9.3691645 0 1 1 20.85965,0 z"
transform="matrix(2.1560756,0,0,2.3930971,-65.92105,839.4416)" />
<path
sodipodi:type="arc"
style="fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter3765)"
id="path3763"
sodipodi:cx="66.998367"
sodipodi:cy="63.476505"
sodipodi:rx="10.429825"
sodipodi:ry="9.3691645"
d="m 77.428192,63.476505 a 10.429825,9.3691645 0 1 1 -20.85965,0 10.429825,9.3691645 0 1 1 20.85965,0 z"
transform="matrix(1.369772,0,0,1.5215787,-11.897888,900.22297)" />
<path
sodipodi:type="arc"
style="fill:#4d4d4d;fill-opacity:1;stroke:none;filter:url(#filter3765-3)"
id="path3763-9"
sodipodi:cx="66.998367"
sodipodi:cy="63.476505"
sodipodi:rx="10.429825"
sodipodi:ry="9.3691645"
d="m 77.428192,63.476505 a 10.429825,9.3691645 0 1 1 -20.85965,0 10.429825,9.3691645 0 1 1 20.85965,0 z"
transform="matrix(0.68506744,0,0,0.76063592,38.273417,952.729)" />
</g>
</svg>

BIN
img/logo/vis128.png View File

Before After
Width: 128  |  Height: 128  |  Size: 5.5 KiB

BIN
img/logo/vis16.png View File

Before After
Width: 16  |  Height: 16  |  Size: 660 B

BIN
img/logo/vis256.png View File

Before After
Width: 256  |  Height: 256  |  Size: 13 KiB

BIN
img/logo/vis32.ico View File

Before After

BIN
img/logo/vis32.png View File

Before After
Width: 32  |  Height: 32  |  Size: 1.4 KiB

BIN
img/logo/vis64.png View File

Before After
Width: 64  |  Height: 64  |  Size: 2.9 KiB

+ 317
- 0
index.html View File

@ -0,0 +1,317 @@
<!doctype html>
<html>
<head>
<title>vis.js | a dynamic, browser-based visualization library</title>
<meta charset='utf-8' />
<meta name="title" content="vis.js">
<meta name="description" content="vis.js is a dynamic, browser-based visualization library" />
<meta name="keywords" content="vis, visualization, javascript, browser based, web based, chart, linechart, timeline, graph, network, browser" />
<meta name="author" content="Almende B.V.">
<link href="docs/css/prettify.css" type="text/css" rel="stylesheet" />
<link href='docs/css/style.css' type='text/css' rel='stylesheet'>
<link href="css/style.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="docs/lib/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<div id="container">
<div id="menu">
<a href="http://visjs.org/"><img src="img/logo/vis128.png" alt="logo"></a>
<div class="nav">
<ul>
<li><a href="#install">Install</a></li>
<li><a href="#example">Example</a></li>
<li><a href="#gallery">Gallery</a></li>
<li>
<a href="docs/index.html" target="_blank">
Docs
<img src="img/external-link-icons/external-link-icon.png" style="vertical-align: text-top;" title="Docs will open in a new window">
</a>
</li>
<li><a href="#license">License</a></li>
</ul>
</div>
</div>
<h1>
vis.js<br>
<span class="subtitle">a visual interaction system</span>
</h1>
<p>
Vis.js is a dynamic, browser based visualization library.
The library is designed to be easy to use, to handle large amounts
of dynamic data, and to enable manipulation of and interaction with the data.
The library consists of the components DataSet, Timeline, and Graph.
</p>
<p>
The vis.js library is developed by <a href="http://almende.com" target="_blank">Almende B.V</a>,
as part of the <a href="http://chap.almende.com/" target="_blank">CHAP</a>.
</p>
<h2 id="install">Install</h2>
<h3>npm</h3>
<pre class="prettyprint">
npm install vis
</pre>
<h3>bower</h3>
<pre class="prettyprint">
bower install vis
</pre>
<h3>download</h3>
<a href="download/vis.zip">Click here to download vis.js</a>
(version <span class="version">0.4.0</span>)
<h2 id="example">Example</h2>
<p>
A basic example demonstrating how to use the vis.js timeline is shown below.
See the <a href="#gallery">gallery</a> below for more examples.
</p>
<pre class="prettyprint lang-html">&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Timeline | Basic demo&lt;/title&gt;
&lt;script src="http://visjs.org/dist/vis.js"&gt;&lt;/script&gt;
&lt;link href="http://visjs.org/dist/vis.css" rel="stylesheet" type="text/css" /&gt;
&lt;style type="text/css"&gt;
body, html {
font-family: sans-serif;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="mytimeline"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
var container = document.getElementById('mytimeline');
var data = [
{id: 1, content: 'item 1', start: '2013-04-20'},
{id: 2, content: 'item 2', start: '2013-04-14'},
{id: 3, content: 'item 3', start: '2013-04-18'},
{id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
{id: 5, content: 'item 5', start: '2013-04-25'},
{id: 6, content: 'item 6', start: '2013-04-27'}
];
var options = {};
var timeline = new vis.Timeline(container, data, options);
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2 id="gallery">Gallery</h2>
This gallery gives an idea of the features and possibilities of the library.
The source code of the examples can be found in the
<a href="https://github.com/almende/vis/tree/master/examples" target="_blank">examples directory</a>.
<h3 id="timeline">Timeline</h3>
<p>
The timeline from vis.js displays different types of data on a timeline.
</p>
<div class="gallery">
<div class="thumb">
<a href="examples/timeline/01_basic.html">
<img src="img/gallery/timeline/01_basic.png">
<div>basic usage</div>
</a>
</div>
<div class="thumb">
<a href="examples/timeline/02_dataset.html">
<img src="img/gallery/timeline/02_dataset.png">
<div>dataset</div>
</a>
</div>
<div class="thumb">
<a href="examples/timeline/03_much_data.html">
<img src="img/gallery/timeline/03_much_data.png">
<div>much data</div>
</a>
</div>
<div class="thumb">
<a href="examples/timeline/04_html_data.html">
<img src="img/gallery/timeline/04_html_data.png">
<div>html data</div>
</a>
</div>
<div class="thumb">
<a href="examples/timeline/05_groups.html">
<img src="img/gallery/timeline/05_groups.png">
<div>groups</div>
</a>
</div>
</div>
<h3 id="graph">Graph</h3>
<p>
The graph from vis.js visualizes graphs and networks with
customizable styles.
</p>
<div class="gallery">
<div class="thumb">
<a href="examples/graph/01_basic_usage.html">
<img src="img/gallery/graph/01_basic_usage.png">
<div>basic usage</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/02_random_nodes.html">
<img src="img/gallery/graph/02_random_nodes.png">
<div>random nodes</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/03_images.html">
<img src="img/gallery/graph/03_images.png">
<div>images</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/04_shapes.html">
<img src="img/gallery/graph/04_shapes.png">
<div>shapes</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/05_social_network.html">
<img src="img/gallery/graph/05_social_network.png">
<div>social network</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/06_groups.html">
<img src="img/gallery/graph/06_groups.png">
<div>groups</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/07_selections.html">
<img src="img/gallery/graph/07_selections.png">
<div>selections</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/08_mobile_friendly.html">
<img src="img/gallery/graph/08_mobile_friendly.png">
<div>mobile friendly</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/09_sizing.html">
<img src="img/gallery/graph/09_sizing.png">
<div>sizing</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/10_multiline_text.html">
<img src="img/gallery/graph/10_multiline_text.png">
<div>multiline text</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/11_custom_style.html">
<img src="img/gallery/graph/11_custom_style.png">
<div>custom style</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/12_scalable_images.html">
<img src="img/gallery/graph/12_scalable_images.png">
<div>scalable images</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/13_dashed_lines.html">
<img src="img/gallery/graph/13_dashed_lines.png">
<div>dashed lines</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/14_dot_language.html">
<img src="img/gallery/graph/14_dot_language.png">
<div>dot language</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/15_dot_language_playground.html">
<img src="img/gallery/graph/15_dot_language_playground.png">
<div>playground</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/16_dynamic_data.html">
<img src="img/gallery/graph/16_dynamic_data.png">
<div>dynamic data</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/17_network_info.html">
<img src="img/gallery/graph/17_network_info.png">
<div>network info</div>
</a>
</div>
<div class="thumb">
<a href="examples/graph/graphviz/graphviz_gallery.html">
<img src="img/gallery/graph/graphviz_gallery.png">
<div>graphviz gallery</div>
</a>
</div>
</div>
<h2 id="docs">Docs</h2>
<p>
Documentation is available here:
<a href="docs/index.html" target="_blank">Documentation</a>
</p>
<h2 id="license">License</h2>
<p>
Copyright (C) 2010-2014 Almende B.V.
</p>
<p>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
</p>
<p>
http://www.apache.org/licenses/LICENSE-2.0
</p>
<p>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</p>
<a id="forkme" href="https://github.com/almende/vis/" target="_blank">
<img src="img/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" >
</a>
</div>
</body>
</html>

+ 0
- 0
package.js View File


+ 58
- 0
updateversion.js View File

@ -0,0 +1,58 @@
// Update the version numbers and library sizes in index.html
var fs = require('fs'),
zlib = require('zlib');
var VIS_ZIP = './dist/vis.js',
INDEX = 'index.html';
// read version from dist/vis.js
function version(callback) {
fs.readFile(VIS_ZIP, function (err, data) {
if (!err) {
var match = /@version\s*([\w\.-]*)/i.exec(data);
var version = undefined;
if (match) {
version = match[1];
}
callback(null, version);
}
else {
callback(err);
}
});
}
// update version and library sizes in index.md
function updateVersion(version, callback) {
fs.readFile(INDEX, function (err, data) {
if (!err) {
data = String(data);
data = data.replace(/<span class="version">([\w\.-]*)<\/span>/g,
'<span class="version">' + version + '</span>');
fs.writeFile(INDEX, data, callback);
}
else {
callback(err);
}
});
}
version(function (err, version) {
console.log('version: ' + version);
if (version) {
updateVersion(version, function (err, res) {
if (err) {
console.log(err);
}
else {
console.log('done');
}
});
}
else {
}
});

Loading…
Cancel
Save