Loading multiple datasets on start up
See original GitHub issueHi there 😃
Currently following through the tutorial on vis academy. http://vis.academy/#/kepler.gl/2-load-data The tutorial is super clear and easy to follow through. However, I’m having trouble loading two sets of data in componentDidMount. This is what I have tried so far:
componentDidMount() {
// Use processCsvData helper to convert csv file into kepler.gl structure {fields, rows}
const data = Processors.processCsvData(nycTrips);
// Use processCsvData helper to convert csv file into kepler.gl structure {fields, rows}
const data_ta = Processors.processCsvData(dummydata01);
// Create dataset structure
const dataset = {
data,
info: {
// `info` property are optional, adding an `id` associate with this dataset makes it easier
// to replace it later
id: "my_data"
}
};
// Creaing a second dataset
const dataset_ta = {
data_ta,
info: {
// `info` property are optional, adding an `id` associate with this dataset makes it easier
// to replace it later
id: "data_ta"
}
};
// addDataToMap action to inject dataset into kepler.gl instance
// I'm parsing them in as an array
this.props.dispatch(addDataToMap({ datasets: [dataset,data_ta] }));
}```
Is this the right approach or am I totally on the wrong path?
Thanks in advance for your help.
@heshan0131
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Loading multiple datasets on start up · Issue #172 - GitHub
I'm importing 2 datasets in a functional component, just dropping the code exampe if it helps. import dataset_a from "data.json" import ...
Read more >Load multiple dataset at the same time - Dataiku Community
Hi, I need to load multiple dataset from my local pc to a dss project. Is there a way to load al the...
Read more >Best Practice for Loading Multiple Datasets on Same Webpage
OPTION 1. Query the entire database initially, load into however many elements are required, hide them all and only show the relevant element...
Read more >Solved: Loading multiple datasets in a single project
Solved: I need to load multiple datasets in a single project. But the project allows to load only 1 time. My requirement is...
Read more >Load a dataset - Hugging Face
Begin by creating a dataset repository and upload your data files. Now you can use the load_dataset() function to load the dataset. >>>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the way you pass in datasets to addDataToMap is correct, looking at the above code, you should add
dataset_a
to your useEffect dependencies and checkif (dataset_a, dataset_b)
I think I have managed to achieve this through change componentDidMount() function here.