python-visualization / python-visualization/folium

map.save() to support an option to export leaflet dependencies (js/css/icons) as inline base64 uris

Open
#1,985 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
7.4k
Forks
2.3k
Avg merge
17h 22m
Merged PRs (30d)
11

Description

Is your feature request related to a problem? Please describe.

folium maps exported as html still depend on external leaflet dependencies (either from internet or on relative paths - manual modification is needed)

Describe the solution you'd like

Something similar to knit in RStudio (which produces the html with the inlined resources). I believe the R leaflet package is self-contained (it contains leaflet's resources), so for this to work in the same manner in folium, additional options to override default_js/default_css may be necessary (i.e. to point them to relative/static paths).

Describe alternatives you've considered

Out of various leaflet wrappers, RStudio's implementation is the closest.

Additional context

(Could attach one of html files created through RStudio's leaflet, if anyone needs it)

Implementation

Possibly, just to gauge the interest for now

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at map.save() and inspect how default_js and default_css dependencies are selected and written into exported HTML. Define the required option and verify that JavaScript, CSS, and icons are embedded as inline base64 URIs so the resulting map works without external or relative resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, python
Domain
data-visualization, frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.