New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datashade support for VectorField #5690
Comments
Hi, I also use HoloViews to visualise wind data. It's likely that you don't need every single arrow shown on screen. If so, a workaround is to create a sparse vector field based on local average, dynamically adapting to the current viewport to keep a constant, user-determined number of vectors on screen. Something along these lines: import datashader as ds
def make_vector_field(x_range, y_range):
cvs = ds.Canvas(plot_width=n_arrows_along_x,
plot_height=n_arrows_along_y,
x_range=x_range, y_range=y_range)
angle = cvs.raster(data['angle'])
magnitude = cvs.raster(data['magnitude'])
vector_field = hv.VectorField((angle['longitude'], angle['latitude'], np.pi/2 - np.pi/180*angle[:, :], magnitude[:, :])).opts(magnitude='Magnitude')
return vector_field
xy_range = hv.streams.RangeXY()
dmap = hv.DynamicMap(make_vector_field, streams=[xy_range]) Here is what my implementation looks like. It's on a remote server so there's some latency. |
Thanks @TheoMathurin Looks interesting. However, my use case is 12M nodes in unstructured mesh, so subsetting becomes more complicated. |
I may not be imagining the use case correctly, but I would think that people will have difficulting seeing the directions if a very large number of arrows are packed into a single plot without subsetting. @TheoMathurin 's suggestion is precisely what I was coming here to suggest, i.e. using Datashader to render the unstructured mesh into a couple of structured meshs (representing the vector components), which will always have a fixed number of arrows to display and will thus be renderable in a readable form. |
Is your feature request related to a problem? Please describe.
In a case of very large datasets for e.g. wind data visualising quivers without
datashade
will be suboptimal. Is there a timeline or implementation path for this feature?Describe the solution you'd like
Support
Datashader
as anticipated hereDescribe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: