TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.16k stars 360 forks source link

hiding the lon & lat columns prevents csv data from plotting on the map #3069

Open zdefne-usgs opened 6 years ago

zdefne-usgs commented 6 years ago

We have a csv catalog item that works fine. We can successfully select one of the data points on the map and plot a chart. However, selecting a location and expanding the view to the chart, the list of the potable variables on the the left pane includes the longitude and latitude in addition to the variables we want to plot. I tried to hide them in a similar way I hide the id column. However, when I do that the data doesn't plot on the map. Is this a bug or is there another way to describe a list of parameters to plot on the chart?

Trying this code

...
            "tableStyle": { 
                "dataVariable": "variable name",
                "columns": {
                    "id": {
                        "type": "HIDDEN"
                    },
                    "Latitude": {
                        "type": "HIDDEN"
                    },
                    "Longitude": {
                        "type": "HIDDEN"
                    },
...

to hide them in this display image

PS: Also related to this question- is there away to set properties (color, selectable, hidden, etc) for the items on this list?
Thanks!

meh9 commented 6 years ago

In my opinion I'd say that showing the lat/lon cols on the chart is an oversight and should be considered a bug. TerriaJS should not show the columns used for doing the mapping in the data shown in a chart, similar to how they are not shown as a DisplayVariable.

Re setting properties, you can set some of these, e.g. the line colour:

https://github.com/TerriaJS/terriajs/blob/master/lib/Models/TableColumnStyle.js#L36

zdefne-usgs commented 6 years ago

Thank you @meh9. Just to clarify, this is after selecting a location and expanding the chart to plot multiple curves. Edited my original post to highlight that. Lon & lat are not included in the original table, but they show when a location is selected to plot multiple variables.

meh9 commented 6 years ago

@zdefne-usgs yup, I understood that. :)