react-graphie
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

(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

Readme

Keywords

none

Package Sidebar

Install

npm i react-graphie

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

984 kB

Total Files

8

Last publish

Collaborators

  • nicolascine