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

89
Views
La declaración literal de la plantilla da como resultado la creación del elemento div "[obejct Object]" en el ejemplo d3.js

Estoy tratando de crear una leyenda de tipo de muestra en mi gráfico y siguiendo esta referencia. ( https://observablehq.com/@d3/color-legend )

Pero cuando aplico el código anterior, los resultados en html se ven así:

 <div style="display: flex; align-items: center; margin-left: ${+marginLeft}px; min-height: 33px; font: 10px sans-serif;"> <style> .${id}-item { break-inside: avoid; display: flex; align-items: center; padding-bottom: 1px; } .${id}-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - ${+swatchWidth}px - 0.5em); } .${id}-swatch { width: ${+swatchWidth}px; height: ${+swatchHeight}px; margin: 0 0.5em 0 0; } </style> <div style="width: 100%"; columns: 300px"> "[object Object], [object Object], [object Object], [object Object] " </div> </div>

Debería verse así en html:

 <div ...> <style> ... </style> <div style="width: 100%; columns: 300px"> <div class="-swatches-99bef5aa19961-swatch" style="background: rgb(31, 119, 180);"></div> <div class="-swatches-99bef5aa19961-label" title="title1">title1</div> </div>

Sin embargo, supongo que la cláusula sobre el retorno dentro de la declaración literal de la plantilla, ni siquiera sé cuál es el problema real y cómo resolverlo.

¿Alguien puede ayudar a resolver esto?

about 4 years ago · Santiago Gelvez
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!