Skip to content

Commit

Permalink
[tg] - top déchets : passage rayon en log2
Browse files Browse the repository at this point in the history
  • Loading branch information
tgazagnes committed May 23, 2024
1 parent b941905 commit c19f74b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dashboards/app/pages/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import plotly.express as px
import folium
from folium import IFrame
import math

# Configuration de la page
st.set_page_config(
Expand Down Expand Up @@ -701,10 +702,16 @@ def frenchify(x: int) -> str:

for index, row in df_map_data.iterrows():
# Application de la normalisation
radius = row["nb_dechet"] / normalisation_facteur
# radius = row["nb_dechet"] / normalisation_facteur

# Application d'une limite minimale pour le rayon si nécessaire
radius = max(radius, 5)
# radius = max(radius, 5)

# Calcul du rayon du marqueur en log base 2 pour réduire les écarts
if row["nb_dechet"] > 1:
radius = math.log2(row["nb_dechet"])
else:
radius = 0.001

folium.CircleMarker(
location=(row["LIEU_COORD_GPS_Y"], row["LIEU_COORD_GPS_X"]),
Expand Down

0 comments on commit c19f74b

Please sign in to comment.