vis.js

How to draw line graph on timeline using visjs?

天大地大妈咪最大 提交于 2020-01-12 07:09:32
问题 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? 回答1: 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

How to change edge connection points between nodes VisJs

自闭症网瘾萝莉.ら 提交于 2020-01-06 06:41:15
问题 I'm trying to code a visualization pipeline in VisJs. So I have a graph and some nodes. The nodes can generate/use a few different data types. So I need something like this ------------------ | Node1 | ------------------ int char | | | | | | | | int string char ------------------ | Node2 | ------------------ So one node has more than 1 anchor points that only connect to it's own type. Can I change the location from where the edges are drawn to where they are connected in the node? Does anyone

how to gray out node images in a vis.js network

守給你的承諾、 提交于 2020-01-05 05:09:11
问题 I've been able to highlight different parts of a vis.js network by utilizing the mechanism shown in the vis.js documentation examples. However,I wonder if we can get the same sort of effect when images are used for representing network nodes -as opposed to basic node shapes- (a straightforward 'coloring' of the nodes, as in the examples, does not gray out the images). 回答1: I'm the developer of the vis.js network module. Unfortunately there is no shortcut here. You'll have to generate b&w

How to limit zooming of a vis.js network?

可紊 提交于 2020-01-04 02:06:25
问题 I've implemented a simple network using vis.js. Here's my code: //create an array of nodes var nodes = [ { id: "1", label: "item1" }, { id: "2", label: "item2" }, { id: "3", label: "item3" }, ]; // create an array with edges var edges = [ { from: "1", to: "2", label: "relation-1", arrows: "from" }, { from: "1", to: "3", label: "relation-2", arrows: "to" }, ]; // create a network var container = document.getElementById('mynetwork'); // provide the data in the vis format var data = { nodes:

Vis.js: how to access the network inside an event handler?

我的梦境 提交于 2019-12-25 11:09:07
问题 I'd like to use vis.js for displaying and editing a graph (hence storing its nodes, edges and options). To implement this, I need to save changes of the network (=graph) on various events. On of them is rearranging via drag and drop. Now, there's an on method which supports the dragEnd event meaning I can do stuff like network.on("dragEnd",saveToTiddlerAfterDragging); However what's passed to the handler is this object: { nodes: [Array of selected nodeIds], edges: [Array of selected edgeIds],

How to change arrows in vis.js to chicken feet or cardinality

◇◆丶佛笑我妖孽 提交于 2019-12-24 16:25:41
问题 I am trying to use vis.js to show the structure of an XML or JSON Schema. I would like to show cardinality instead of an arrow. Any suggestions on documentation to view, because I cannot find any. Thanks, Loren 回答1: Each edge has a function that is responsible for drawing arrows: drawArrows . Accordingly, it is possible to redefine its: edge.drawArrows = function drawArrows(ctx, arrowData) { if (this.options.arrows.from.enabled === true) { drawArrowCircle(ctx, this.selected, this.hover,

Why don't my node hover popups work in my vis.js network?

大城市里の小女人 提交于 2019-12-24 08:23:42
问题 I am having an issue where despite including the 'title' property in my node objects, when I hover over a node, no pop up window with the contents of my title are displayed. Here are my options and how I set my network up. setUpNetwork(){ let container = document.getElementById('mynetwork'); //These options dictate the dynamic of the network let options = { nodes: { shape: 'box' }, interaction: { dragNodes: false, dragView: false, hover: true }, layout: { randomSeed: undefined, improvedLayout

Get Node and Edge data from visNetwork graph

女生的网名这么多〃 提交于 2019-12-24 07:45:01
问题 I am trying to get the nodes/edges data from my visNetwork graph. I am using the example code, but it is not working. I am trying to do this with Shiny. My goal is to get the nodes and edges data from the network and then display it in a table. I will greatly appreciate any help that I can get. Thanks, Here is my code: require(shiny) require(visNetwork) server <- function(input, output) { output$network_proxy_nodes <- renderVisNetwork({ nodes <- data.frame(id = 1:3) edges <- data.frame(from =

Making the edges curved in visNetwork in R by giving roundness factor

狂风中的少年 提交于 2019-12-24 02:21:37
问题 The following R script creates a visNetwork diagram as shown. How to manually change the straight edges to curved edges by giving a curved factor? One approach that I tried here using the roundness attribute with "smooth" label. However, not able to achieve it. library(visNetwork) nodes <- data.frame(id = 1:3,color = c(rep("blue",1), rep("red",1), rep("green",1))) edges <- data.frame(from = c(1,2,3), to = c(2,3,1)) nodes = data.frame(nodes, level = edges$from) visNetwork(nodes, edges, height

VisJS Timeline: sorting items in timeline

跟風遠走 提交于 2019-12-24 00:58:53
问题 I'm using vis-js timeline library for building a timeline. I need to sort the elements in each group. Groups are like in example here. I saw that I can do this using the " order option in the item" like here but I cannot understand how it works. I tried this way: var groups = new vis.DataSet([ {id: 0, content: 'First', value: 1}, {id: 1, content: 'Third', value: 3}, {id: 2, content: 'Second', value: 2} ]); // create a dataset with items var items = new vis.DataSet([ {id: 0, group: 0, content: