hpcc-systems / hpcc-js-wasm

HPCC-Systems Web-Assembly (JavaScript)
https://hpcc-systems.github.io/hpcc-js-wasm/
Apache License 2.0
321 stars 23 forks source link

hpcc-js/wasm@2.19.0 / GraphViz 12.1.0 tables don't work; They do in hpcc-js/wasm@2.18.2 #251

Closed azriel91 closed 2 months ago

azriel91 commented 2 months ago

Heya,

[!NOTE] edit: This corresponds to: graphviz/graphviz#2590

When I use hpcc-js/wasm@2.19.0, with the following node:

my_node [
    label = <<table>
        <tr>
            <td>cell 1</td>
            <td>cell 2</td>
        </tr>
    </table>>
]

The following is rendered:

image

With hpcc-js/wasm@2.18.2, I get:

image

This may be a GraphViz 12.1.0 issue, but the changelog was big so I didn't investigate further.


The full html file to reproduce this is:

<!DOCTYPE html>
<html>
<body>
    <div id="1">1</div>
    <script type="module">

const dot_sample_img=`digraph G {
    my_node [
        label = <<table>
            <tr>
                <td>cell 1</td>
                <td>cell 2</td>
            </tr>
        </table>>
    ]
}`;

import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm@2.18.2/dist/index.js";
const graphviz = await Graphviz.load();
layout(dot_sample_img, "1");

function layout(dot, domId) {
    document.getElementById(domId).innerHTML = graphviz.dot(dot, "svg");
}
</script>
</body>
</html>

Luckily my presentation is next week, not today.

azriel91 commented 2 months ago

This has been resolved in 2.20.0.