@@ -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,122 @@ 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+
521+ 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.
522+
523+ ### Base91 Hello World
524+
525+ ``` html
526+ <!DOCTYPE html>
527+ <html >
528+
529+ <head >
530+ <meta charset =" UTF-8" >
531+ <title >Base91 WASM</title >
532+ </head >
533+
534+ <body >
535+ <div id =" placeholder" ></div >
536+ <script type =" module" >
537+ import { Base91 } from " ./dist/index.es6.js" ;
538+ // import { Base91 } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.es6.js";
539+
540+ const base91 = await Base91 .load ();
541+ const data = new Uint8Array (Array .from ({ length: 100 }, (_ , i ) => Math .random () * 100 ));
542+ const encoded_data = await base91 .encode (data);
543+ const decoded_data = await base91 .decode (encoded_data);
544+ document .getElementById (" placeholder" ).innerHTML = ` \
545+ <ul >
546+ <li >Data Size (bytes): ${ data .byteLength } </li >
547+ <li >Endoded Size (bytes): ${ encoded_data .length } </li >
548+ <li >Decoded Size (bytes): ${ decoded_data .byteLength } </li >
549+ </ul >
550+ <h4 >Data: </h4 >
551+ <code >
552+ ${ data}
553+ </code >
554+ <h4 >Base 91: </h4 >
555+ <code id =" base91" >
556+ </code >
557+ <h4 >Decoded: </h4 >
558+ <code >
559+ ${ decoded_data}
560+ </code >
561+ ` ;
562+ document .getElementById (" base91" ).innerText = encoded_data;
563+ </script >
564+
565+ </body >
566+
567+ </html >
568+ ```
569+
570+ ### Base91 API
571+
572+ #### Interfaces
573+
574+ <a name =" Options " href =" #Base91Options " >#</a > ** Options** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
575+
576+ Options structure for advanced loading.
577+
578+ ``` typescript
579+ interface Options {
580+ wasmFolder? : string ;
581+ wasmBinary? : ArrayBuffer ;
582+ }
583+ ```
584+
585+ * _ wasmFolder_ : An optional ` string ` specifying the location of wasm file.
586+ * _ wasmBinary_ : An optional "pre-fetched" copy of the wasm binary as returned from ` XHR ` or ` fetch ` .
587+
588+ <a name =" Base91 " href =" #Base91 " >#</a > ** Base91** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
589+
590+ Conceptual interface for TypeScript/JavaScript wrapper API
591+
592+ ``` typescript
593+ interface Base91 {
594+ static load(options ? : Options ): Promise <Base91 >;
595+ version(): string ;
596+
597+ encode(data : Uint8Array ): string ;
598+ decode(array : string ): Uint8Array ;
599+ }
600+ ```
601+
602+ <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 ")
603+
604+ Loads and initializes the Base91 wasm library, returns a Promise to ` Base91 ` :
605+ ``` typescript
606+ const base91 = await Base91 .load ();
607+ ... dostuff ...
608+ ```
609+ or
610+ ``` typescript
611+ Base91 .load ().then (base91 => {... dostuff ... });
612+ ```
613+
614+ <a name =" base91Version " href =" #base91Version " >#</a > ** base91.version** (): ** string** · [ <>] ( https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/src/base91.ts " Source ")
615+
616+ * ** _ returns_ ** : The Base91 library Version.
617+
618+ <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 ")
619+
620+ * ** _ data_ ** : Raw data to encode.
621+ * ** _ returns_ ** : Encoded string.
622+
623+ Encodes the raw data.
624+
625+ <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 ")
626+
627+ * ** _ str_ ** : String to decode.
628+ * ** _ returns_ ** : Decoded data.
629+
630+ Decodes the raw data.
631+
632+ ---
633+
518634## Utility
519635
520636Utility functions unrelated to any specific wasm APIs
0 commit comments