
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
graphviz-builder
Advanced tools
Generates the source graph script as input for Graphviz (dot
), which in turn can generate the graph image.
This project originated as a fork of node-graphviz to offer an easy integration to web browsers and JavaScript and TypeScript environments like Node.js and Deno. Features:
Map
.Related tools:
var graphvizBuilder = require('graphviz-builder');
// Create digraph G
var g = graphvizBuilder.digraph("G");
// Add node (ID: Hello)
var n1 = g.addNode( "Hello", {"color" : "blue"} );
n1.set( "style", "filled" );
// Add node (ID: World)
g.addNode( "World" );
// Add edge between the two nodes
var e = g.addEdge( n1, "World" );
e.set( "color", "red" );
// Print the dot script
console.log( g.to_dot() );
Make sure that you have installed Node.js. Use your favourite package manager (NPM, Yarn or PNPM) to add the graphviz-builder
module to your project. Add -D
on the command line if you use a bundler:
npm i graphviz-builder
yarn add graphviz-builder
pnpm i graphviz-builder
If you write a plain HTML page, insert the graphviz-builder
script pointing wither to CDN or to the local filesystem:
<script src=https://unpkg.com/graphviz-builder@0.1.1/dist/index.min.js></script>
<script src=node_modules/graphviz-builder/dist/index.min.js></script>
If you write source code for Node.js or for a web application bundler, you can refer to the locally installed graphviz-builder
module:
import { digraph } from 'graphviz-builder';
// Create digraph G
const g = digraph('G');
// Add node (ID: Hello)
const n1 = g.addNode('Hello', { color: 'blue' });
n1.set('style', 'filled');
// Add node (ID: World)
g.addNode('World');
// Add edge between the two nodes
const e = g.addEdge(n1, 'World');
e.set('color', 'red');
// Print the dot script
console.log(g.to_dot());
If you write source code for Deno, refer to the full URL of graphviz-builder
:
import { digraph } from 'https://unpkg.com/graphviz-builder@0.1.1/dist/index.min.mjs';
// ...the same code from the Node.js example above
If you write a plain HTML page, insert the graphviz-builder
script pointing wither to CDN or to the local filesystem. The AMD module name (and the windows global) is graphvizBuilder
.:
<script src=https://unpkg.com/graphviz-builder@0.1.1/dist/index.min.js></script>
<script src=node_modules/graphviz-builder/dist/index.min.js></script>
<script>
const { digraph } = window.graphvizBuilder;
// ...the same code from the Node.js example above
</script>
See the complete API description for more information.
Copyright (c) 2020-2022 Ferdinand Prantl Copyright (c) 2010-2019 Gregoire Lejeune
Licensed under the MIT license.
Thanks goes to these wonderful people (emoji key):
Gregoire Lejeune 💻 📖 💡 | Darius Kazemi 💻 | Sébastien ELET 💻 | Andreas Lind 💻 | Farrin Reid 💻 | Patrik Henningsson 💻 | Pooria Azimi 💻 |
Ruben Bridgewater 💻 | Mathieu Ravaux 💻 | Ferdinand Prantl 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Generates the source graph script for Graphviz.
The npm package graphviz-builder receives a total of 11,683 weekly downloads. As such, graphviz-builder popularity was classified as popular.
We found that graphviz-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.