Time series widget not intuitively giving correct binning
See original GitHub issueContext
Working with a client yesterday, we had a data set of thousands of points, each with a year
attribute: 2000, 2001, …, 2012. She wanted to create a simple Time Series widget to filter her map by year, but the result was the following (which must be milliseconds after the epoch?):
Converting this column to time
through the dataset interface changes these values to timestamps in 1970, so the values are interpreted as milliseconds. Using SQL to manually convert using to_date(time_column, 'yyyy')
produces values like 2000-01-01T00:00:00Z
. Creating a time series widget off this column gives:
Which is an improvement, but doing any of the filtering quickly gives ranges that are not appropriate:
The expectation here would be that the first bin would be 2000-01-01T00:00:00Z
to 2001-01-01T00:00:00Z
. I understand that I could jump through some more hoops in the data prep with SQL to manually create the ranges I want, but this seems like a lot of work for a very common use case.
We next tried creating a histogram widget but the x-axis displayed the values as follows:
Here, the lack of precision in displaying the numbers is a problem.
Finally, we did a category widget:
This is the closest, but the user needed the full range of data to be displayed on the widget like in the time-series widget. She also needed it to be ordered from 2000 upward like on the time series widget.
Steps to Reproduce
Please break down here below all the needed steps to reproduce the issue
- Import my mock dataset and create a map: https://team.carto.com/u/eschbacher/tables/mock_time_data/public
- Create a time series widget using the
year
column to see the unix timestamp conversion - Create a time series widget using the
year_date
and choose 13 as the number of bins. - Filter by time ranges to see that the bin edges do not line up based on expectations
- Create a histogram widget to see the x-axis precision (
2k
for values 2000 through 2012)
Current Result
- Time series does not give intuitive ranges for input values
- Histogram x-axis rounds too much to give user a sense of the range in values
- Category widget does not extend to show all values, and does not let you order them correctly
Expected result
Creating a time series widget off of a column that has a numeric value for year only should automatically have year bins without bleeding into other years.
Browser and version
Chrome Version 56.0.2924.87 (64-bit), macOS 10.12.4
.carto file
Just this dataset: https://team.carto.com/u/eschbacher/tables/mock_time_data/public
Additional info
Work with a client
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
Good news! Aggregations has been released and look at the results with your dataset @andy-esch ❤️ 💋 .
What @noguerol commented (about timezones) will be implemented (and it is close to be released) in https://github.com/CartoDB/cartodb/issues/12088. Closing this one for the moment 💃 .