Skip to content

Commit

Permalink
feat(graphviz): Add additional convenience methods
Browse files Browse the repository at this point in the history
Add unit tests
Add travis-ci integration

Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jun 16, 2019
1 parent c0f8d9a commit dda20f4
Show file tree
Hide file tree
Showing 16 changed files with 4,210 additions and 187 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ lib-*/
node_modules/
types/
*.tsbuildinfo
.nyc_output/
coverage/
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dist: xenial
language: node_js
node_js:
- '10'
addons:
chrome: stable
cache:
directories:
- "$HOME/.npm"
- "$HOME/.emscripten_cache/asmjs"
install:
- npm ci
before_script:
- npm run lint;
- npm run build;
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
"--disable-web-security"
],
"webRoot": "${workspaceRoot}"
},
{
"name": "test-chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8000/test.html",
"webRoot": "${workspaceRoot}",
"sourceMapPathOverrides": {
"webpack:///./*": "${workspaceRoot}/*",
"webpack:///*": "/*"
}
}
]
}
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# @hpcc-js/wasm
This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Node / Web Browsers / JavaScript Libraries.

[![Build Status](https://travis-ci.org/hpcc-systems/hpcc-js-wasm.svg?branch=master)](https://travis-ci.org/hpcc-systems/hpcc-js-wasm)
[![Coverage Status](https://coveralls.io/repos/github/hpcc-systems/hpcc-js-wasm/badge.svg?branch=master)](https://coveralls.io/github/hpcc-systems/hpcc-js-wasm?branch=master)

This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Web Browsers and JavaScript Libraries.

## Installation
The simplest way to include this project is via NPM:
Expand Down Expand Up @@ -38,7 +42,7 @@ If _url_ is specified, sets the default location for all WASM files. If _url_ i

Global variable for setting default WASM location, this is an alternative to [wasmFolder](#wasmFolder)

### GraphViz
### GraphViz (namespace `graphviz`)
GraphViz WASM library, see [graphviz.org](https://www.graphviz.org/) for c++ details.

**Note**: While this package is similar to [Viz.js](https://github.com/mdaines/viz.js), it employs a completely different build methodology taken from [GraphControl](https://github.com/hpcc-systems/GraphControl).
Expand Down Expand Up @@ -69,6 +73,35 @@ _layoutEngine_ supports the following options:

See [Layout manual pages](https://www.graphviz.org/documentation/) for more information.

<a name="circo" href="#circo">#</a> <b>circo</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "circo");`

<a name="dot" href="#dot">#</a> <b>dot</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **dot** layout, is equivalent to `layout(dotSource, outputFormat, "dot");`

<a name="fdp" href="#fdp">#</a> <b>fdp</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "fdp");`

<a name="neato" href="#neato">#</a> <b>neato</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **neato** layout, is equivalent to `layout(dotSource, outputFormat, "neato");`

<a name="osage" href="#osage">#</a> <b>osage</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **osage** layout, is equivalent to `layout(dotSource, outputFormat, "osage");`

<a name="patchwork" href="#patchwork">#</a> <b>patchwork</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **patchwork** layout, is equivalent to `layout(dotSource, outputFormat, "patchwork");`

<a name="twopi" href="#twopi">#</a> <b>twopi</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts)

Convenience function that performs **twopi** layout, is equivalent to `layout(dotSource, outputFormat, "twopi");`


## Quick Example (CDN hosting courtesy of [unpkg.com](https://unpkg.com))
```html
<!DOCTYPE html>
Expand Down
33 changes: 33 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = function (config) {
config.set({
frameworks: ['mocha', 'chai'],
files: [
'dist/index.js',
{ pattern: 'dist/*.wasm', watched: false, included: false, served: true },
{ pattern: 'dist/*.map', watched: false, included: false, served: true },
'test/**/*.js'
],
exclude: [
],
preprocessors: {
'dist/index.js': 'coverage'
},
reporters: ['coverage', 'coveralls'],
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: ['Chrome'], //, 'Firefox', 'FirefoxDeveloper', 'FirefoxNightly', 'IE'],
autoWatch: true,
concurrency: Infinity,
coverageReporter: {
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
dir: 'coverage/'
},
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless'],
}
}
})
}
Loading

0 comments on commit dda20f4

Please sign in to comment.