3.1.0 • Published 7 months ago

@sigma/edge-curve v3.1.0

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

Sigma.js - Edge curve renderer

This package contains a curved edges renderer for sigma.js.

It handles various aspects, such as:

  • Varying curvatures
  • Arrow heads
  • Parallel curved edges

The edges are rendered as quadratic Bézier curves. This package exports by default EdgeCurveProgram, the renderer for sigma. Edges can have a curvature value, to make them more or less curved.

It also exports:

  • EdgeCurvedArrowProgram, a program with defaults settings adapted to render edges as curved arrows
  • createEdgeCurveProgram, the factory to build a CustomEdgeCurveProgram with customized settings
  • DEFAULT_EDGE_CURVATURE, the default curvature value for edges
  • indexParallelEdgesIndex, a utility function to find parallel edges, and help adapt their curvature for display (see the dedicated example to see how it works)

How to use

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

import EdgeCurveProgram from "@sigma/edge-curve";

const graph = new Graph();
graph.addNode("a", { x: 0, y: 0, size: 10, label: "Alex" });
graph.addNode("b", { x: 10, y: 10, size: 10, label: "Bill" });
graph.addEdge("a", "b", { type: "curved" });

const sigma = new Sigma(graph, container, {
  edgeProgramClasses: {
    curved: EdgeCurveProgram,
  },
});

Please check the related Storybook for more advanced examples.

3.1.0

7 months ago

3.0.0

7 months ago

3.0.0-beta.15

10 months ago

3.0.0-beta.16

10 months ago

3.0.0-beta.9

1 year ago

3.0.0-beta.8

1 year ago

3.0.0-beta.10

1 year ago

3.0.0-beta.11

1 year ago

3.0.0-beta.12

1 year ago

3.0.0-beta.13

1 year ago

3.0.0-beta.14

11 months ago

3.0.0-beta.7

1 year ago

3.0.0-beta.6

1 year ago

3.0.0-beta.5

1 year 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