-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update documentation and links
Signed-off-by: Gordon Smith <[email protected]>
- Loading branch information
1 parent
a84bb3e
commit b4911fd
Showing
20 changed files
with
117 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
# @hpcc-js/wasm-graphviz | ||
# @hpcc-js/wasm-base91 | ||
|
||
This package provides a WebAssembly wrapper around the [Graphviz](https://www.graphviz.org/) library. This allows for the rendering of DOT language graphs directly within a browser or NodeJS type environment. | ||
This package provides a WebAssembly wrapper around the [Base91](https://base91.sourceforge.net/) library. This allows for the encoding and decoding of binary data to a more compact form than Base64. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @hpcc-js/wasm-graphviz | ||
npm install @hpcc-js/wasm-base91 | ||
``` | ||
|
||
## Usage | ||
## Quick Start | ||
|
||
```typescript | ||
import { Graphviz } from "@hpcc-js/wasm-graphviz"; | ||
import { Base91 } from "@hpcc-js/wasm-base91"; | ||
|
||
const graphviz = await Graphviz.load(); | ||
const svg = graphviz.dot(`digraph { a -> b; }`); | ||
document.body.innerHTML = svg; | ||
const base91 = await Base91.load(); | ||
|
||
const encoded_data = await base91.encode(data); | ||
const decoded_data = await base91.decode(encoded_data); | ||
``` | ||
|
||
## Reference | ||
|
||
* [API Documentation](https://hpcc-systems.github.io/hpcc-js-wasm/base91/src/base91/classes/Base91.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
# @hpcc-js/wasm-graphviz | ||
# @hpcc-js/wasm-duckdb | ||
|
||
This package provides a WebAssembly wrapper around the [Graphviz](https://www.graphviz.org/) library. This allows for the rendering of DOT language graphs directly within a browser or NodeJS type environment. | ||
This package rewraps the DuckDB webassembly distribution provided by DuckDB, this is purly a convenience to provide a consistent loading experience with the rest of the @hpcc-js.wasm library. | ||
See [DuckDB](https://github.com/duckdb/duckdb) and [DuckDB-wasm](https://github.com/duckdb/duckdb-wasm) for more details. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @hpcc-js/wasm-graphviz | ||
npm install @hpcc-js/wasm-duckdb | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { Graphviz } from "@hpcc-js/wasm-graphviz"; | ||
import { DuckDB } from "@hpcc-js/wasm-duckdb"; | ||
|
||
const graphviz = await Graphviz.load(); | ||
const svg = graphviz.dot(`digraph { a -> b; }`); | ||
document.body.innerHTML = svg; | ||
let duckdb = await DuckDB.load(); | ||
const c = await duckdb.db.connect(); | ||
|
||
const data = [ | ||
{ "col1": 1, "col2": "foo" }, | ||
{ "col1": 2, "col2": "bar" }, | ||
]; | ||
await duckdb.db.registerFileText("rows.json", JSON.stringify(data)); | ||
await c.insertJSONFromPath('rows.json', { name: 'rows' }); | ||
|
||
const arrowResult = await c.query("SELECT * FROM read_json_auto('rows.json')"); | ||
const result = arrowResult.toArray().map((row) => row.toJSON()); | ||
expect(result.length).to.equal(data.length); | ||
for (let i = 0; i < result.length; i++) { | ||
expect(result[i].col2).to.equal(data[i].col2); | ||
} | ||
|
||
c.close(); | ||
``` | ||
|
||
## Reference | ||
|
||
* [API Documentation](https://hpcc-systems.github.io/hpcc-js-wasm/duckdb/src/duckdb/classes/DuckDB.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
# @hpcc-js/wasm-graphviz | ||
# @hpcc-js/wasm-expat | ||
|
||
This package provides a WebAssembly wrapper around the [Graphviz](https://www.graphviz.org/) library. This allows for the rendering of DOT language graphs directly within a browser or NodeJS type environment. | ||
This package provides a WebAssembly wrapper around the [libexpat](https://libexpat.github.io/) library. This provides efficent SAX XML parsing. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @hpcc-js/wasm-graphviz | ||
npm install @hpcc-js/wasm-expat | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { Graphviz } from "@hpcc-js/wasm-graphviz"; | ||
import { Expat } from "@hpcc-js/wasm-expat"; | ||
|
||
const graphviz = await Graphviz.load(); | ||
const svg = graphviz.dot(`digraph { a -> b; }`); | ||
document.body.innerHTML = svg; | ||
const expat = await Expat.load(); | ||
|
||
const xml = ` \ | ||
<root> | ||
<child xxx="yyy">content</child> | ||
</root> | ||
`; | ||
|
||
const callback = { | ||
startElement(tag, attrs) { console.log("start", tag, attrs); }, | ||
endElement(tag) { console.log("end", tag); }, | ||
characterData(content) { console.log("characterData", content); } | ||
}; | ||
|
||
expat.parse(xml, callback); | ||
``` | ||
|
||
## Reference | ||
|
||
* [API Documentation](https://hpcc-systems.github.io/hpcc-js-wasm/expat/src/expat/classes/Expat.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.