@foundation/graph

0.2.5 • Public • Published

Foundation Graph

Add a force graph view to your react application. This module was built for use in the foundation suite but can be used in any react-based app.

Usage

Start by installing the package...

npm install @foundation/graph

Create a simple react component with your graph:

import React from 'react'
import { Graph, Nodes, Links } from '@foundation/graph'

const MyGraph = props => (
    <Graph
        nodes={[
            { id: 'foo' },
            { id: 'bar' },
            { id: 'baz' }
        ]}
        links={[
            { source: 'foo', target: 'bar' },
            { source: 'foo', target: 'baz' }
        ]}
    >
        <Links />
        <Nodes />
    </Graph>
)

We support a variety of other features like panning/zooming, dragging, and node selection. Documentation coming soon, see the /src directory for now.

Contributing

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.

Dependencies (6)

Dev Dependencies (13)

Package Sidebar

Install

npm i @foundation/graph

Weekly Downloads

4

Version

0.2.5

License

UNLICENSED

Unpacked Size

788 kB

Total Files

34

Last publish

Collaborators

  • skipjack.