python-visualization / python-visualization/folium

Pass number format to folium legend

Aperta
#2,014 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Python
Stelle
7.4k
Fork
2.3k
Merge medio
17h 22m
PR unite (30g)
11

Descrizione

We would like to use folium to create choropleths in more than one language. So far (unless I am missing something), it appears that folium is using the system localization to set the language format for numbers in folium legend.

We, and I anticipate others, have more than one use for these maps:

  1. Online as the intended HTML output
  2. Print versions (digitally as images, parts of PDF files and also hard copies).

The problem is that in order to change number formats (in this case comma vs. period for decimal), the language localization needs to be reset globally, in most cases requiring a kernel reset (again, unless I am missing something).

I would like to be able to pass a number format to the legend to change the language format of the numbers in the scale, either by:

  1. passing a format string, or
  2. specifying a localization that folium can then reference and set the text accordingly
  3. Have some documentation on how to inject an equivalent instruction by HTML.

Ultimately, I would like to do the following in a single code execution:

  1. Create folium map (language localization unimportant since the html will use the localization of the system it is hosted on)
  2. Change/re-render choropleths to two languages (with number formats) so that images can be saved for alternate media use

Since headerless browser can be used to generate images and text can be passed in any language, the only thing that is needed is to interact with the format of the numbers in the legend scale.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia individuando la generazione della legenda choropleth di folium e l’output di Leaflet.js utilizzato per la scala della legenda. Riproduci il problema con una mappa renderizzata per più formati numerici e ispeziona l’HTML generato in un browser headless. Il lavoro è completato quando un chiamante può controllare la formattazione numerica della legenda senza modificare la localizzazione globale e l’utilizzo supportato è documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, python
Ambito
data-visualization, web-dev
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.