Skip to content

Commit

Permalink
Add TimeSliderChoropleth stroke colour/width/opacity argument (#1838)
Browse files Browse the repository at this point in the history
* added color, width and opacity customization

* formatted code
  • Loading branch information
yutemi authored Dec 3, 2023
1 parent 775b867 commit e6049c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions folium/plugins/time_slider_choropleth.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ class TimeSliderChoropleth(JSCSSMixin, Layer):
$("#slider_{{ this.get_name() }}").show();
d3.selectAll('path')
.attr('stroke', 'white')
.attr('stroke-width', 0.8)
.attr('stroke', '{{ this.stroke_color }}')
.attr('stroke-width', {{ this.stroke_width }})
.attr('stroke-dasharray', '5,5')
.attr('stroke-opacity', {{ this.stroke_opacity }})
.attr('fill-opacity', 0);
fill_map();
Expand Down Expand Up @@ -166,11 +167,18 @@ def __init__(
control=True,
show=True,
init_timestamp=0,
stroke_opacity=1,
stroke_width=0.8,
stroke_color="#FFFFFF",
):
super().__init__(name=name, overlay=overlay, control=control, show=show)
self.data = GeoJson.process_data(GeoJson({}), data)
self.highlight = highlight

self.stroke_opacity = stroke_opacity
self.stroke_width = stroke_width
self.stroke_color = stroke_color

if not isinstance(styledict, dict):
raise ValueError(
f"styledict must be a dictionary, got {styledict!r}"
Expand Down

0 comments on commit e6049c2

Please sign in to comment.