@@ -29,6 +29,9 @@ Built with:
2929- [ Zstandard (zstd)] ( #zstandard )
3030 - [ Hello World] ( #zstandard-hello-world )
3131 - [ API] ( #zstandard-api )
32+ - [ Base91] ( #base91 )
33+ - [ Hello World] ( #base91-hello-world )
34+ - [ API] ( #base91-api )
3235- [ Utilities] ( #utility )
3336- [ Building @hpcc-js/wasm ] ( #building-hpcc-js-wasm )
3437
@@ -108,7 +111,7 @@ GraphViz WASM library, see [graphviz.org](https://www.graphviz.org/) for c++ det
108111
109112To call ` dot-wasm ` without installing:
110113```
111- npx @hpcc-js/wasm [options] fileOrDot
114+ npx -p @hpcc-js/wasm dot- wasm [options] fileOrDot
112115```
113116
114117To install the global command ` dot-wasm ` via NPM:
@@ -121,38 +124,35 @@ Usage:
121124Usage: dot-wasm [options] fileOrDot
122125
123126Options:
124- --version Show version number [boolean]
125- -K, --layout Set layout engine (circo | dot | fdp | sfdp | neato | osage
126- | patchwork | twopi). By default, dot is used.
127- -T, --format Set output language to one of the supported formats (svg,
128- dot, json, dot_json, xdot_json, plain, plain-ext). By
129- default, svg is produced .
127+ --version Show version number [boolean]
128+ -K, --layout Set layout engine (circo | dot | fdp | sfdp | neato | osage | patchwo
129+ rk | twopi). By default, dot is used.
130+ -T, --format Set output language to one of the supported formats (svg | dot | json
131+ | dot_json | xdot_json | plain | plain-ext). By default, svg is prod
132+ uced .
130133 -n, --neato-no-op Sets no-op flag in neato.
131- "-n 1" assumes neato nodes have already been positioned and
132- all nodes have a pos attribute giving the positions. It
133- then performs an optional adjustment to remove node-node
134- overlap, depending on the value of the overlap attribute,
135- computes the edge layouts, depending on the value of the
136- splines attribute, and emits the graph in the appropriate
137- format.
138- "-n 2" Use node positions as specified, with no adjustment
139- to remove node-node overlaps, and use any edge layouts
140- already specified by the pos attribute. neato computes an
141- edge layout for any edge that does not have a pos
142- attribute. As usual, edge layout is guided by the splines
143- attribute.
144- -y, --invert-y By default, the coordinate system used in generic output
145- formats, such as attributed dot, extended dot, plain and
146- plain-ext, is the standard cartesian system with the origin
147- in the lower left corner, and with increasing y coordinates
148- as points move from bottom to top. If the -y flag is used,
149- the coordinate system is inverted, so that increasing
150- values of y correspond to movement from top to bottom.
151- -h, --help Show help [boolean]
134+ "-n 1" assumes neato nodes have already bee
135+ n positioned and all nodes have a pos attribute giving the positions.
136+ It then performs an optional adjustment to remove node-node overlap,
137+ depending on the value of the overlap attribute, computes the edge l
138+ ayouts, depending on the value of the splines attribute, and emits th
139+ e graph in the appropriate format.
140+ "-n 2" Use node positions as speci
141+ fied, with no adjustment to remove node-node overlaps, and use any ed
142+ ge layouts already specified by the pos attribute. neato computes an
143+ edge layout for any edge that does not have a pos attribute. As usual
144+ , edge layout is guided by the splines attribute.
145+ -y, --invert-y By default, the coordinate system used in generic output formats, suc
146+ h as attributed dot, extended dot, plain and plain-ext, is the standa
147+ rd cartesian system with the origin in the lower left corner, and wit
148+ h increasing y coordinates as points move from bottom to top. If the
149+ -y flag is used, the coordinate system is inverted, so that increasin
150+ g values of y correspond to movement from top to bottom.
151+ -v Echo GraphViz library version
152+ -h, --help Show help [boolean]
152153
153154Examples:
154- dot-wasm -K neato -T xdot ./input.dot Execute NEATO layout and outputs XDOT
155- format.
155+ dot-wasm -K neato -T xdot ./input.dot Execute NEATO layout and outputs XDOT format.
156156```
157157
158158### GraphViz Hello World
@@ -515,6 +515,114 @@ A note on compressionLevel: The library supports regular compression levels fro
515515
516516---
517517
518+ ## Base91
519+ _ Similar to Base 64, but uses more characters resulting in smaller strings._
520+ Base 91 WASM library, similar to Base 64 but uses more characters resulting in smaller strings, see [ Base91] ( https://base91.sourceforge.net/ ) for more details.
521+ ### Base91 Hello World
522+ ``` html
523+ <!DOCTYPE html>
524+ <html >
525+ <head >
526+ <meta charset =" UTF-8" >
527+ <title >Base91 WASM</title >
528+ </head >
529+ <body >
530+ <div id =" placeholder" ></div >
531+ <script type =" module" >
532+ import { Base91 } from " ./dist/index.es6.js" ;
533+ // import { Base91 } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.es6.js";
534+ const base91 = await Base91 .load ();
535+ const data = new Uint8Array (Array .from ({ length: 100 }, (_ , i ) => Math .random () * 100 ));
536+ const encoded_data = await base91 .encode (data);
537+ const decoded_data = await base91 .decode (encoded_data);
538+ document .getElementById (" placeholder" ).innerHTML = ` \
539+ <ul >
540+ <li >Data Size (bytes): ${ data .byteLength } </li >
541+ <li >Endoded Size (bytes): ${ encoded_data .length } </li >
542+ <li >Decoded Size (bytes): ${ decoded_data .byteLength } </li >
543+ </ul >
544+ <h4 >Data: </h4 >
545+ <code >
546+ ${ data}
547+ </code >
548+ <h4 >Base 91: </h4 >
549+ <code id =" base91" >
550+ </code >
551+ <h4 >Decoded: </h4 >
552+ <code >
553+ ${ decoded_data}
554+ </code >
555+ ` ;
556+ document .getElementById (" base91" ).innerText = encoded_data;
557+ </script >
558+ </body >
559+ </html >
560+ ```
561+
562+ ### Base91 API
563+
564+ #### Interfaces
565+
566+ <a name =" Options " href =" #Base91Options " >#</a > ** Options** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
567+
568+ Options structure for advanced loading.
569+
570+ ``` typescript
571+ interface Options {
572+ wasmFolder? : string ;
573+ wasmBinary? : ArrayBuffer ;
574+ }
575+ ```
576+
577+ * _ wasmFolder_ : An optional ` string ` specifying the location of wasm file.
578+ * _ wasmBinary_ : An optional "pre-fetched" copy of the wasm binary as returned from ` XHR ` or ` fetch ` .
579+
580+ <a name =" Base91 " href =" #Base91 " >#</a > ** Base91** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
581+
582+ Conceptual interface for TypeScript/JavaScript wrapper API
583+
584+ ``` typescript
585+ interface Base91 {
586+ static load(options ? : Options ): Promise <Base91 >;
587+ version(): string ;
588+
589+ encode(data : Uint8Array ): string ;
590+ decode(array : string ): Uint8Array ;
591+ }
592+ ```
593+
594+ <a name =" base91Load " href =" #base91Load " >#</a > ** Base91.load** (_ options_ ?: ** Options** ): ** Promise\< Base91\> ** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
595+
596+ Loads and initializes the Base91 wasm library, returns a Promise to ` Base91 ` :
597+ ``` typescript
598+ const base91 = await Base91 .load ();
599+ ... dostuff ...
600+ ```
601+ or
602+ ``` typescript
603+ Base91 .load ().then (base91 => {... dostuff ... });
604+ ```
605+
606+ <a name =" base91Version " href =" #base91Version " >#</a > ** base91.version** (): ** string** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
607+
608+ * ** _ returns_ ** : The Base91 library Version.
609+
610+ <a name =" base91Encode " href =" #base91Encode " >#</a > ** base91.encode** (_ data_ : ** Uint8Array** ): ** string** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
611+
612+ * ** _ data_ ** : Raw data to encode.
613+ * ** _ returns_ ** : Encoded string.
614+
615+ Encodes the raw data.
616+
617+ <a name =" base91Decode " href =" #base91Decode " >#</a > ** base91.decode** (_ str_ : ** string** ): ** Uint8Array** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
618+
619+ * ** _ str_ ** : String to decode.
620+ * ** _ returns_ ** : Decoded data.
621+
622+ Decodes the raw data.
623+
624+ ---
625+
518626## Utility
519627
520628Utility functions unrelated to any specific wasm APIs
0 commit comments