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

viz.js

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viz.js - npm Package Compare versions

Comparing version 2.0.0-pre.1 to 2.0.0-pre.4

full.module

8

package.json
{
"name": "viz.js",
"version": "2.0.0-pre.1",
"version": "2.0.0-pre.4",
"description": "A hack to put Graphviz on the web.",

@@ -16,4 +16,4 @@ "main": "viz.js",

"viz.js",
"viz.module",
"viz-lite.module",
"full.module",
"lite.module",
"index.d.ts"

@@ -34,3 +34,2 @@ ],

"babel-cli": "^6.26.0",
"babel-plugin-add-header-comment": "^1.0.3",
"babel-plugin-add-module-exports": "^0.2.1",

@@ -41,2 +40,3 @@ "babel-plugin-transform-es2015-destructuring": "^6.23.0",

"babel-preset-env": "^1.6.1",
"bluebird": "^3.5.1",
"minimist": "^1.2.0",

@@ -43,0 +43,0 @@ "selenium-webdriver": "^2.45.1",

@@ -9,23 +9,20 @@ # Viz.js

Install with Bower:
To install with Yarn:
bower install viz.js
yarn add viz.js
Or with npm:
Or download from the [releases page](https://github.com/mdaines/viz.js/releases).
npm install viz.js
Or get it from the [releases page](https://github.com/mdaines/viz.js/releases).
### "Lite" Version
Viz.js releases include a smaller version called `viz-lite.js`. This omits Expat and the NEATO layout plugin.
## Usage
Rendering a graph as SVG:
Rendering a graph as an SVG element using a Web Worker:
var svg = Viz("digraph { a -> b; }");
let viz = new Viz({ worker: 'path/to/full.module' );
viz.renderSVGElement('digraph { a -> b; }')
.then(element => {
document.body.appendChild(element);
});
The input to `Viz()` is a graph in the [DOT language](http://www.graphviz.org/content/dot-language). The output `svg` is an SVG XML string.
The input to `renderSVGElement` is a graph in the [DOT language](http://www.graphviz.org/content/dot-language).

@@ -38,4 +35,21 @@ For more information, see the [API documentation](https://github.com/mdaines/viz.js/wiki/API).

To download the sources and build everything:
Then, install the development dependencies using Yarn:
make
yarn install
The build process for Viz.js is split into two parts: building the Graphviz and Expat dependencies, and building the "modules" and the main `viz.js` script.
make deps
make all
## Running Browser Tests
The browser tests can be run locally using Selenium WebDriver.
First, serve the project directory at http://localhost:8000. For example:
python -m SimpleHTTPServer
Then, run tests using test-browser/runner.js. For example, to run `test-browser/full.html` in Chrome:
node test-browser/runner --file full.html --browser chrome

@@ -1,4 +0,22 @@

/**
* Viz.js 2.0.0-pre.1
**/
/*
Viz.js 2.0.0-pre.4 (Graphviz 2.40.1, Expat 2.2.5, Emscripten 1.37.36)
Copyright (c) 2014-2018 Michael Daines
Licensed under MIT license
This distribution contains other software in object code form:
Graphviz
Licensed under Eclipse Public License - v 1.0
http://www.graphviz.org
Expat
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
Licensed under MIT license
http://www.libexpat.org
zlib
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
http://www.zlib.net/zlib_license.html
*/
(function (global, factory) {

@@ -148,8 +166,7 @@ if (typeof define === "function" && define.amd) {

var image = new Image();
image.addEventListener('load', function () {
resolve(image);
});
image.src = URL.createObjectURL(blob);
image.width = svgImage.width;
image.height = svgImage.height;
resolve(image);
}, mimeType, quality);

@@ -208,8 +225,7 @@ };

var image = new Image();
image.addEventListener('load', function () {
resolve(image);
});
image.src = canvas.toDataURL({ format: format, multiplier: multiplier, quality: quality });
image.width = options.width;
image.height = options.height;
resolve(image);
});

@@ -248,3 +264,3 @@ });

} else {
throw new Error('Must specify worker or render options, or include one of viz.module.js or viz-lite.module.js after viz.js.');
throw new Error('Must specify worker or render options, or include one of full.module or lite.module after viz.js.');
}

@@ -251,0 +267,0 @@ }

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