3.0.0 • Published 7 months ago

@sigma/node-border v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Sigma.js - Node border renderer

This package contains a node border renderer for sigma.js.

It handles various aspects, such as:

  • Variable or fixed border thickness
  • Relative (ie percentage of the nodes radius) or "pixels" border thickness
  • Variable or fixed colors
  • Multiple borders

The shaders are generated according to these varying options, so the main export is createNodeBorderProgram, a factory that creates a renderer class.

It also exports one core class, built with the default settings, to help using it in an easier way: NodeBorderProgram is configured to render nodes with a 10% border of color borderColor (read in the nodes data), and filled with the nodes color.

How to use

Within your application that uses sigma.js, you can use @sigma/node-border as following:

import { NodeBorderProgram } from "@sigma/node-border";

const graph = new Graph();
graph.addNode("some-node", {
  x: 0,
  y: 0,
  size: 10,
  type: "border",
  label: "Some node",
  color: "blue",
  borderColor: "red",
});

const sigma = new Sigma(graph, container, {
  nodeProgramClasses: {
    border: NodeBorderProgram,
  },
});

Please check the related Storybook for more advanced examples.

3.0.0

7 months ago

3.0.0-beta.7

9 months ago

3.0.0-beta.6

9 months ago

3.0.0-beta.5

10 months ago

3.0.0-beta.4

1 year ago

3.0.0-beta.3

1 year ago

3.0.0-beta.2

1 year ago

3.0.0-beta.1

1 year ago