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 a date_option (format string) parameter to the choropleth timeline slider #2003

Merged

Conversation

hansthen
Copy link
Collaborator

@hansthen hansthen commented Oct 6, 2024

Closes #1997

@hansthen hansthen requested a review from Conengmo October 6, 2024 08:18
@hansthen hansthen force-pushed the format_time_in_chloropleth_slider branch from 4c13121 to 92d8456 Compare October 6, 2024 08:39
Copy link
Member

@Conengmo Conengmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Two comments that are more questions/suggestions on how to improve, but not critical.

@@ -19,6 +19,8 @@ class TimeSliderChoropleth(JSCSSMixin, Layer):
styledict: dict
A dictionary where the keys are the geojson feature ids and the values are
dicts of `{time: style_options_dict}`
date_options: str, default "ddd MMM DD YYYY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

later on it's called date_format, why not call it that here as well?

Copy link
Collaborator Author

@hansthen hansthen Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the other plugins. timestamped_geojson and timeline also use date_options. I would prefer date_format for the other plugins as well, but I don't think it is worth the effort.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense 👍

@@ -19,6 +19,8 @@ class TimeSliderChoropleth(JSCSSMixin, Layer):
styledict: dict
A dictionary where the keys are the geojson feature ids and the values are
dicts of `{time: style_options_dict}`
date_options: str, default "ddd MMM DD YYYY"
A format string to render the currently active time in the control.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we specify what formatting language is being used here? Like, what fields like MMM DD are available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you feel strongly about it, I can add a link to the formatting library used. However, I don't think it is necessary. The time string formatting language is fairly intuitive (and fairly universal). Also, I would like the documentation to be consistent between the different plugins.

@hansthen hansthen merged commit ebfa447 into python-visualization:main Oct 18, 2024
17 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Format time to show year only in choropleth time slider
2 participants