@dechegaray/react-graph-network
v1.5.0
Published
> Made with create-react-library
Downloads
14
Readme
network-graph
Made with create-react-library
Install
npm install @dechegaray/react-graph-network
Usage
import React from 'react'
import { NetworkGraph } from '@dechegaray/react-graph-network'
const viewportHeight = 300
const exampleData = {
nodes: [
{ id: 'node1', label: 'Node 1' },
{ id: 'node2', label: 'Node 2' },
{ id: 'node3', label: 'Node 3' },
],
links: [
{ source: 'node1', target: 'node2' },
{ source: 'node1', target: 'node3' },
],
}
function App() {
return (
<div style={{ height: viewportHeight }}>
<NetworkGraph id='network-graph' data={exampleData} />
</div>
)
}
Development
For development simply cd into the root folder of this project and run the following:
npm install
to install dependencies for your projectnpm link
to create a symlink to this package
After your changes are completed
cd ./examples
to execute the sample projectnpm install
to install dependencies on the sample projectnpm link @dechegaray/react-graph-network
to add a reference to the symlink created above and avoiding the need of installing the actual dependencynpm run dev
to start your dev server and see your changes live
Add proper unit/component test as needed