Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
d3js to plot vector data from json file

I'm pretty new to D3 and json files so apologies if this is a somewhat elementary question. I have a dataset with four fields organized in columns, say:

Name Time Value
X t1 v1
X t2 v2
X t3 v3
Y t1 V1
Y t2 V2
Z t1 V1
Z t2 V2
Z t3 V3
Z t4 V4

As you notice, these data are basically time series of V for various names all in the same file. I want to transfer this to a json file to be read by d3 and plotted. It strikes me that the most efficient way would be if I can somehow organize it in a way where I can have members in the json file such that

Option 1 -

{name:'X',time:[t1 t2...],value:[V1 V2...]} for each name

Option 2 - Another alternative would be:

{name:'X',time:'t1',value:'v1'},{name:'X',time:'t2',value:'v2'} and so on for each name 

I'm aware that option 2 is possible but it seems a little inefficient with repeatedly storing the name. Is option 1 possible to store in json and plot using d3?

I don't seem to be able to find any examples for option 2 and how I could go about plotting data like that.

Thanks for your help!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda