df1['Data_Count'] = df1.groupby('HIGH_WTEM_OBVP_NM')['HIGH_WTEM_OBVP_NM'].transform('size')
df1['Name_Count_Str'] = df1.apply(lambda row: f"{row['HIGH_WTEM_OBVP_NM']} ({row['Data_Count']})", axis=1)
# Plotlyλ₯Ό μ¬μ©νμ¬ Mapbox μ§λ μμ λ°μ΄ν° μκ°ν
fig = px.scatter_mapbox(df1,
lat='HIGH_WTEM_OBVP_LAT',
lon='HIGH_WTEM_OBVP_LON',
size='Data_Count', # κ° κ΄μΈ‘μμμ λ°λ Ήλ λ°μ΄ν° κ°μλ₯Ό ν¬κΈ°λ‘ μ§μ
size_max=40, # μμ μ΅λ ν¬κΈ° μ€μ
hover_name='HIGH_WTEM_OBVP_NM',
hover_data={'THDT_LWET_WTEM', 'THDT_TOP_WTEM', 'Data_Count'},
labels={'THDT_LWET_WTEM': 'μ΅μ μ¨λ', 'Data_Count': 'μ 체 μ보 κ°μ'},
text=df1['Name_Count_Str'],
color='THDT_LWET_WTEM', # νκ· μ¨λμ λ°λΌ μμ νμ
color_continuous_scale='Inferno', # μμ μ€μΌμΌ μ€μ (Inferno)
opacity=0.02, # μμ ν¬λͺ
λ μ€μ
zoom=2) # μ΄κΈ° νλ μμ€ μ€μ
# # Annotation μΆκ°
# for idx, row in df1.iterrows():
# annotation_text = f"<b>κ΄μΈ‘μλͺ
:</b> {row['HIGH_WTEM_OBVP_NM']}<br>" \
# f"<b>μ΅μ μ¨λ:</b> {row['THDT_LWET_WTEM']}Β°C<br>" \
# f"<b>μ 체 μ보 κ°μ:</b> {row['Data_Count']}"
# fig.add_annotation(x=row['HIGH_WTEM_OBVP_LON'], # κ²½λ μ€μ
# y=row['HIGH_WTEM_OBVP_LAT'], # μλ μ€μ
# text=row['Name_Count_Str'],
# showarrow=False,
# font=dict(color='black', size=10))
# λ μ΄μμ μ€μ
fig.update_layout(title='κ³ μ¨ μ£Όμ보 κ΄μΈ‘μ μμΉ λ° λ°μ΄ν° μκ°ν',
mapbox_style='carto-positron',
mapbox=dict(center=dict(lat=df1['HIGH_WTEM_OBVP_LAT'].mean(),
lon=df1['HIGH_WTEM_OBVP_LON'].mean()), # μ§λ μ€μ¬ μ€μ
zoom=5)) # Mapbox μ€νμΌ μ€μ
# κ·Έλν μΆλ ₯
fig.show()
I want to add Annotation each circle not hover