Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

106
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda