Skip to content

Add stroke_dash_array option to TimeSliderChoropleth - #2273

Open
ChrisJr404 wants to merge 1 commit into
python-visualization:mainfrom
ChrisJr404:timeslider-stroke-dash
Open

Add stroke_dash_array option to TimeSliderChoropleth#2273
ChrisJr404 wants to merge 1 commit into
python-visualization:mainfrom
ChrisJr404:timeslider-stroke-dash

Conversation

@ChrisJr404

Copy link
Copy Markdown

Follow-up to #1615. That issue asked to make the stroke around TimeSliderChoropleth features configurable, and #1838 added stroke_color, stroke_width and stroke_opacity. But the dash pattern is still hard-coded in the template:

.attr('stroke-dasharray', '5,5')

So the white dashed line the original reporter wanted to get rid of can be recolored or hidden, but you still can't make it solid. This adds a stroke_dash_array argument that feeds straight into the SVG stroke-dasharray:

TimeSliderChoropleth(data, styledict, stroke_dash_array="0")  # solid line

The default is "5,5", which renders exactly like before, so existing maps are unchanged. I also documented the three earlier stroke options in the docstring while I was there, since they weren't listed yet.

Testing

Two new tests in tests/plugins/test_time_slider_choropleth.py: one checks the default still emits stroke-dasharray', '5,5', the other that stroke_dash_array="0" emits '0' and no longer the dashed default.

pytest tests/plugins/test_time_slider_choropleth.py is 3 passed; the only failure is test_timedynamic_geo_json, which needs geodatasets/geopandas and fails the same way on an unmodified checkout. ruff, black and codespell are clean on both files.

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.

1 participant