Closed henhuy closed 4 days ago
Indeed, the ranges are too wide now. As for your example above - this is a tricky one, as choropleth legend and colors try to fit for all given values. Now, range is very high, but even in older implementation the legend would go up to 27000% We must add special behaviour for percentage choropleths in order to prevent this high values. I will come up with a solution for both.
@henhuy Could you please have a look how this could be solved taking the issues from above into account?
Fixed RE share legend to 100% - but then many municiaplities colored dark blue as they exceed 100%. Good, or do you want to have it somehow different?
Fixed RE share legend to 100% - but then many municiaplities colored dark blue as they exceed 100%. Good, or do you want to have it somehow different?
Could you have a look @nesnoj ?
To list the issues and their status again:
Old:
New:
Can you solve this please?
Could you have a look @henhuy ?
Hey @nesnoj please review again. I made a rebase - so you have to throw away your current local branch and checkout fresh. And you have to update poetry, as i had to update mapengine.
Please check different choropleths and especially chorpleths for energy shares (%)
From today @henhuy
num_colors
in static/config/choropleths.json
seem to have no effect :thinking: From today @henhuy
* Colors seem to be continuous and do not match discrete colors
Cannot change continuous coloring - there is no option to do so... Only workaround would be to adapt feature data to match legend colors - would only do this if really necessary.
* Increase default number of legend colors from 5 to 6
Done.
* The param `num_colors` in `static/config/choropleths.json` seem to have no effect 🤔
There is a mismatched between chorpleth names i choropleth.json and choropleth.py. Once keys are mapping, number of legend entries gets adapted. For now, this is not needed, as I simply changed default number to 6 in mapengine.
Would like to merge now and encounter continuous coloring in a new issue if necessary.
Thx @henhuy for the fix, looks good now! And do not worry about the continuous coloring. However, the result popups do not work and raise
File "/app/digiplan/map/charts.py", line 53, in render
values = self.chart_data.iloc[i]
AttributeError: 'list' object has no attribute 'iloc'
pointing to your "Minor fix" in 4f0d0026a73c63a742f33b4889eddbac8999c296 . After undoing popups work again. What's the reason for this change?
What's the reason for this change?
A shit, this is due to pandas warnings in the console - but apparently chart_data
isn't always a pandas.Series
but can be a simple list as well. I will apply a quick fix.
I will apply a quick fix.
Done.
I will apply a quick fix.
Done.
Great, thanks! I'm happy to finally merge this :)
Fixes #142 Fixes #141
Needs poetry update due to fix in mapengine