keplergl / kepler.gl

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

[Feat] Human readable column names #1143

Open b2kdaman opened 4 years ago

b2kdaman commented 4 years ago

Is your feature request related to a problem? Please describe. Since most of the data I loaded through CSV, most of the time column names look like avg_bid_sum which is not helpful for end user.

Describe the solution you'd like I suggest to add additional tab with column label binding per dataset. This can be stored in config. Design is provided. Refresh button copies existing column name to label input.

Describe alternatives you've considered Renaming CSV column names by hand?

Kepler Designs (1)

b2kdaman commented 4 years ago

@heshan0131 is it good to go?

heshan0131 commented 4 years ago

What's the implemtation detail of this? How are you plan to handle additional prop to the field? As of all all the layer column, visual channels and filter can be tired to a field. And field.name is the unique identifier of each field.

Changing column names require many changes inside the reducer. not just UI work. It also matters to all the saved maps and future saved maps.

b2kdaman commented 4 years ago

@heshan0131 its going to be additional map in config:

...
columnsConfig: {
  dataId: {
    realColumnName: userColumnName,
  }
}
...

It will be used only in tooltip and legend components

b2kdaman commented 4 years ago

Created PR (wip) https://github.com/keplergl/kepler.gl/pull/1180

heshan0131 commented 4 years ago

I don't like the column panel design. It looks unfinished.

Here are 2 options for how this can be done:

  1. put this in tooltip panel, where the format option is. Because the end result is going to be displayed in tooltip you can make the tooltip config
    fieldsToShow: [
    {name: 'trip_count', displayName: 'Trip Count', format: '.2f'},
    ...
    ]

2 Make a separate column panel, adoping the design of map settings: where each column would be a box, and expandable

Screen Shot 2020-07-09 at 8 24 47 AM

You should add a displayName property to dataset.fields instead of adding an additional map. keep track of different mapping in reducer are difficult. Especially when dataset and config and loaded separately, there is always going to be a function to check if the map and actual dataset columns are in sync. The displayName property should be added when dataset first enter the reducer, and default it's the same as name

Please give an answer to all these questions before going into implementation

  1. Where is this human-readable name is going to be used?

  2. Which name property to shown in filter creation, layer color by column options, layer text label options

  3. Which name to show in dataset table

  4. Which name to show in layer legend

  5. If all the answer above is the human-readable name, does it make sense to still keep 2 names in the fields?

  6. If the human readable name is only used in the tooltip. Put it in tooltip config, instead of creating a new panel

b2kdaman commented 4 years ago

put this in tooltip panel, where the format option is. Because the end result is going to be displayed in tooltip you can make the tooltip config

Tooltip config is bloated already.

2 Make a separate column panel, adoping the design of map settings: where each column would be a box, and expandable

The dataset panel is expandable

You should add a displayName property to dataset.fields instead of adding an additional map. keep track of different mapping in reducer are difficult. Especially when dataset and config and loaded separately, there is always going to be a function to check if the map and actual dataset columns are in sync. The displayName property should be added when dataset first enter the reducer, and default it's the same as name

The columns map is only used in the view. I don't understand how it will affect the reducers. Basically it's a separate collection.

Now the questions:

Where is this human-readable name is going to be used?

Tooltip, data table, legend. At the moment only Tooltip support is implemented. (WIP)

Which name property to shown in filter creation, layer color by column options, layer text label options

Default OR overridden, either doesn't seem to be complicated to implement(only affects the view), what do you think?

Which name to show in dataset table

Mentioned above

Which name to show in layer legend

Mentioned above

If all the answer above is the human-readable name, does it make sense to still keep 2 names in the fields?

Yes, this way there will be no tinkering with data itself. Save/Load problems etc.

If the human readable name is only used in the tooltip. Put it in tooltip config, instead of creating a new panel

This panel will be used in the future for adding calculated columns, this might be discussed w/ Tom

heshan0131 commented 4 years ago

put this in tooltip panel, where the format option is. Because the end result is going to be displayed in tooltip you can make the tooltip config

Tooltip config is bloated already.

2 Make a separate column panel, adoping the design of map settings: where each column would be a box, and expandable

The dataset panel is expandable

You should add a displayName property to dataset.fields instead of adding an additional map. keep track of different mapping in reducer are difficult. Especially when dataset and config and loaded separately, there is always going to be a function to check if the map and actual dataset columns are in sync. The displayName property should be added when dataset first enter the reducer, and default it's the same as name

The columns map is only used in the view. I don't understand how it will affect the reducers. Basically it's a separate collection.

Now the questions:

Where is this human-readable name is going to be used?

Tooltip, data table, legend. At the moment only Tooltip support is implemented. (WIP)

Which name property to shown in filter creation, layer color by column options, layer text label options

Default OR overridden, either doesn't seem to be complicated to implement(only affects the view), what do you think?

Which name to show in dataset table

Mentioned above

Which name to show in layer legend

Mentioned above

If all the answer above is the human-readable name, does it make sense to still keep 2 names in the fields?

Yes, this way there will be no tinkering with data itself. Save/Load problems etc.

If the human readable name is only used in the tooltip. Put it in tooltip config, instead of creating a new panel

This panel will be used in the future for adding calculated columns, this might be discussed w/ Tom