vis.js

vis.js minimize crossed edges

拥有回忆 提交于 2019-11-30 05:00:02
问题 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: {

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

混江龙づ霸主 提交于 2019-11-29 23:27:44
问题 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

vis.js - Place node manually

心不动则不痛 提交于 2019-11-29 18:28:33
问题 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',

Integrating the js code in R to make the visNetwork edges curved

随声附和 提交于 2019-11-29 17:59:36
the script below creates the visNetwork as shown in the visualization below. I want a functionality to make the edge "1" and edge "3" curved. I am attaching the js code that can be used to achieve this. However, please help me to integrate the same code in R. Thanks. nodes <- data.frame(id = 1:4) edges <- data.frame(from = c(2,4,3,2), to = c(1,2,4,3), label = 1:4) edges <- data.frame(edges,edges$from) visNetwork(nodes, edges, width = "100%") %>% visEdges(arrows =list(to = list(enabled = TRUE, scaleFactor = 2)), color = list(color = "lightblue", highlight = "red")) %>% visHierarchicalLayout()

Integrating the js code in R to make the visNetwork edges curved

本小妞迷上赌 提交于 2019-11-28 12:41:17
问题 the script below creates the visNetwork as shown in the visualization below. I want a functionality to make the edge "1" and edge "3" curved. I am attaching the js code that can be used to achieve this. However, please help me to integrate the same code in R. Thanks. nodes <- data.frame(id = 1:4) edges <- data.frame(from = c(2,4,3,2), to = c(1,2,4,3), label = 1:4) edges <- data.frame(edges,edges$from) visNetwork(nodes, edges, width = "100%") %>% visEdges(arrows =list(to = list(enabled = TRUE,

vis.js crossed edges in 4.21 hierarchical graph

天大地大妈咪最大 提交于 2019-11-27 16:23:53
Problem: After switchnig to new (4.21) version of vis.js (from 4.18) my graph is all messed up. EDIT: The change occurs between versions 4.19.1 and 4.20. I guess it has something to do with multiple changes in network introduced in the 4.20 version . I'm building a family free. I spent some time to get a nice looking graph. Then I found out that new version of vis.js is available. Once I decided to use it, the edges of my graph started to cross. Here's my nice-looking graph using 4.18.1: Here's what happens if I change to 4.21.0: What did I do wrong? How to fix this? Same data, same code. The

vis.js crossed edges in 4.21 hierarchical graph

风流意气都作罢 提交于 2019-11-26 22:27:07
问题 Problem: After switchnig to new (4.21) version of vis.js (from 4.18) my graph is all messed up. EDIT: The change occurs between versions 4.19.1 and 4.20. I guess it has something to do with multiple changes in network introduced in the 4.20 version. I'm building a family free. I spent some time to get a nice looking graph. Then I found out that new version of vis.js is available. Once I decided to use it, the edges of my graph started to cross. Here's my nice-looking graph using 4.18.1: Here