I am making a choropleth map in Folium which displays data for certain age brackets. I would like to add a double ended slider letting users select the bottom and top of the age range to view. The data is from the census which has 14 different age brackets. Thus the slider should have discretized stopping points corresponding to the age ranges specified by the Census data. Something like this: https://digital-geography.com/filter-leaflet-maps-slider/
The only way I know how to do this in Folium would be to make each possible pair of ages its own layer and then switch between them in the layer menu. However this would increase the amount of data I would have by a factor of 98, and the map is already 270 KB with a single layer. So it would be an almost 20 MB webpage if I do it this way! Plus I would not have a slider.
Is there some other way of doing my desired functionality with an actual slider instead of the layer controls and without having to store such a large HTML page?