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

291
Views
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
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!