Skip to content

Commit

Permalink
update to d3-graphviz@5, d3-selection@3 and d3-transition@3 and adapt…
Browse files Browse the repository at this point in the history
… to new @hpcc-js/wasm@2 interface

Run 'npm install --legacy-peer-deps d3-graphviz@5 d3-selection@3
d3-transition@3' and adapt to new @hpcc-js/wasm v2 interface.
  • Loading branch information
magjac committed Dec 26, 2023
1 parent 48634b8 commit 8207764
Show file tree
Hide file tree
Showing 10 changed files with 21,913 additions and 32,934 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
* Updated [Graphviz](https://graphviz.org/) from version [2.50.0](https://gitlab.com/graphviz/graphviz/-/blob/main/CHANGELOG.md?ref_type=heads#2500-2021-12-04) to version [9.0.0](https://gitlab.com/graphviz/graphviz/-/blob/main/CHANGELOG.md?ref_type=heads#900-2023-09-11) through [@hpcc-js/wasm](https://github.com/hpcc-systems/hpcc-js-wasm) version [2.14.1](https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/CHANGELOG.md#2141-2023-10-12), containing a lot of improvements and fixes, including a fix for:
* Failure of arrowhead and arrowtail to respect penwidth ([Graphviz issue #372](https://gitlab.com/graphviz/graphviz/issues/372))

### Fixed
* Lost characters when typing fast and DOT parsing errors occur #236
* New nodes created after linking nodes with a space in the label #215 (thanks @ygra)
Expand Down
5 changes: 3 additions & 2 deletions bin/generate-graphviz-version.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#! /usr/bin/env node

import hpccWasm from "@hpcc-js/wasm";
import { Graphviz } from "@hpcc-js/wasm/graphviz";

const graphvizVersion = await hpccWasm.graphvizVersion();
const graphviz = await Graphviz.load();
const graphvizVersion = graphviz.version();

console.log(`const graphvizVersion = "${graphvizVersion}";`);
console.log('export {graphvizVersion};');
8 changes: 5 additions & 3 deletions bin/generate-nodes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#! /usr/bin/env node

import { graphviz } from "@hpcc-js/wasm";
import { Graphviz } from "@hpcc-js/wasm/graphviz";

const graphviz = await Graphviz.load();

const shapes = [
"box",
Expand Down Expand Up @@ -82,7 +84,7 @@ for (let i = 0; i < shapes.length; i++) {
${shape} [shape=${shape} style=filled label=""]
}`;

var svg = await graphviz.layout(dotSrc, 'svg', 'dot');
var svg = graphviz.layout(dotSrc, 'svg', 'dot');

console.log(`${shape}: \`${svg}\`,`);
}
Expand All @@ -91,7 +93,7 @@ const dotSrc = `digraph "" {
"(default)" [style="filled, dashed" fillcolor="white" label=""]
}`;

var svg = await graphviz.layout(dotSrc, 'svg' , 'dot');
var svg = graphviz.layout(dotSrc, 'svg' , 'dot');

console.log(`'(default)': \`${svg}\`,`);

Expand Down
Loading

0 comments on commit 8207764

Please sign in to comment.