Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
Exporting d3 __data__ property with jsdom

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???

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!