react-graphie

React graphs with D3

Usage no npm install needed!

<script type="module">
  import reactGraphie from 'https://cdn.skypack.dev/react-graphie';
</script>

README

(WIP) react-graphie

React graphs with D3

NPM JavaScript Style Guide

Install

npm install --save react-graphie

Usage

import React, { Component } from "react";
import Graph from "react-graphie";

const dataset = {
  nodes: [
    { id: "Myriel", group: 1 },
    { id: "Napoleon", group: 2 },
    { id: "Mlle.Baptistine", group: 3 },
    { id: "Mme.Magloire", group: 4 }
  ],
  links: [
    { source: "Napoleon", target: "Myriel" },
    { source: "Mlle.Baptistine", target: "Myriel" },
    { source: "Mme.Magloire", target: "Myriel" },
    { source: "Mme.Magloire", target: "Mlle.Baptistine" }
  ]
};

const options = {
  width: 100,
  height: 100
};

export default class App extends Component {
  render() {
    return <Graph dataset={dataset} options={options} />;
  }
}

License

MIT © nicolascine