Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sigma/edge-curve

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sigma/edge-curve

An edge program that renders edges as curves for sigma.js

  • 3.0.0-beta.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-19.46%
Maintainers
0
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 30 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc