Code Monkey home page Code Monkey logo

vis-network-react's People

Contributors

andreboyko avatar dependabot[bot] avatar rains31 avatar renovate-bot avatar renovate[bot] avatar uptycs-bhaskar avatar yotamberk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vis-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

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.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.