Time Slider with Varying MultiPolygon Size by Time Stamp
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- jupyter-notebook, pandas, python
- Domain
- data-visualization
Research direction
Start with script.txt and reproduce the issue in the Jupyter Notebook environment using data.zip and the TimeSliderChoropleth setup shown in the issue. Inspect how varying MultiPolygon shapes are represented across timestamps and how the slider transitions between them. Done means the initial timestamp shows only its own geometries and moving through the slider does not leave previous or final timestamp data overlaid.
Written by the indexing model from the issue text.
Description
I'm trying to create a time slider which varies by day, however, 1) all MultiPolygons are initially displayed at once for the first time stamp and 2) if I use the slider from the start to the end of the slider, all previous time steps are overlaid by the final time step.
Note: All MultiPolygons are not consistent in terms of shape/size. I think this is related to the issue.
Here's a screen capture of the issue:

There shouldn't be any overlapping lines on the map for the initial time stamp.
The final slide looks good:

However, once I scroll through all slides once, all data is overlaid by the final time stamp:

Here's the important part of the script:
#---create a style dictionary
styledata = {}
for i in range(allgpd.shape[0]):
subset = allgpd.iloc[i]
idxname = pd.Index([subset.times], dtype="U10")
df = pd.DataFrame({"color": allgpd['color'][i],"opacity": 1,},index=idxname,)
styledata[i] = df
#---reformat
styledict = {str(idx): data.to_dict(orient="index") for idx, data in styledata.items()}
#---create the folium slider
m = folium.Map(location=[qlat, qlon], zoom_start=6)
g = TimeSliderChoropleth(
allgpd.to_json(),
styledict=styledict,
control=True,
overlay=True, show=False).add_to(m)
m
I also attached my script in its entirety to this thread, as well (script.txt).
Environment details (Jupyter Notebook):
System: sys.version_info(major=3, minor=9, micro=12, releaselevel='final', serial=0)
Folium: 0.14.0
Branca: 0.6.0
I attached the data to this thread (data.zip).
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 2.3k
- Avg merge
- 17h 22m
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-visualization/folium
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-visualization/folium#2092 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
python-visualization/folium#2278 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-visualization/folium#2259 ·
-
Map output from OSM returns blocked tiles, due to defective request or not following referer-policy Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
python-visualization/folium#2236 · 5 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
python-visualization/folium#2219 · 2 comments ·
All issues in python-visualization/folium
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·