-
Notifications
You must be signed in to change notification settings - Fork 104
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
renderDot does not trigger callback #14
Comments
I'll look into this issue in the nearest couple of days. I the meantime, you can use:
See this example. Regarding the "zoom to fit" function, you might want to use the Thanks for submitting this issue. If you are using this library, don't forget to "Watch" it to stay tuned for updates or even "Star" it if you like it. You can also use Stack Overflow tags d3.js & graphviz to ask for help. Although I make an effort to assist everyone that asks, I am not always available to provide help promptly or directly. |
Thanks for the quick reply. I should have mentioned this in my initial report: |
Re: "zoom to fit" I can see that the D3 V4 dynamic (mouse-driven) panning and zooming updates the
This makes me think that any "zoom to fit" function should update that However, the Your thoughts? |
Maybe I misunderstood. I meant an initial zoom to fit the generated graph, from which the user can zoom in or out, but now I realize that you probably meant a user-initiated function that fits the graph regardless of its original size and current zoom level. I think however, that they can be combined. I'll look into it late tonight CET (I'm coding for money during the day). |
On my phone so I can’t test it, but the callback/ event seems to fire only when a transition is used. As a workaround, try using a dummy transition with a duration of 0. And yes, the invalid asm.js is unrelated. It’s a known viz.js issue: mdaines/viz-js#96 |
Tested this workaround ok:
|
I've pushed a fix for this bug in 1277bd2. Do you need a new release or do you install locally? Also, can I ask you to post a question on Stack Overflow using the tags d3.js and graphviz if you still need help with the "zoom to fit" function? It's a better place to answer questions. I've started to work on it, but now I must call it a day. |
I'm sincerely grateful for your help. A new release would be great. Right now, I'm being "lazy", and just doing this:
I'm concentrating on tweaking the program that generates the DOT file. Yes, if I can't work it out myself in the next day or so, I'll post a question on Stack Overflow about the "zoom to fit" function.
Yes, I had in mind a single function that could be called at initial "render time", and then called later whenever the user clicks a "Fit" button. |
Released in v1.1.0 |
Thank you! I'm now using a |
This works (renders the graph in
data
):So does this (as above, with an anonymous callback function), except that I don't get a console message; renderDot does not trigger the callback:
I'm interested in using a callback function because I want to zoom the graph to fit the viewport. That's what I want to do in the callback (although, I'm still working out the "zoom to fit" function).
I'm using latest Google Chrome on Windows 10.
In case it's related, the Chrome console shows the following error (which doesn't seem to affect the rendering):
Invalid asm.js: Function definition doesn't match use - viz.js:37
Software versions:
The text was updated successfully, but these errors were encountered: