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

292
Vistas
Is there a way to store a csv file in a variable using vue and d3?

I want to store a CSV file in a variable, which I can use later. Currently, I am using Vue and d3 to do this

let app = Vue.createApp({
            data: function(){
                return{   
          loaddata: {} 
            }
        },
methods:{
    async greet(){
        let data = await d3.csv("a.csv",function(data){d3.select("#output").html(data.map(function(d){return d.c;}));
});
    this.loaddata=data,
    console.log(this.loaddata)
    },
    greet2(){
      for (const {c,b} in this.loaddata){
        console.log(c,b);
      }
    }

    }
})
app.mount('#app') 
  
</script>

greet is just a method that activates when I click enter in my frontend. So basically my end goal is to get variable (array) that I can use with loops to display the CSV in the frontend. If there is another way to load and store a csv file in a variable (array), I will be very grateful if you could let me know that.

I tried searching a lot but couldn't find a solution, I apologize if this is a noob question, I am very new to javascript.

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