Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5 HANDLING DATA-LOADING ERRORS #46

Open
zlw8844 opened this issue Sep 1, 2020 · 6 comments
Open

Chapter 5 HANDLING DATA-LOADING ERRORS #46

zlw8844 opened this issue Sep 1, 2020 · 6 comments
Labels

Comments

@zlw8844
Copy link

zlw8844 commented Sep 1, 2020

Regarding global variable dataset, I found I had to define var dataset = [], and use dataset.push(data). If I did the same as the book, the dataset can only have the last element in the imported csv file.

@scotthmurray
Copy link
Owner

@zlw8844 Thanks! Which specific example are you referring to? It would be helpful to have the filename (like chapter_01/00_example.html) as well as the book page number that refers to it.

@zlw8844
Copy link
Author

zlw8844 commented Sep 2, 2020

@zlw8844 Thanks! Which specific example are you referring to? It would be helpful to have the filename (like chapter_01/00_example.html) as well as the book page number that refers to it.

I am reading the online version, and there is no page number. It is in chapter 5, section 'HANDLING DATA-LOADING ERRORS'. A snapshot of the code is as follows. I need to use an array for dataset, and push new data into it in order to save all input data into dataset. I guess it was caused by the version of D3 used?
image

@scotthmurray
Copy link
Owner

Thanks. Where are you finding the online version? Please share a URL.

I suspect you may be referencing an older version of the text.

@zlw8844
Copy link
Author

zlw8844 commented Sep 4, 2020 via email

@scotthmurray
Copy link
Owner

Ah thanks.

Yes, that was my silly example. You don't have to push data into the array the way I did, but you do have to use an array.

Which version of D3 are you using with the example code? (The examples are only guaranteed with work with D3 v4.5.0, as included in this repo. If you are using v5.0 or newer, then yes, the way the CSV method works has changed, so that probably is breaking here.)

@CWMo
Copy link

CWMo commented May 7, 2022

I look forward to seeing the updates on your new book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants