question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Predefined breaks for LinearColorMapper

See original GitHub issue

I’m developing an application to analyze arbovirus infections in the neighborhoods of two cities. Heat maps are generated for each city, their color scheme varies according to the count of infections in the neighborhoods. One of the problems in generating color of these maps is the interest data distribution. The vector of infection counts for each city has very distant values, such as the vector v1 = [1, 2, 3, 3, 4, 7, 8, 9, 15, 20, 39, 40]. The LinearColorMapper with 4 colors would generate mapping intervals with size 10 breaks, such as [1, 10), ..., [30, 40]. So, as we can see, more than half of v1 would be included in the break [1, 10), causing many neighborhoods to be mapped to a single color. An ideal set of intervals for this problem would be c = {[1, 4], [7, 9], [15, 20], [39, 40]}, as it would allow for more color abundance on maps. An alternative to solve this problem would be allow the LinearColorMapper function to receive externally generated intervals or to add a resource in the LinearColorMapper function that allows selecting the algorithm for generating breaks, such as Fisher-Jenks and Jenks-Caspall.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
bryevdvcommented, Nov 12, 2020

Just to be clear I think viewport-based colormapping is out of scope. I think it is far more common for people to want to apply a colormap globally.

2reactions
bryevdvcommented, Nov 11, 2020

I think that adding a parameter to the LinearColorMapper function that allows you to select different algorithms for generating these breaks can be of great help

So I am personally 👎 on this sort of approach. It is limiting in the sense that the only algorithms that would be available would be the ones we happen to choose to support, and that will never satisfy everyone. I don’t want the project to be on the hook for curating which algorithms get added and which don’t, and I don’t want the project to be on the hook to maintain them, either.

I would propose something more generic that simply exposes the ability for users to specify piecewise linear maps explicitly. Then generating those maps (using whatever algorithm is desired) is the user’s responsibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

folium/features.py at main · python-visualization/folium - GitHub
Enable highlight functionality when hovering over a GeoJSON area. use_jenks: bool, default False. Use jenkspy to calculate bins using "natural breaks".
Read more >
Bokeh: How can I directly access the colors in a ColorMapper?
I use a LinearColorMapper in Bokeh 2.3.0 to map values to certain colors in my plot. Nothing fancy, as shown in the minimal...
Read more >
Source code for chartify._core.plot - Read the Docs
Cast all categorical columns to strings # Plotting functions will break with non-str ... LinearColorMapper( palette=color_palette, low=color_value_min, ...
Read more >
Intentional omissions — iqplot documentation
Intentional omissions . iqplot is intentionally limited in scope. It is restricted to only data sets with a single quantitative variable.
Read more >
leafmap module
By default, the Map will add OpenStreetMap as the basemap. Returns: ... This styling function takes the feature as argument. Defaults to None....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found