Network graph modules for the foundation analysis suite.
npm install @foundation/graphFoundation Graph
================
Add a [force graph][1] view to your react application. This module was built
for use in the [foundation suite][2] but can be used in any react-based app.
Start by installing the package...
`` bash`
npm install @foundation/graph
Create a simple react component with your graph:
` js
import React from 'react'
import { Graph, Nodes, Links } from '@foundation/graph'
const MyGraph = props => (
{ id: 'foo' },
{ id: 'bar' },
{ id: 'baz' }
]}
links={[
{ source: 'foo', target: 'bar' },
{ source: 'foo', target: 'baz' }
]}
>
)
`
We support a variety of other features like panning/zooming, dragging, and node
selection. Documentation coming soon, see the /src` directory for now.
Contributions are more than welcome. We'd like to keep this package somewhat
lightweight with a simple interface that allows consumers to wrap it. If you
have an idea, feel free to open a ticket so we can discuss implementation
options.
[1]: https://observablehq.com/@d3/force-directed-graph
[2]: https://github.com/skipjack/foundation-core