You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
added dot and gephi parser to docs, need to include examples in the docs everywhere. Added working example code at the top of the docs and link to example 1
console.log('The dot property has been depricated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);');
15917
15922
// parse DOT file
15918
-
if (data && data.dot) {
15919
-
var dotData = dotparser.DOTToGraph(data.dot);
15920
-
this.setData(dotData);
15921
-
return;
15922
-
}
15923
+
var dotData = dotparser.DOTToGraph(data.dot);
15924
+
this.setData(dotData);
15925
+
return;
15923
15926
} else if (data && data.gephi) {
15924
15927
// parse DOT file
15925
-
if (data && data.gephi) {
15926
-
var gephiData = gephiParser.parseGephi(data.gephi);
15927
-
this.setData(gephiData);
15928
-
return;
15929
-
}
15928
+
console.log('The gephi property has been depricated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);');
15929
+
var gephiData = gephiParser.parseGephi(data.gephi);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
18517
18520
18518
-
var _componentsColorPicker = __webpack_require__(72);
18521
+
var _networkModulesComponentsColorPicker = __webpack_require__(72);
18519
18522
18520
-
var _componentsColorPicker2 = _interopRequireDefault(_componentsColorPicker);
18523
+
var _networkModulesComponentsColorPicker2 = _interopRequireDefault(_networkModulesComponentsColorPicker);
An example exists showing how to get a JSON file into Vis: <ahref="../examples/network/30_importing_from_gephi.html">30_importing_from_gephi</a>.
491
-
</p>
492
-
493
-
<p>
494
-
Example usage:
495
-
</p>
496
-
497
-
<preclass="prettyprint lang-js">
498
-
// load the JSON file containing the Gephi network.
499
-
var gephiJSON = loadJSON("./data/WorldCup2014.json"); // code in example 30
500
-
501
-
// create a data object with the gephi key:
502
-
var data = {
503
-
gephi: gephiJSON
504
-
};
505
-
506
-
// create a network
507
-
var network = new vis.Network(container, data);
508
-
</pre>
509
-
Alternatively you can use the parser manually:
510
-
<preclass="prettyprint lang-js">
511
-
// load the JSON file containing the Gephi network.
512
-
var gephiJSON = loadJSON("./data/WorldCup2014.json"); // code in example 30
513
-
514
-
// parse the gephi file to receive an object
515
-
// containing nodes and edges in vis format.
516
-
var parsed = vis.network.gephiParser.parseGephi(gephiJSON);
517
-
518
-
// provide data in the normal fashion
519
-
var data = {
520
-
nodes: parsed.nodes,
521
-
edged: parsed.edges
522
-
};
523
-
524
-
// create a network
525
-
var network = new vis.Network(container, data);
526
-
</pre>
527
-
528
-
<h4>Gephi parser options</h4>
529
-
530
-
There are a few options you can use to tell Vis what to do with the data from Gephi.
531
-
532
-
<preclass="prettyprint lang-js">
533
-
var parserOptions = {
534
-
allowedToMove: false,
535
-
parseColor: false
536
-
}
537
-
var parsed = vis.network.gephiParser.parseGephi(gephiJSON, parserOptions);
538
-
</pre>
539
-
<table>
540
-
<tr>
541
-
<th>Name</th>
542
-
<th>Type</th>
543
-
<th>Default</th>
544
-
<th>Description</th>
545
-
</tr>
546
-
547
-
<tr>
548
-
<td>allowedToMove</td>
549
-
<td>Boolean</td>
550
-
<td>false</td>
551
-
<td>
552
-
If true, the nodes will move according to the physics model after import. If false, the nodes do not move at all.
553
-
</td>
554
-
</tr>
555
-
<tr>
556
-
<td>parseColor</td>
557
-
<td>Boolean</td>
558
-
<td>false</td>
559
-
<td>
560
-
If true, the color will be parsed by the vis parser, generating extra colors for the borders, highlighs and hover. If false, the node will be the supplied color.
0 commit comments