Exporting d3 __data__ property with jsdom

Viewed 66

I am adopting the code for the brushable scatter matrix using d3 and jsdom on server side to generate the SVG.

SVG is perfectly generated.

However in the node script I am also binding data to some svg elements that is later used on the client side for mouse events interaction.

Here is (the well known) snapshot:

var cell = svg.selectAll(".cell")
    .data(cross(traits, traits))
    ...

At the end I am just saving the generated HTML to a file using

jsdom.window.document.querySelector("html").outerHTML;

which doesnt actually save __data__ property of the .cell elements.

cell data client side

Of course any method invocation that uses these values on client side fails with undefined.

On the server side on debug I can perfectly see __data__ property assigned to each of my svg elements.

debug mode server side

I am just wondering is there any way to tell jsdom to export/save even the properties stored during generation or it can be done later only on client side???

0 Answers
Related