Timestamps: proper support for temporal maps (client-side)
See original GitHub issueRight now the only supported data types are numbers and categories in the form of strings.
We need to support timestamps and give the proper Date/Time utils to work with them.
The WWI_Ships example is a good starting point since it is working thanks to a column which is the number of days since 1917 instead of using the timestamp column.
We need to define the syntax/style API first.
I imagine something like:
torque($date, from: '15/01/1917', to: '1/01/1922', speed: '15 days'/'1 second', range: '10 days', trail: '10 days')
Where from
and to
are the start and end timestamps (should be optional, by default it should take the minimum and maximum timestamps of the dataset),
speed
is the simulated time that passes each real-time second of the simulation, in this case 15 days per second,
range
is the time duration in which the input is considered active (i.e. temporalSimulation returns 1),
trail
is the time duration in which the input is considered semiactive (i.e. temporalSimulation returns a number greater than 0 and less than 1).
The output of this function is (regarding the input $date) is:
Output
^
|1.66|
|1.33|
|1.0 | ______
|0.66| / \
|0.33| / \
|0.0 | ____/ \____
=================================> Time
Note: I’ve used named arguments, IMO this improves clarity, but we haven’t implemented this yet.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
I replaced
moment.js
by little maths with Date some time ago, saving half size of the Carto.js bundle: https://github.com/CartoDB/cartodb.js/pull/1981Literal timestamps should follow ISO 8601, as it would be easier to support time zones and adjusting that to the client configuration.