nickbalestra / sankey

A D3/Faux-dom/React App to build and read sankey diagrams

Home Page:http://nick.balestra.ch/sankey/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sankey - D3/REACT App

A D3/Faux-dom/React App to build and visualize Sankey diagrams:

  • D3 runs all the calculation.
  • A faux-dom coupled with D3 generates SVG elements in an isomorphic way.
  • React handles state and renderings.

DataFormat

You can import/export sankey diagrams using the following json format:

{ 
  nodes: [
    {"name":"node0"},
    {"name":"node1"}], 
  links: [
    {"source":0,"target":1,"value":100}
  ]
}

Install:

Make sure you have webpack installed globally:

$ npm i -g webpack

Install npm dependencies:

$ npm i

Build your bundle:

$ webpack or $ npm run dev

Serve your public/index.html via http to see and use the Sankey Diagram Builder App.

Webpack dev server

The webpack-dev-server is a little node.js Express server, which uses the webpack-dev-middleware to serve a webpack bundle. It also has a little runtime which is connected to the server via Socket.IO

Just run the server from the project root

$ webpack-dev-server or npm run dev-server


About

A D3/Faux-dom/React App to build and read sankey diagrams

http://nick.balestra.ch/sankey/

License:MIT License


Languages

Language:JavaScript 82.8%Language:CSS 9.5%Language:HTML 7.7%