蜂巢图¶
In [1]:
import pandas as pd
from iclientpy import viz,convert_data_frame_to_dataset
从csv读取数据
In [2]:
df=pd.read_csv("mapvdata.csv")
df=df.reindex(df.index)
df["lng"] = pd.to_numeric(df["lng"],errors='coerce')
df["lat"] = pd.to_numeric(df["lat"],errors='coerce')
df["value"] = pd.to_numeric(df["value"],errors='coerce')
将数据转为蜂巢图所需要的数据格式,暂只支持点
In [3]:
data=convert_data_frame_to_dataset(data=df,lng_key='lng',lat_key='lat',value_key='value')
生成蜂巢图
In [4]:
chart=viz.honeycomb(data,fill_style="#3732FA",shadow_color='#FFFA32',shadow_blur=20,size=50,label_show=True,label_fill_style='white',global_alpha=0.5)
显示地图
In [5]:
chart
可视化交互,动态调整专题图
In [6]:
chart.interact()