Skip to content

commitd/components-graph

Repository files navigation

Components Graph


Project Logo

Committed Software Graph Component

Committed Badge Build Status Quality Gate Status Coverage GitHub repo size semantic-release

A graph visualisation. It supports custom decoration, different layouts and user interactions.

Commands

Install dependencies with

npm install

Build the modules

npm run build

This builds to the relevant /dist folders.

Modules

The project is published as @committed/components-graph but is further separated into modules so the non-ui code can be used in the backend.

  • @committed/graph - contains the graph models, types and API
  • @committed/graph-rdf - contains code to create graph models from RDF
  • @committed/graph-json - contains code to create graph models from JSONGraph
  • @committed/component-graph-react - contains the react specific UI components

Storybook

To view a storybook of the components, run:

npm run storybook

Example

There is also an example project that uses the graph:

cd example
npm install
npm run start

The default example imports and live reloads whatever is in /dist, so if you are seeing an out of date component. No symlinking required, we use Parcel's aliasing.

Configuration

Code quality is set up for you with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.

Jest

Jest tests are set up to run with npm run test and testing-library.

React Testing Library

Import test/setup in your test files to use react-testing-library.

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.

Publishing to NPM

Publish is handled by semantic-release use conventional commits. Use npm run commit for helper.