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

195
Vistas
How to load csv data to the console using D3

I am currently learning the basics of D3, and am currently attempting to load a csv file to my console. My problem is that whenever I attempt to load the data, based on online tutorials when I run d3.csv() I should end up with an array, filled with the objects in my csv file.

However, when I inspect the console after running my code, I only see that it has logged each object individually, instead of as an array.

Currently, my html doc looks like this:

<html lang="en">
    <head>
        < meta charset="utf-8">
        < title>D3 Page Template</title>
        < script type="text/javascript" src="../d3.js"></script>
    </head>
    <body>
        <script type="text/javascript">
            d3.select("body").append("p").text("It's a paragraph!");
    </script>
    <script> d3.csv("/data/food.csv", function(data) {
            console.log(data);
        });
    </script>
    </body>
</html>

I have read and watched through numerous tutorials as to how to load this data to the console, though I cannot see what I am not implementing correctly. Intuitively, I expect that once the data is logged to the console, I should be able to call it by simply typing data into the console, or input data[1] to get the first element for example.

Can anyone please help me to understand what I have done incorrectly, and how to log the data correctly? Any insights or guidance are greatly appreciated!

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