You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP β†’
Socket
Book a DemoInstallSign in
Socket

@ts-graphviz/common

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-graphviz/common

Graphviz Types and Utilities

3.0.0
next
latest
Source
npmnpm
Version published
Weekly downloads
441K
-13.54%
Maintainers
1
Weekly downloads
Β 
Created

What is @ts-graphviz/common?

@ts-graphviz/common is a TypeScript library that provides common utilities and types for working with Graphviz, a graph visualization software. It is part of the ts-graphviz project, which aims to provide a set of tools for creating and manipulating Graphviz graphs in TypeScript.

What are @ts-graphviz/common's main functionalities?

Graph Creation

This feature allows you to create a directed graph (Digraph), add nodes, and add edges between nodes. The `toDot` method converts the graph to DOT format, which is the plain text graph description language used by Graphviz.

const { Digraph } = require('@ts-graphviz/common');
const g = new Digraph('G');
g.addNode('A');
g.addNode('B');
g.addEdge(['A', 'B']);
console.log(g.toDot());

Node and Edge Attributes

This feature allows you to add attributes to nodes and edges. Attributes can include properties like color, shape, and labels, which customize the appearance and behavior of the graph elements.

const { Digraph } = require('@ts-graphviz/common');
const g = new Digraph('G');
g.addNode('A', { color: 'red' });
g.addNode('B', { shape: 'box' });
g.addEdge(['A', 'B'], { label: 'A to B' });
console.log(g.toDot());

Subgraphs

This feature allows you to create subgraphs within a main graph. Subgraphs can be used to group nodes and edges together, often for the purpose of applying specific attributes or for organizational purposes.

const { Digraph, Subgraph } = require('@ts-graphviz/common');
const g = new Digraph('G');
const sg = new Subgraph('cluster_0');
sg.addNode('A');
sg.addNode('B');
g.addSubgraph(sg);
console.log(g.toDot());

Other packages similar to @ts-graphviz/common

Keywords

graphviz

FAQs

Package last updated on 17 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.