@hpcc-js/wasm 1.12.8 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
  ![Test PR](https://github.com/hpcc-systems/hpcc-js-wasm/workflows/Test%20PR/badge.svg)
4
4
 
5
5
  This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Node JS, Web Browsers and JavaScript Libraries:
6
- * [graphviz](https://www.graphviz.org/) - v2.50.0
7
- * [expat](https://libexpat.github.io/) - v2.4.1
6
+ * [graphviz](https://www.graphviz.org/) - v3.0.0
7
+ * [expat](https://libexpat.github.io/) - v2.4.6
8
8
 
9
9
  Built with:
10
- * [emsdk](https://github.com/emscripten-core/emsdk) - v3.0.0
10
+ * [emsdk](https://github.com/emscripten-core/emsdk) - v3.1.6
11
11
 
12
12
  ## Quick GraphViz Demos
13
13
  * https://raw.githack.com/hpcc-systems/hpcc-js-wasm/trunk/index.html
@@ -35,13 +35,34 @@ npm install --global @hpcc-js/wasm
35
35
  Usage: dot-wasm [options] fileOrDot
36
36
 
37
37
  Options:
38
- --version Show version number [boolean]
39
- -K, --layout Set layout engine (circo | dot | fdp | sfdp | neato | osage |
40
- patchwork | twopi). By default, dot is used.
41
- -T, --format Set output language to one of the supported formats (svg, dot,
42
- json, dot_json, xdot_json, plain, plain-ext). By default, svg
43
- is produced.
44
- -h, --help Show help [boolean]
38
+ --version Show version number [boolean]
39
+ -K, --layout Set layout engine (circo | dot | fdp | sfdp | neato | osage
40
+ | patchwork | twopi). By default, dot is used.
41
+ -T, --format Set output language to one of the supported formats (svg,
42
+ dot, json, dot_json, xdot_json, plain, plain-ext). By
43
+ default, svg is produced.
44
+ -n, --neato-no-op Sets no-op flag in neato.
45
+ "-n 1" assumes neato nodes have already been positioned and
46
+ all nodes have a pos attribute giving the positions. It
47
+ then performs an optional adjustment to remove node-node
48
+ overlap, depending on the value of the overlap attribute,
49
+ computes the edge layouts, depending on the value of the
50
+ splines attribute, and emits the graph in the appropriate
51
+ format.
52
+ "-n 2" Use node positions as specified, with no adjustment
53
+ to remove node-node overlaps, and use any edge layouts
54
+ already specified by the pos attribute. neato computes an
55
+ edge layout for any edge that does not have a pos
56
+ attribute. As usual, edge layout is guided by the splines
57
+ attribute.
58
+ -y, --invert-y By default, the coordinate system used in generic output
59
+ formats, such as attributed dot, extended dot, plain and
60
+ plain-ext, is the standard cartesian system with the origin
61
+ in the lower left corner, and with increasing y coordinates
62
+ as points move from bottom to top. If the -y flag is used,
63
+ the coordinate system is inverted, so that increasing
64
+ values of y correspond to movement from top to bottom.
65
+ -h, --help Show help [boolean]
45
66
 
46
67
  Examples:
47
68
  dot-wasm -K neato -T xdot ./input.dot Execute NEATO layout and outputs XDOT
package/bin/cli.js CHANGED
@@ -15,6 +15,12 @@ const yargs = require("yargs/yargs")(process.argv.slice(2))
15
15
  .alias("T", "format")
16
16
  .nargs("T", 1)
17
17
  .describe("T", "Set output language to one of the supported formats (svg, dot, json, dot_json, xdot_json, plain, plain-ext). By default, svg is produced.")
18
+ .alias("n", "neato-no-op")
19
+ .nargs("n", 1)
20
+ .describe("n", "Sets no-op flag in neato.\n\"-n 1\" assumes neato nodes have already been positioned and all nodes have a pos attribute giving the positions. It then performs an optional adjustment to remove node-node overlap, depending on the value of the overlap attribute, computes the edge layouts, depending on the value of the splines attribute, and emits the graph in the appropriate format.\n\"-n 2\" Use node positions as specified, with no adjustment to remove node-node overlaps, and use any edge layouts already specified by the pos attribute. neato computes an edge layout for any edge that does not have a pos attribute. As usual, edge layout is guided by the splines attribute.")
21
+ .alias("y", "invert-y")
22
+ .nargs("y", 0)
23
+ .describe("y", "By default, the coordinate system used in generic output formats, such as attributed dot, extended dot, plain and plain-ext, is the standard cartesian system with the origin in the lower left corner, and with increasing y coordinates as points move from bottom to top. If the -y flag is used, the coordinate system is inverted, so that increasing values of y correspond to movement from top to bottom.")
18
24
  .help("h")
19
25
  .alias("h", "help")
20
26
  .epilog("https://github.com/hpcc-systems/hpcc-js-wasm")
@@ -29,7 +35,21 @@ try {
29
35
  } else {
30
36
  dot = argv._[0];
31
37
  }
32
- gvMod.graphviz.layout(dot, argv.format ?? "svg", argv.layout ?? "dot").then(response => {
38
+
39
+ if (argv.n && argv.layout.trim() !== "neato") {
40
+ throw new Error("-n option is only supported with -T neato");
41
+ }
42
+
43
+ const ext = {
44
+ };
45
+ if (argv.n) {
46
+ ext.nop = parseInt(argv.n);
47
+ }
48
+ if (argv.y) {
49
+ ext.yInvert = true;
50
+ }
51
+
52
+ gvMod.graphviz.layout(dot, argv.format?.trim() ?? "svg", argv.layout?.trim() ?? "dot", ext).then(response => {
33
53
  console.log(response);
34
54
  }).catch(e => {
35
55
  console.error(e.message);