vis.js

Vis.js network graph not updating with node changes

不问归期 提交于 2019-12-04 05:26:28
问题 I have a function that clears any data that might be in the nodes or edges dataset, and goes on to repopulate them with new data. It's a hierarchical network, and levels are dynamically set AFTER all the nodes and edges have been created, so the level property of the nodes are ultimately added by nodes.update() calls. The nodes' levels are correctly set, and can be seen in my console log, but the graph doesn't reflect the levels. No errors are shown. Seeing as how the nodes seem to be correct

Vis.js network node customization: cards as nodes

≯℡__Kan透↙ 提交于 2019-12-04 01:36:44
问题 I would like to build a network where the nodes represent information that is structured similarly to cards. With a card I mean a structure composed of two areas: multi-line text area where I can put information that comes from different resources, like a name, a phone number, an address and control area where I can have 2-3 buttons (preferably with icons) that maximize the node, or make the node a root/main one etc. As far as I could see from the vis.js documentation see example here, it is

Stop vis.js physics after nodes load but allow drag-able nodes

大兔子大兔子 提交于 2019-12-04 01:19:58
I am trying to draw a vis.js network diagram and have vis load and position the nodes. I then want the physics to be disabled so the nodes can be moved by the user. I have tried this but it is not working. var options = { nodes: { borderWidth:4, size:60, color: { border: '#222222', background: 'grey' }, font:{color:'black'} }, edges: { arrows: { to: {enabled: false, scaleFactor:1}, middle: {enabled: false, scaleFactor:1}, from: {enabled: false, scaleFactor:1} }, color: 'black' }, { physics: enabled: false; }; Has anyone done this? if so can you provide an example or advice on best way to

Accessing node data in vis.js click handler

寵の児 提交于 2019-12-03 12:32:05
I am having a network graph of nodes and edges and would like to get the node data once it gets clicked. I currently have var network = new vis.Network(container, data, options); network.on( 'click', function(properties) { console.log('clicked node ' + properties.nodes); }); But this just gives me some internal id [105]. Is there a way to get the actual data that is associated with the node. The node ids that you get in the properties is not "some internal id", but these are the id's of the nodes that you defined yourself. You can simply read the node's data from your own DataSet with nodes

How to draw line graph on timeline using visjs?

≯℡__Kan透↙ 提交于 2019-12-03 11:45:49
Is it possible to draw line graph on timeline, using visjs? I want to get something like here http://almende.github.io/chap-links-library/js/timeline/examples/example19_bar_graph.html but instead of bar graph, I need line graph. Essentially the question is, is it possible to get timeline and graph2d on the same canvas like in example below? With the help of the demo of syncing to timelines here and some experimenting of my own, the following seems to do something similar. You could probably tweak it a bit more to get what you want. The console warnings of "WARNING: infinite loop in redraw?"

How to create network graph or hierarchical tree using visjs in angularjs?

吃可爱长大的小学妹 提交于 2019-12-02 17:16:20
问题 I need some help in creating a network graph using visjs in angularjs. I am working on this plunker to achieve something like this I followed the steps mentioned in AngularJS - visjs but was unable to make it work so I created a plunker (given above) to get help from community. Controller code. var app = angular.module('app', ['ngVis']); app.controller('MainCtrl', ['$scope', 'VisDataSet', function($scope, VisDataSet) { $scope.data = VisDataSet({ "1": { "id": 1, "content": "<i class=\"fi-flag\

Vis.js network node customization: cards as nodes

只愿长相守 提交于 2019-12-01 08:18:10
I would like to build a network where the nodes represent information that is structured similarly to cards. With a card I mean a structure composed of two areas: multi-line text area where I can put information that comes from different resources, like a name, a phone number, an address and control area where I can have 2-3 buttons (preferably with icons) that maximize the node, or make the node a root/main one etc. As far as I could see from the vis.js documentation see example here , it is possible to enter paragraph/text as a node label but there is no way to structure a node via Html. Can

vis.js minimize crossed edges

给你一囗甜甜゛ 提交于 2019-11-30 20:24:32
I'm new to JavaScript and using vis.js for making a hierarchical ("UD") network. I have a problem: many edges on the same level cross. Is there a way in vis.js to minimize crossed edges? In my example where I have a simple tree, there should no crossed edges at all. I.e. I want something like instead of My question is related to vis.js Level sorting in Hierarchical Layout Here are my vis.js options: var options = { edges: { smooth: { type: 'cubicBezier', roundness: 0.4 } }, layout: { improvedLayout: true, hierarchical: { direction: "UD" } }, physics:false }; Please try an older version of vis

Vis.js network: how to get data and options back for saving?

廉价感情. 提交于 2019-11-30 16:23:42
My intention is to create simple graph editor using vis.js and the first feature I'm thinking about is to position nodes manually and save that. However, unlike setting options a straight-forward method to get all the options doesn't seem to exist. Is there any reasonable approach to get them (aside trying to track all the changes using events like dragEnd which sounds way too fragile)? In fact, I'm looking for a way to extract both data (nodes/edges and their settings) and options so that once the network is rendered using those options, it looks the same (or at least similar) to what was

vis.js - Place node manually

倾然丶 夕夏残阳落幕 提交于 2019-11-30 13:44:39
How do I set a node's position in vis.js? I want to initially position at least one node manually. I know that a node has the options x and y . I set both, and also tried variations of layout options ( randomSeed , improvedLayout , hierarchical ), the node was never placed where I set it. Here's the simple network I defined: nodes = new vis.DataSet([ {id: 1, shape: 'circularImage', image: DIR + '1_circle', label:"1", x: 200, y: 100}, {id: 2, shape: 'circularImage', image: DIR + '2_circle', label:"2"}, {id: 3, shape: 'circularImage', image: DIR + '3_circle', label:"3"}, ]); edges = [ {id: "01