Skip to main content
100%

D3 + Vue.js

✓ Published0🌍 Public
663anp3ca
Last edited Oct 9, 2018
Created on Oct 9, 2018

This interactive cluster dendrogram visualizes hierarchical data from a CSV file using D3 v4 (via `d3.stratify`) and Vue.js 2.2.4, rendering nodes and links as SVG elements. Vue’s template syntax replaces D3’s `enter`/`exit`/`update` pattern, with computed properties managing the tree layout and transitions. The interface includes controls for chart width, stroke color, and text search, plus a button to add nodes.

AI-generated description

This is a re-write of Cluster Dendrogram with D3 + VueJS.

In order to connect the user interface with the chart, the chart rendering is done by using Vue’s template syntax to bind attributes to the SVG elements.

This can be seen as a replacement for d3.select and the usual enter, exit, update. With Vue, we can use computed properties to make sure that whenever data changes, the representation also updates.

The whole purpose of adding Vue is to benefit from it’s capabilities of building user interface components on top of data models.

Of course, this can also be can be done through native JS or D3 events, but VueJS allows us to build reactive, re-usable components which might come in handy in more complex projects.

forked from <a href='http://bl.ocks.org/getflourish/'>getflourish</a>'s block: <a href='http://bl.ocks.org/getflourish/8b3eeb3076bc3e20099de7f2ef9186b8'>D3 + Vue.js</a>

forked from <a href='http://bl.ocks.org/lorenzopub/'>lorenzopub</a>'s block: <a href='http://bl.ocks.org/lorenzopub/02ccce43d708919ca7c0b242fe1c93f2'>D3 + Vue.js</a>

forked from <a href='http://bl.ocks.org/FrissAnalytics/'>FrissAnalytics</a>'s block: <a href='http://bl.ocks.org/FrissAnalytics/2b727ec56460b284ffe14b9bdead812d'>D3 + Vue.js</a>

mit Licensed

Similar vizzes