altair-viz / jupyterlab_voyager

JupyterLab extension visualize data with Voyager
BSD 3-Clause "New" or "Revised" License
298 stars 35 forks source link

Cannot read property 'map' of null #53

Open a-w-1806 opened 6 years ago

a-w-1806 commented 6 years ago

Hi! When I right click on a .csv file in the Files and choose Open with->Voyager I get :

localhost:8888 says Cannot read property 'map' of null

The voyage window opens up but it seems not read in any data at all. But when I do the same to a .json file, the voyage window opens up without the error message but still no data is loaded.

My OS: Linux Mint Chrome: 68.0.3440.75 node -v:v8.10.0

Thanks in advance!

zzhangjii commented 6 years ago

Thx for reporting this issue! It looks like a file content reading error. For local file, the content reading process relies on "read" method from vega-loader(). It loads the content into strings and process them with different delimiters based on different file types. Therefore, to use this method properly, we have to make sure the file contents strictly match the file type.

Those errors are likely to be caused by file type&content conflicts. You may obtain and test some more files from here (https://vega.github.io/vega-lite/examples/bar.html) to see if it's the case.

a-w-1806 commented 6 years ago

Thanks for your reply! I play around with it and finally find out the reason. My .csv file's first column is index column and it does not have a header name. So that element of the header line is simply blank. After I fill some text to it and reload the data, it works. Is it an issue you can fix? Thanks!

zzhangjii commented 6 years ago

Thanks for sharing the info. I can't really change the "read" method there, but I will try some other ways to see if it can help.