holoviz-topics / EarthSim

Tools for working with and visualizing environmental simulations.
https://earthsim.holoviz.org
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

Color Path by single color is not working #230

Closed kcpevey closed 3 years ago

kcpevey commented 5 years ago

Sample data:
florence.txt

The following code will produce a path that is the default blue, NOT the red as specified in the opts.

%%opts Points (size=10, cmap=colors) [color_index='Max_Wind_Speed', color_levels=levels, colorbar=True, tools=['hover']]
%%opts Path (cmap='red') [color_index=None]

proj = ccrs.PlateCarree()
wind_df = pd.read_csv('../gitHub/es-workflows/updates/es-workflows/data/florence.txt', delimiter=',', header=0, parse_dates=['Datetime'])
data_df = wind_df.drop('Datetime',axis=1)
gvpath = gv.Path([data_df], kdims=['Longitude', 'Latitude'], vdims=['Pressure','Max_Wind_Speed','Radius','Direction_Degrees','Direction_Speed'], crs=proj)
gvpoint = gv.Points(data_df, kdims=['Longitude', 'Latitude'], vdims=['Pressure','Max_Wind_Speed','Radius','Direction_Degrees','Direction_Speed'], crs=proj)
annot = PolyAndPointAnnotator(path_type=Path, polys=gvpath, points=gvpoint,
                              point_columns=['Pressure','Max_Wind_Speed'], 
                              tile_url='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}',
                              crs=proj) 
(annot.tiles * annot.polys * annot.points + annot.point_table).cols(1) 
kcpevey commented 3 years ago

I think this is fixed.