force-graph | Force-directed graph rendered on HTML5 canvas | Canvas library

 by   vasturiano JavaScript Version: 1.43.5 License: MIT

kandi X-RAY | force-graph Summary

kandi X-RAY | force-graph Summary

force-graph is a JavaScript library typically used in User Interface, Canvas, Three.js, WebGL, D3 applications. force-graph has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.

Force-directed graph rendered on HTML5 canvas
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              force-graph has a medium active ecosystem.
              It has 1159 star(s) with 210 fork(s). There are 19 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 113 open issues and 173 have been closed. On average issues are closed in 40 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of force-graph is 1.43.5

            kandi-Quality Quality

              force-graph has 0 bugs and 0 code smells.

            kandi-Security Security

              force-graph has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              force-graph code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              force-graph is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              force-graph releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Installation instructions are not available. Examples and code snippets are available.
              force-graph saves you 447 person hours of effort in developing the same functionality from scratch.
              It has 1369 lines of code, 0 functions and 40 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed force-graph and discovered the below as its top functions. This is intended to give you an instant insight into force-graph implemented functionality, and help decide if they suit your requirements.
            • Update link links
            • Update all linked points .
            • Draws arrows .
            • paint current node
            • Adjust the canvas
            • Calculate control points for a link .
            • Traverse the given graph .
            • Rotate the engine
            • look for indexed colors
            • set zoom level
            Get all kandi verified functions for this library.

            force-graph Key Features

            No Key Features are available at this moment for force-graph.

            force-graph Examples and Code Snippets

            No Code Snippets are available at this moment for force-graph.

            Community Discussions

            QUESTION

            Class constructor Object3D cannot be invoked without 'new' at new THREE.CSS2DObject
            Asked 2021-Jun-20 at 08:51

            I got this error: Uncaught TypeError: Class constructor Object3D cannot be invoked without 'new' at new THREE.CSS2DObject and i try to run this project: https://github.com/vasturiano/3d-force-graph/blob/master/example/text-nodes/index.html

            ...

            ANSWER

            Answered 2021-Jun-20 at 08:19

            This error indicates that THREE.CSS2DObject and the core library three.js are from different releases. Such setup are not supported and should always be avoided.

            Notice that lately the code base was migrated to ES6 classes. If you try to derive from an ES6 class with ES5 prototype style code, you will encounter the above runtime error. So it seems the code use a newer three.js than THREE.CSS2DObject.

            Source https://stackoverflow.com/questions/68050700

            QUESTION

            What environment do I need to run a vasturiano 3D-Force Graph?
            Asked 2021-Jun-04 at 16:01

            I only know javascript from a web browser perspective but I need to display data online in the way this web component does: https://github.com/vasturiano/3d-force-graph

            The thing is that the setup instructions there aren't newbies friendly at all. It assumes some basic to advanced knowledge. So I made some research and even though everyone talking about the component say it's very easy to implement, none of them say how.

            I kind of presume that there must be some javascript server involved (node.js ?). That Three.js and d3-force-3d must be imported (somehow, somewhere). But that's it. I'm not even sure it's enough. But I just can't figure out how to setup the whole thing so that I can run one of those scripts.

            So, can anyone just give me hints, at a newbie level, so that I can work my way through using those scripts? Because at this point, I'm willing to search but I don't know what to search for exactly. I'm lacking the big picture while the info in the link are very particular and not very thorough.

            I searched the web for two days but there is not much to find about 3d-force-graph and there is zero info on how to set it up.

            All I need is a bridge in terms of info, so that these scripts can be set up and run (with custom data) by a non expert. I mean what environment, what libraries/dependencies, what to import, how to import, etc. Not necessarily in details as any help would be a good starting point.

            Thank you.

            ...

            ANSWER

            Answered 2021-Jun-04 at 16:01

            I was able to run the basic example by simply creating an .html file and putting it in a web server. So if you grab the Basic example (https://github.com/vasturiano/3d-force-graph/blob/master/example/basic/index.html) and get that file content into your development web server.

            So the index.html file would look like:

            Source https://stackoverflow.com/questions/67839114

            QUESTION

            Apply zoom to tooltip in D3 tree
            Asked 2021-Mar-19 at 23:11

            I'm trying to create a HTML tooltip that can be zoomed in and out with D3 zoom effect. I've managed to have it working partially, because the positioning of the tooltip is wrong, but it is being zoomed correctly.

            I've tried something similar to what has been said in this question, but without success.

            What do I need to do? I guess it's only a problem with the zoom event of the zoomBehaviours object, but I can't find the way to solve it.

            In the following snippet you can see what's the current state of the tooltip.

            ...

            ANSWER

            Answered 2021-Mar-19 at 23:11

            I finally made it with a simple modification of this question. The problem was that I was shifting the tooltip with a translate event that was not necessary. This would be the look of the code after the change. Notice that I only changed the zoom event of the zoomBehaviours object.

            Source https://stackoverflow.com/questions/66662973

            QUESTION

            Infer my object interface to type "object"
            Asked 2021-Jan-20 at 15:46

            I'm learning TypeScript. I'm using a component from a library that was built in TypeScript. I want to pass my own function to this component, which receives it as props:

            ...

            ANSWER

            Answered 2021-Jan-20 at 15:46

            QUESTION

            d3Force's d3.forceLink error: node not found:
            Asked 2020-Nov-17 at 09:13

            I see this related solution D3js Force Directed Graph Link not found

            yet I get the error in the title - "VM2128 d3-force-3d:2 Uncaught Error: node not found: golfing_4_1"

            ...

            ANSWER

            Answered 2020-Nov-17 at 09:13

            The underlying problem was that you needed to pass the entire graphData to your d3.forceLink function, not just graphData.link. However, I think the following solution is cleaner:

            From the documentation of 3d-force-graph for Graph.d3Force():

            Getter/setter for the internal forces that control the d3 simulation engine. Follows the same interface as d3-force-3d's simulation.force. Three forces are included by default: 'link' (based on forceLink), 'charge' (based on forceManyBody) and 'center' (based on forceCenter).

            This means that you can call the function with only a string 'link' and you get an object of type d3-force-3d.forceLink, which is automatically applied and thus automatically has access to the right graphData. Then, you can set forceLink.id just like you did, but you can also set it later.

            Source https://stackoverflow.com/questions/64851658

            QUESTION

            Issues with 3d-force-graph node updates
            Asked 2020-Oct-17 at 00:35

            I'm making an application where a viewer can use a dat.gui menu to update their Three.js animation. Specifically, I'm using 3d-force-graph.

            When the users makes a change, I do the following:

            1. swap the old .json runnning their animation with the new one required to render their choice
            2. run a function called vertexControl which changes the nodes of their new animation (e.g., color change).

            Simple example:

            ...

            ANSWER

            Answered 2020-Oct-17 at 00:35

            The problem is that Graph.jsonUrl() has to load that JSON asynchronously, but vertexControl() is performed immediately, before the JSON has finished loading. I'm looking at the force-graph docs, and sadly there is no built-in way to perform a callback for when the JSON finishes loading. You might have to load the JSON yourself with THREE.FileLoader so you can invoke your own callback after loading is complete:

            Source https://stackoverflow.com/questions/64397402

            QUESTION

            How to run my react app in Docker container
            Asked 2020-Sep-18 at 09:26

            I have this react app I want to dockerize. But the problem is, even though I tried, it doesn't work. But it works pretty well locally

            This is how the current directories look like:

            ...

            ANSWER

            Answered 2020-Sep-18 at 09:09

            Firstly, make sure you are copying the same package-lock.json file that you use to install deps locally, to make sure you have the same dependency tree in your container as you do locally.

            COPY package.json package-lock.json /app/

            Then, make sure that you are matching the same node/npm version as you run locally (replace 12 with the major version you are running, be it 10, 12, 14 or whatever):

            FROM node:12

            Each node version is bundled with a specific npm version (latest 12 version comes with npm 6.14.6), you can find the bundled NPM version int he changelogs, https://github.com/nodejs/node/tree/master/doc/changelogs

            Additionally, instead of running npm install, you might wanna run npm ci in the container. The latter skips any checks for discrepancy between the lock file and your package.json file and just installs the locked dependency tree, which is not only faster, but will also match your local dep tree exactly.

            EDIT:

            In addition, this line:

            COPY . /app

            Would also overwrite node_modules unless you have ignored it via .dockerignore or similar.

            Easiest would probably be to add a .dockerignore file to the same folder as your Dockerfile and add lines stating:

            Source https://stackoverflow.com/questions/63951764

            QUESTION

            Fix position of force-graph node using D3.js
            Asked 2020-Mar-11 at 09:55

            I'm using a force-graph D3 visualization from https://github.com/vasturiano/force-graph. This seems to provide great high-level API to create a force directed graph but I find it hard to customise as I'm new to Javascript.

            ...

            ANSWER

            Answered 2020-Mar-10 at 10:12

            The API link that you've provided is really beautiful. It's such a complex chart to work with and it ticks almost every box.

            However, it looks like the only way to adapt it to YOUR needs would be to hack into the js code which I would not advise.

            Personally I would start with a simpler d3 version and customise from here.

            For example: https://observablehq.com/@d3/force-directed-graph

            Here, you'd need to customise the simulation.on("tick" function. Something like this:

            Source https://stackoverflow.com/questions/60614548

            QUESTION

            3d-force-graph and Three.js - Add geometric glow / atmospheric material / simple texture to individual nodes and node groups
            Asked 2020-Feb-11 at 16:52

            I am working on a 3D force-graph visualisation and I'm using the great library:

            https://github.com/vasturiano/3d-force-graph

            I would like to try to get some sort of glowing effect on the nodes of the force-graph and I was having a look at something like this to accomplish it, but it is proving a challenge:

            https://github.com/jeromeetienne/threex.geometricglow

            So far I only have the ability to add new shapes and texture them. I have also added text sprites that follow the nodes, so I suspect an approach that combines these two might be possible. See below the code.

            Adding a glow effect or texture to this base code would also be very helpful:

            https://github.com/vasturiano/3d-force-graph/blob/master/example/async-load/index.html

            ...

            ANSWER

            Answered 2020-Feb-11 at 16:52

            I've been interested in getting this to work as well.

            I used this threex example and seen that these two lines were necessary:

            Source https://stackoverflow.com/questions/60072100

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install force-graph

            You can download it from GitHub, Maven.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i force-graph

          • CLONE
          • HTTPS

            https://github.com/vasturiano/force-graph.git

          • CLI

            gh repo clone vasturiano/force-graph

          • sshUrl

            git@github.com:vasturiano/force-graph.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link