-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamps: proper support for temporal maps (client-side) #16
Comments
After talking with @rochoa and discarding the named parameters example because adding it would difficult the consistency between JS API and String API. We came to the following examples:
EDIT: Not applicable anymore:
Related to: #130 |
After talking, again, with @rochoa, we came to the conclusion that the dateRange should be part of the first argument, which is similar to Examples:
|
|
Literal timestamps should follow ISO 8601, as it would be easier to support time zones and adjusting that to the client configuration. |
@rochoa I guess this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse is not good enough, from their docs:
Do you recommend some library? |
My recommendation is Moment.js, but for the time being, we can rely on the constructor and assume it will work in modern browsers (the browsers we support in the library). See: > new Date('2018-03-06T17:00:00.000Z')
< 'Tue Mar 06 2018 18:00:00 GMT+0100 (CET)' |
Moment.js is quite heavy, I think date constructor will do the job. |
I replaced |
Implemented with Date constructor |
Right 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
andto
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:
Note:
I've used named arguments, IMO this improves clarity, but we haven't implemented this yet.
The text was updated successfully, but these errors were encountered: