mozilla / lightbeam-we

Web Extension version of the Firefox Lightbeam add-on
https://addons.mozilla.org/en-GB/firefox/addon/lightbeam/
Mozilla Public License 2.0
181 stars 61 forks source link

POC: d3 force layout with dynamic data #72

Closed biancadanforth closed 7 years ago

biancadanforth commented 7 years ago

Got d3 to update without a re-render in a force-directed graph! Using fake data and setInterval currently. The good news is that it does calculate the diff for us. We just have to pass in the updated value for nodes and links and preserve order by passing in a function that returns a unique ID for each node as the second argument for the data() method. Also for a fraction of a second, some nodes appear at (0,0) (top left corner of the page) -- not sure if that is preventable but worth looking into as well. Next step would be to draw with <canvas> instead and try using fake data that is even more similar to the form of data we would be passing in (maybe taking two or three snapshots of data and inserting it into this code)..

biancadanforth commented 7 years ago

Closing this POC. It was just an experiment. Not intended to be merged.