Skip to content
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

Add timeslider support for date fields #534

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions StoryRampSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@
"type": "string",
"description": "The layer attribute that should be queried based on the slider values."
},
"arcgisDate": {
"type": "boolean",
"description": "Whether the slider value should be converted into an arcGIS date/time format for the query",
"default": "false"
},
"layers": {
"type": "array",
"description": "An optional array of layer IDs for the slider to affect.",
Expand Down Expand Up @@ -467,6 +472,9 @@
"type": "object",
"description": "A formatter for use in the timeslider. Used to alias slider values into user readable versions.",
"oneOf": [
{
"$ref": "#/$defs/timeSliderDateFormatter"
},
{
"$ref": "#/$defs/timeSliderValuesFormatter"
},
Expand All @@ -476,6 +484,22 @@
]
},

"timeSliderDateFormatter": {
"type": "object",
"description": "A formatter that uses slider values as JS timestamps and converts them to readable formats",
"properties": {
"mode": {
"type": "string",
"enum": ["date"]
},
"format": {
"type": "string",
"description": "A format string describing the output of the formatter. 'Y' - year, 'M' - month, 'D' - day, 'h' - hour, 'm' - minute, 's' - second. Number of the same letter in a row is the length of the output (YY = 05, YYYY = 2025)."
}
},
"required": ["mode", "format"]
},

"timeSliderValuesFormatter": {
"type": "object",
"description": "A formatter which maps slider values to the element at that index in the 'values' array.",
Expand Down
31 changes: 25 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"nouislider": "^15.5.0",
"ramp-pcar": "^4.10.2",
"scrollama": "^3.2.0",
"throttle-debounce": "^5.0.2",
"vue": "^3.4.37",
"vue-class-component": "^8.0.0-rc.1",
"vue-fullscreen": "^3.1.1",
Expand All @@ -47,8 +48,9 @@
},
"devDependencies": {
"@tsconfig/node22": "^22.0.0",
"@types/node": "^22.9.3",
"@types/markdown-it": "^12.0.1",
"@types/node": "^22.9.3",
"@types/throttle-debounce": "^5.0.2",
"@vitejs/plugin-vue": "^5.1.2",
"@vue/eslint-config-prettier": "^10.1.0",
"@vue/eslint-config-typescript": "^14.1.3",
Expand Down
Loading
Loading