Grasshopper

algorithmic modeling for Rhino

Help with Force-Directed-Tree-Layout (Data Viz)?

I would like to achieve this effect for data visualization (requires javascript).

I first tried to implement this using springs in Kanagaroo, but I was largely unsuccessful, and the results were sluggish and difficult to control. Instead, now I am using Anemone

So far I have the ability to draw a tree (but not based on any reasonable grasshopper-native "data tree"). 

This visualization requires the Anemone plugin

I am using the Vector Fields elements to generate repulsive forces between the nodes and edges (I'm not sure if its nodes-nodes and edges-nodes, or all-all...?) 

Anyway, I have been stuck for quite some time, unable to implement the following:

  1. Add an optional "down-the-tree" force to ensure that target nodes are always generally below (lower Y-coordinate) the lowest parent (source) node. 

  2. Add an optional edge-contracting force in an effort to pull connected nodes closer together (my current version only looks nice because the nodes initial positions are reasonable. But if the initial positions are randomized, it falls apart).

  3. Smooth out some of the jitter that happens once a point reaches the origin. 

  4. (Bonus goal) See if there is a better way to represent the data in GH. I have the SpiderWeb plugin, but I have never been able to make sense of it. 

  5. (Bonus goal) See if it would be easier/faster to implement this in python.

  6. (Bonus goal) - better understand the behavior of the vector fields in order to achieve something like this http://bl.ocks.org/mbostock/1804919

Any suggestions, tips, or general feedback from the community would be really appreciated! Feel free to use this gh file and share your adaptations and graphs!

Unfortunately I cannot share my actual graph / visualization due to the data that I am representing. 

Views: 613

Attachments:

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service