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

@sigma/node-border

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sigma/node-border

A node program that renders concentric discs in nodes for sigma.js

  • 3.0.0-beta.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-17.87%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 23 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