-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Allow Overlay returned in DynamicMap to return varying number of items #1388
Comments
I think the issues 1. and 4. are connected. So if one of the plots in DynamicMap is changing something dramatic in one of the Overlays then it produces wrong image: with bad Style or Plot options... This is example when 4. is not working ldata=lowess[:, 0]
lxs=lowess[:, 1] This is an example when 4. is working ldata=lowess[:, 1]
lxs=lowess[:, 0] |
Sorry for being so slow to respond.
Definitely seems like a bug I'll start investigating right away.
This is an overall issue with sizing in matplotlib, the
Our widgets have some debouncing by default but disabling continuous updates seems like a good feature request.
The way to achieve this is to explicitly sample the DynamicMap first like this: hv.HoloMap(dmap[[0, 10, 20], [1, 2, 3]])
This does seem related to your first issue, I'll investigate. |
Okay I've finally had a chance to go through your notebook. It's quite hard to follow complex examples like this and self-contained, minimal examples are much preferred when tracking down bugs. I've now tracked down the issue to the fact that your DynamicMap is returning an Overlay with varying numbers of Points. The number of items in an |
Sounds like something we want to detail in the User Guide. Not sure which one though... |
Thanks, @philippjfr. I'm sorry for the big notebook - will try to be better next time. Will you create a request on this issue which you mentioned above:
I'll switch to NdOverlay for bokeh, but will have to implement static plots using pure matplotlib. Which means that instead of reducing libraries from (bokeh, matplotlib) to (holoviews) - I add one more library dependency and have to keep 3 libraries (bokeh, matplotlib and holoviews) in mind while working with my data. |
@philippjfr , I'm trying to use NdOverlay in bokeh with a varying number of items as you mentioned above but it doesn't seem to be working.
When I hit the checkbox I get the message " OverlayPlot01231: Some Elements returned by the dynamic callback were not initialized correctly and could not be rendered." If reverse the order so that the overlay with the most number of elements is displayed first I don't get and error message and I can toggle the element on and off but the legend does not update.
|
Thanks for the nice reproducible example, that message is unfortunately less informative than it could be, so I'll make sure to fix that and I'll have to document this stuff. Currently to be able to update NdOverlays easily we have something called "batched" mode, which collapses all the elements in your NdOverlay into a single ColumnDataSource. Batched mode doesn't support legends so we have decided that any NdOverlay with more than 10 items will be batched by default. You can reduce the batching limit with the def points_callback(show_more):
if show_more:
items = {'1': points1, '2': points2})
else:
items = {'1': points1, '2': points2, '3': points3})
return hv.NdOverlay(items).opts(plot=dict(legend_limit=0)) This is quite an annoyance so I'll make sure to document it. In future we can likely lift this restriction at least on bokeh server. |
@philippjfr the problem partly still persists, if you flip the order such that
you can only see the initially plotted 2 points now and the 3rd point cannot be enabled. |
Since there is now a clear path forward toward allowing DynamicMaps to return Overlays with varying numbers of items I've repurposed the issue and assigned it to the next milestone. |
This is now supported with some caveats (namely in bokeh the toolbar will disappear but this is an issue that must be addressed in bokeh). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In the notebook here I'm building a simple peakfinder widget.
So far 3 problems:
Here is what I get for the initial stage: You can clearly see the Blue point
Then I move to the parameter for which that Blue point disappears.
Then I move it back to the initial space - but the point size is reduced to the minimal
Matplotlib: point size is 100 and seems to be depend on fig_size - it's counterintuitive to me
My calculation may take a while - how to delay the recalculation to the time when the slider is released?
P.S. I also want to update this DynamicMap to HoloMap so that when I save it goes to HTML, but when I wrap dmap with holomap - it does nothing... I'm sure I'm doing something wrong...
The text was updated successfully, but these errors were encountered: