Comparing version 1.7.1 to 1.8.0
{ | ||
"name": "viz.js", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "A hack to put Graphviz on the web.", | ||
@@ -15,4 +15,10 @@ "main": "viz.js", | ||
"files": [ | ||
"viz.js" | ||
"viz.js", | ||
"viz-lite.js" | ||
], | ||
"browser": { | ||
"fs": false, | ||
"path": false, | ||
"crypto": false | ||
}, | ||
"author": "Mike Daines <mdaines@fastmail.com>", | ||
@@ -19,0 +25,0 @@ "license": "MIT", |
@@ -27,3 +27,3 @@ # Viz.js | ||
### Viz(src, options={ format="svg", engine="dot", scale, totalMemory=16777216 }) | ||
### Viz(src, options={ format="svg", engine="dot", scale, images=[{ path, width, height }], totalMemory=16777216 }) | ||
@@ -35,5 +35,6 @@ - `src` is a string representing the graph to render in the [DOT language](http://www.graphviz.org/content/dot-language). | ||
- `scale` sets the scale factor for the `"png-image-element"` format. If this is not specified, `window.devicePixelRatio` will be used if available, and `1` if not. | ||
- `images` specifies image dimensions to use when rendering nodes with `image` attributes. This is an array of objects, `{ href, width, height }`. `href` may be a filename (`"example.png"`), a relative or absolute path (`"/images/example.png"`), or a URL (`"http://example.com/image.png"`). Dimensions may be specified with units: in, px, pc, pt, cm, or mm. If no units are given or dimensions are given as numbers, points (pt) are used. Graphviz does not actually load image data when this option is used — images are referenced with the dimensions given, eg, in SVG by an `<image>` element with `width` and `height` attributes. | ||
- `totalMemory` sets the total memory available for the Emscripten module instance. This should be a power of 2. The default of 16MB should be sufficient for most cases — only consider using a larger number if you run into the error "Cannot enlarge memory arrays". | ||
Parses `src` and renders a graph according to the `options` given. Output is a string, except when using the "png-image-element" format, when it is returned as an instance of HTMLImageElement. | ||
Parses `src` and renders a graph according to the `options` given. Output is a string, except when using the "png-image-element" format, when it is an instance of HTMLImageElement. | ||
@@ -46,2 +47,3 @@ For example: | ||
result = Viz("digraph { x -> y -> z; }", { format: "plain" }); | ||
result = Viz("digraph { a[image=\"test.png\"]; }", { images: [ { path: "test.png", width: "400px", height: "300px" } ] }); | ||
@@ -48,0 +50,0 @@ If Graphviz encounters an error, Viz will throw an `Error` object with the error message. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4097664
5
16120
104