vis-network-react's People
Forkers
andreboyko kornfleks onlyreddy dinerismail belopot zackradisic rains31 uptycs-bhaskar sbelzile-nexapp gaberger isabella232 jmsundin jimmyzhenvis-network-react's Issues
Please add a license to this repo
First, thank you for the project!
Could you please add an explicit LICENSE file to the repo so that it's clear under what terms the content is provided, and under what terms user contributions are licensed?..
I want to use this code in my project invana-studio, but this code is still using vis-network==8.x.x as requirements and i want to be able to update and use this code in my project.
Uncaught TypeError: Cannot read properties of null (reading 'hasChildNodes')
I'm getting this error and I'm not sure why
error:
Uncaught TypeError: Cannot read properties of null (reading 'hasChildNodes')
at t.value (Canvas.js:227:1)
at new XC (Network.js:138:1)
at spawnNodes (Graph.js:44:1)
at Graph (Graph.js:60:1)
at renderWithHooks (react-dom.development.js:16305:1)
at mountIndeterminateComponent (react-dom.development.js:20074:1)
at beginWork (react-dom.development.js:21587:1)
at beginWork$1 (react-dom.development.js:27426:1)
at performUnitOfWork (react-dom.development.js:26557:1)
at workLoopSync (react-dom.development.js:26466:1)
my code:
import React, { useEffect } from 'react';
import {useDispatch, useSelector} from 'react-redux'
import { Network } from "vis-network";
import {DataSet} from "vis-data";
// import data from "../../data/vis.json";
`function Graph () {
const dispatch = useDispatch();
const visData = useSelector((state) => {
return state.visData
})
const spawnNodes = () => {
if(visData){
// console.log(data)
let nodes = []
nodes = new DataSet(visData["nodes"])
let edges = new DataSet(visData["edges"])
// create a network
var container = document.getElementById("mynetwork");
var data = {
nodes: nodes,
edges: edges,
};
var options = {
nodes: {
shape: "dot",
size: 30,
font: {
size: 32,
color: "#ffffff",
},
borderWidth: 2,
},
edges: {
width: 2,
arrows: "to",
},
physics: false
};
var network = new Network(container, data, options); <-- highlighted error
dispatch({type: "INIT_NETWORK", payload: network})
dispatch({type: "NODES_DATASET", payload: nodes})
dispatch({type: "INIT_NODE_OPTIONS", payload: network.body.nodes})
network.on("click", (prop) => {
let ids = prop.nodes;
let clickedNodes = nodes.get(ids)
// console.log('clicked nodes:', clickedNodes[0]);
dispatch({type: "SELECT_NODE", payload: clickedNodes[0]})
})
}
}
// useEffect(() => {
// spawnNodes(data)
// })
return (
<div id="mynetwork"> <-- highlighted error
{spawnNodes()}
</div>
);
}
export default Graph;
`
When I hover over Network
, it says (alias) new Network(container: HTMLElement, data: Data, options?: Options | undefined): Network
import Network
Not found nodes reference to edge before delete.
The function getConnectedNodes with idEdge not return nodes referenced to the edge.
Use getConnectedNodes with callback to the "getNetwork" in instance VisNetworkReactComponent.
How to get the selected node in 'chosen' property of edge ?
When a node was selected, I want to set different color for the 'from' and 'to' edges of the selected node, so I added a 'chosen' property to all the edges, and I don't know how to get the selected node in this function:
chosen: {
edge: function (values, id, selected, hovering) {
// how to get the selected node?
}
}
Dependency Dashboard
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Rate-Limited
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
- Update dependency lodash to v4.17.21
- Update dependency eslint to v7.32.0
- Update dependency moment to v2.30.1
- Update dependency prop-types to v15.8.1
- Update testing-library monorepo (
@testing-library/jest-dom
,@testing-library/user-event
) - Update dependency eslint to v9
- Update dependency eslint-config-airbnb to v19
- Update dependency react-scripts to v5
- Update dependency uuid to v10
- Update testing-library monorepo (major) (
@testing-library/jest-dom
,@testing-library/react
,@testing-library/user-event
) - ๐ Create all rate-limited PRs at once ๐
Edited/Blocked
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
- Update dependency eslint-config-airbnb to v18.2.1
- Update dependency react-scripts to v3.4.4
- Update dependency uuid to v8.3.2
Open
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
- Update babel monorepo (
@babel/cli
,@babel/core
,@babel/preset-env
,@babel/preset-react
) - Update dependency eslint-plugin-import to v2.29.1
- Update dependency eslint-plugin-jsx-a11y to v6.9.0
- Update dependency eslint-plugin-react to v7.35.0
- Update dependency vis-data to v7.1.9
- Update dependency vis-network to v8.5.6
- Update react monorepo (
eslint-plugin-react-hooks
,react
,react-dom
) - Update dependency vis-network to v9
- Update dependency vis-util to v5
- Update react monorepo to v18 (major) (
react
,react-dom
) - Click on this checkbox to rebase all open PRs at once
Detected dependencies
npm
example/package.json
@testing-library/jest-dom 5.11.4
@testing-library/react 10.4.9
@testing-library/user-event 12.1.3
react 16.13.1
react-dom 16.13.1
react-scripts 3.4.3
package.json
lodash 4.17.20
moment 2.27.0
uuid 8.3.0
vis-data 7.0.0
vis-network 8.2.0
vis-util 4.3.4
@babel/cli 7.10.5
@babel/core 7.11.4
@babel/preset-env 7.11.0
@babel/preset-react 7.10.4
eslint 7.7.0
eslint-config-airbnb 18.2.0
eslint-plugin-import 2.22.0
eslint-plugin-jsx-a11y 6.3.1
eslint-plugin-react 7.20.6
eslint-plugin-react-hooks 4.1.0
prop-types 15.7.2
react 16.13.1
react-dom 16.13.1
prop-types ^15.7.2
react ^16.13.1
react-dom ^16.13.1
- Check this box to trigger a request for Renovate to run again on this repository
How to draw on the canvas using normal HTML5 canvas functions
How to draw on the canvas using normal HTML5 canvas functions
https://visjs.github.io/vis-network/examples/network/events/renderEvents.html
beforeDrawing & afterDrawing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.