keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.41k stars 1.74k forks source link

Integer fields are identified as timestamp #226

Closed palamago closed 5 years ago

palamago commented 6 years ago

Describe the bug I have four integer columns in my dataset. One of them is interpreted as timestamp and I can't use it as colorField properly. I tried to force it before addDataToMap dispatch with no luck.

let data = Processors.processCsvData(response.responseText);
    data.fields = data.fields.map(f => {
      f.type = f.type == "timestamp" ? "integer" : f.type;
      f.format = "";
      return f;
    });

To Reproduce Steps to reproduce the behavior:

  1. Download this csv
  2. Add it on kepler
  3. You will see that the column qty2 is rendered as timestamp instead of integer captura de pantalla 2018-09-05 a la s 15 12 03

Expected behavior The numbers are integers. A way to force the types programmatically, maybe?

Screenshots Fields

captura de pantalla 2018-09-05 a la s 14 54 34

Desktop (please complete the following information):

Additional context Working on a React + Kepler 0.1.2 custom app. Kepler.gl is a beautiful piece of code. Thanks!

heshan0131 commented 6 years ago

Force editing the field type after processCsvData should work after this PR is merged

240

jakubmlacki commented 4 years ago

This is an old topic but I have a similar question. My ID colum sometimes contains strings and not integer. The column is detected as String. Then processCsvData puts NaN into the resulting object. Is there a way to force the type before calling processCsvData?

palamago commented 4 years ago

@jakubmlacki you should do a transformation in the dataset before call processCsvData or edit the object -field type- after processCsvData. Try it and let me know.