d3-book icon indicating copy to clipboard operation
d3-book copied to clipboard

Chapter 5 HANDLING DATA-LOADING ERRORS

Open zlw8844 opened this issue 4 years ago • 6 comments

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.

zlw8844 avatar Sep 01 '20 18:09 zlw8844

@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.

scotthmurray avatar Sep 01 '20 19:09 scotthmurray

@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

zlw8844 avatar Sep 02 '20 02:09 zlw8844

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

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

scotthmurray avatar Sep 03 '20 20:09 scotthmurray

I read the 2nd edition through O'reilly. The link is as follows: https://learning.oreilly.com/library/view/interactive-data-visualization/9781491921296/ Regards, Lingwei "Eric" Zhan

On Thu, Sep 3, 2020 at 4:22 PM Scott Murray [email protected] wrote:

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

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scotthmurray/d3-book/issues/46#issuecomment-686735053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEW5R6VKBSIQD3RU24JNVT3SD73KDANCNFSM4QSAWF7A .

zlw8844 avatar Sep 04 '20 12:09 zlw8844

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.)

scotthmurray avatar Sep 30 '20 05:09 scotthmurray

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

CWMo avatar May 07 '22 07:05 CWMo