Giter Site home page Giter Site logo

john-guerra / forceinabox Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 19.0 8.92 MB

d3 force plugin that implements the GroupInABox algorithm that distributes nodes using a treemap to identify better clusters

License: MIT License

JavaScript 71.41% HTML 28.59%

forceinabox's People

Contributors

emeeks avatar giorgi-ghviniashvili avatar john-guerra avatar micahstubbs avatar rogeraleite avatar zhuoqi-chen avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

forceinabox's Issues

Multiple network forces

First of all really good extension. Almost what am looking for but am having trouble implementing it.


Fiddle: https://jsfiddle.net/pdubey84/pf3Lb5n2/

Use case

  • I have d3 rendering multiple networks.
  • It consists of single nodes plus multiple connected node networks.
  • I am trying to attach d3-force (simulation) so that the nodes dont overlap when dragged and the entire network maintains relative positioning.

I feel force in a box is somewhat similar to what I want. Do you by any chance have an implementation where multiple networks which are laid out nicely away from each other and grouped can be applied forces so they will open up nicely and won't get affected when one group is applied force with.

The problem:

  • When the simulation loads (simulation.restart()), the entire network keeps spreading apart.
  • Even if a single node or nodes from one network are dragged, all other networks move.

What I would want?

  • If its single nodes, they shouldnt move unless dragged
  • When a connected network is dragged, only that network moves and nothing else moves
  • If a connected network is dragged onto itself, it opens up
  • [good to have] if one network is dragged onto another network, then they both move away and maintain relative distance.
  • If the networks are away from each other then dragging one shouldnt move or affect anything else.

I would really really help any help or suggestions on how to get this to work

Groups overpal

Hello ! I'm using your wonderful plugin for visualization of my network. The problem that i'm facing is that i have 108 groups and 5000 nodes in my graph and with this amount of nodes my groups are overlap, is there a way to do set distance between groups more visible in my case.
Here is my force configuration is looks like
` const force = d3.forceSimulation()
.force('charge', d3.forceManyBody().strength(-1000))
.force('x', d3.forceX(e.data.width / 2).strength(0.01))
.force('y', d3.forceY(e.data.height / 2).strength(0.01));

const groupingForce = forceInABox()
  .groupBy('group') // Node attribute to group
  .strength(0.18)
  .links(links)
  .linkStrengthInterCluster(0) // linkStrength between nodes of different clusters
  .linkStrengthIntraCluster(0)
  .nodeSize(4)
  .size([
    e.data.width,
    e.data.height,
  ]); // Size of the chart

force
  .nodes(nodes)
  .force('group', groupingForce)
  .force('charge', d3.forceManyBody().strength(-80))
  .force('link', d3.forceLink(links)
    .distance(300)
    .strength(groupingForce.getLinkStrength)
  );

`
It is how it looks right now:

Screen Shot 2019-08-20 at 7 50 50 PM

PS: I'm new id D3 :)

reciprocal links bug?

see this bug that I think has to do with reciprocal links, where two nodes link to each other both ways in a directed graph.

will add this issue as a placeholder and try to come back and add more detail.

screen shot 2017-08-07 at 10 02 50 pm
screen shot 2017-08-07 at 10 00 32 pm
screen shot 2017-08-07 at 10 00 36 pm

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.