python-visualization / python-visualization/folium

Pass number format to folium legend

Đang mở
#2,014 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement
Ngôn ngữ chính
Python
Star
7.4k
Fork
2.3k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
11

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách xác định phần tạo chú giải choropleth của folium và đầu ra Leaflet.js được dùng cho thang đo của chú giải. Tái hiện vấn đề với một bản đồ được render cho nhiều định dạng số và kiểm tra HTML được tạo trong một trình duyệt headless. Công việc được xem là hoàn tất khi bên gọi có thể kiểm soát định dạng số của chú giải mà không thay đổi bản địa hóa toàn cục, và cách sử dụng được hỗ trợ đã được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, python
Lĩnh vực
data-visualization, web-dev
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.