It makes easy to publish networks on Web pages and allows developers to integrate network exploration in rich Web applications. Use JSX for graph configuration, including asynchronous graph loading. Library is lightweight and modular, so you can bundle only what you use. Easy to extend with additional components.
If you don't want to use webpack or browserify, you could always reference the
single file distribution, library will be available under global var ReactSigma:
area with a given style (default is full width, 500px height),
initializes renderer and camera in the given area and starts rendering graph.
be composed with sigma plugins using JSX syntax, e.g.:
By default sigma package includes only canvas rendering functions with webpack2, though it can be easily extended with WebGL or SVG (see next topic). Importing SigmaEnableWebGL enables WebGL renderer, setting it as default renderer if WebGL is supported by browser.
import { Sigma, SigmaEnableWebGL } from 'react-sigma'...<Sigma /> // will use webgl renderer if supported by browser
SigmaEnableSVG
Sigma can be easily extended with SVG renderer. Importing SigmaEnableSVG enables SVG renderer, though it does not set it as default so renderer should be explicitly specified in sigma options.
import { Sigma, SigmaEnableSVG } from 'react-sigma'...<Sigma renderer="svg" />
Extending sigma components
maxsparrow
maxim.vorobjov@gmail.com
Sigma container will mount any child component with sigma instance under props.sigma. This way you can write custom sigma-aware components:
Component which initialize or provide graph changes asynchronously are supposed to mount children
after initialized. For instance LoadJSON will render child subcomponents only after loading. This makes possible to build sequential composition in the pure JSX without any callbacks or handlers. In the following example RelativeSize will be instantiated only after loading from arctic.json file.