-
Notifications
You must be signed in to change notification settings - Fork 605
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
Demo broken: Drawing zoom option errors #611
Comments
I noticed in 1.1.1 this no longer issues an undefined error, the references to mousemove and mouseup were removed in favor of just referencing the default mousedown. This should work, but when zooming the mouseup event triggers, but context.isZooming is always false which results in never completing the zoom function. I've been looking into it, but can't figure out where isZooming becomes false. This doesn't just break the demo, but any other custom interaction model implementation that wishes to make use of the defaults. |
I want to define an interaction model as defined here :
I m having the same problem mousemove and mousup are undefined. My purpose is to set a different behaviour when the graph is displayed on touchscreen. Is there a different way to do that ? |
Is there a solution available? If I include only the mousedown it doesn't work correctly. Basically what I want to do is using the defaultmodel and when the user makes a selection ( just like he does when zooming ), it should check the state of the ctrl-key. If not pressed, go on with the default zooming, otherwise do my stuff and finish the event. |
A little late to the convo but @lBowlin a quick workaround is to destroy the graph and recreate it without the custom interactionModels. Not ideal but it does get the job done. I'll try to see if I can address this issue. |
The drawing demo somehow works now. But when I try to replicate in my own project, I get the same errors as above:
Was this fixed in a specific version or so? |
Facing the same issue while trying to combine the default behavior with some custom one. These are my options:
Anyone having anything helpful to add to the matter? :) |
Here is my workaround in TypeScript (JS should be similar). I copy defaultInteractionModel:
clone function from here: https://stackoverflow.com/a/122190 here are custom action functions:
No idea why I can't find mousemove on defautlInteractionModel and in case of MouseDown I have to call one - but anyway here it worked for me. I was able to get custom click action with zooming working as originally. Somebody had a good fun by changing Dygraph code there :D |
I'm using the 2.1.0 release. While trying to implement a custom interaction model I also experienced this issue when trying to use the default model for mousemove, mouseup and mouseout. The workaround that I used was to redefine the functions as they were defined in previous releases. The code for the functions can be found here . The code is as follow:
Just paste the code before trying to use the functions. |
Ok, after wrestling with this problem for several hours the solution is simple; you need to set willDestroyContextMyself to true on your custom interaction model, and only propagate mousedown, and dblclick events to the default interaction model. (and possibly touch events if you are using them)
|
This pull request fixes the broken zoom functionality (issue #611) and console errors in the drawing demo. It simply adds the willDestroyContextMyself attribute, and removes the now unimplemented functions in the defaultInteractionModel. Comments have also been added to explain to users why calls are missing. > Hi, yep, the bug is still there. Select the zoom functionality in > https://dygraphs.com/gallery/#g/drawing with the console open, and try > a zoom, or move the mouse over the canvas.
Same as PR#953 fixed for the gallery, really.
The drawing demo is now broken. The change introduced to move the mouseup and mousemove to the document most likely broke this (see #472). Mousemove and mousup are now undefined:
Dygraph.defaultInteractionModel.mousemove(event, g, context);
Dygraph.defaultInteractionModel.mouseout(event, g, context);
Dygraph.defaultInteractionModel.mouseup(event, g, context);
The text was updated successfully, but these errors were encountered: