You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, since I set up multiple: true, I expect onselected to fire only once - when the drag area is let go.
However, right now I get an event for every data point I select when the drag area crosses it; and there's no way to know when the dragging actually stopped.
How do I set up the listeners correctly? Is it a bug?
The text was updated successfully, but these errors were encountered:
Update: I've tried to use zoom for my case but it doesn't really work since onzoom* are called recursively if I update the data via chart.load({columns:...}).
My usecase is to basically run some code for the zoomed-in portion of the graph, and put the new data into the chart.
My usecase is to basically run some code for the zoomed-in portion of the graph, and put the new data into the chart.
"selection" and "zoom" is totally different interaction.
Based on the last comment, if I understood correctly, you want some sort of these actions.
drag some area
when drag finishes(mouseup event)
run some code based on the dragged selected data
If so, currently billboad.js doesn't provide some event for "dragend", but you can implement as follows.
data: {
...,onselected: function(d,element){this.selectionList.push(d);}},onafterinit(){constnode=this.internal.$el.main.select(".bb-chart").node();this.selectionList=[];newMutationObserver((mutationList,observer)=>{mutationList.forEach((mutation)=>{if(mutation.type==="childList"){if(!node.querySelector(".bb-dragarea")){// (1) do something with selection listconsole.log(this.selectionList);// (2) clear selection list for next selectionthis.selectionList.length=0;}}});}).observe(node,{childList: true});}}
You can add the code you want to run, after the // (1) do something with selection list comment.
By accessing this.selectionList value, will get selected data list.
Hi there! Not sure if it's a bug or a question, but here goes :)
Versions:
I've set up my chart like this:
Now, since I set up
multiple: true
, I expectonselected
to fire only once - when the drag area is let go.However, right now I get an event for every data point I select when the drag area crosses it; and there's no way to know when the dragging actually stopped.
How do I set up the listeners correctly? Is it a bug?
The text was updated successfully, but these errors were encountered: