Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mxCodec.decode used not work #58

Open
jakim9913 opened this issue Jul 4, 2022 · 0 comments
Open

mxCodec.decode used not work #58

jakim9913 opened this issue Jul 4, 2022 · 0 comments

Comments

@jakim9913
Copy link

hello.
I am trying to draw a graph on canvas by importing the created xml.

However, the MxCodec.decode function does not work.
The graph is not rendered or drawn.

origin code

     const xmlDoc = MxUtils.parseXml(data);
            const codec = new MxCodec(xmlDoc);
            codec.decode(xmlDoc.documentElement, this.graph.getModel());

but, Code I found on the internet

let elt = xmlDoc.documentElement.firstChild;
            let cells = [];
            while (elt != null) {
                cells.push(codec.decode(elt));
                this.graph.refresh();
                elt = elt.nextSibling;
            }
            this.graph.addCells(cells);

Both don't work.

Please tell me how to render the xml.
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant