-
Notifications
You must be signed in to change notification settings - Fork 193
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
Dygraph attribute in HTMLWidget is null #196
Comments
not really helpful for you, but it might be related to issue #127 |
@prise6, I just checked and you are correct even though line is designed to accomplish this. Unfortunately, the joys of JavaScript scoping means this does not work. I will submit a pull that should resolve the issue. As a side note, I will caution that you will also need to wait for the ...from what I remember at one point `dygraph` was available, so I think (but not all that confident) that something changed. |
Ok thank you, agree with your fix.
Haha 👍 |
@prise6 Mh.. Not sure about that.
|
@danklotz, there are 3 patterns that I have used to make sure the object is available to the outside.
Reading the code led me to believe that the intent was the first As another RStudio |
you (@timelyportfolio) are of course right (and your correction does what it is supposed to do). It just seemed that the problems are very similar (so I was hoping). I just want to be able to have a synchronised mouse over and/or selector over multiple dygraphs. Alas, my JS skills are to rudimentary to solve this : / |
@prise6 What's your high-level goal? Why do you need to access the |
We made a change some time back to enable the second pattern ( |
@jjallaire I see those changes but unfortuately they do not work for me, which resulted in #197. |
Both still don't work for me. (Tested it on a Mac, but that should not change anything). |
@danklotz Could you please provide a Minimal Working Example (https://www.r-bloggers.com/writing-a-minimal-working-example-mwe-in-r/)? |
Yes. But, I think the the example in #127 (by @ijlyttle) is ok. No?
(also not with the corrections of #197) |
@danklotz, I had tried to warn earlier that htmlwidgets render after page load, so the instance will not be available immediately. To access will require a delay or asynchrony. Here is a quick example that might help explain using my pull request version.
One other way to access after render is to use
|
Yessss. Makes me so happy :) 👍 (Sorry for beeing stupid/Not understanding the warning) |
@pshevtsov i don't think my high level goal is really relevant, but i wanted to synchronized multiple dygraphs. You'll find a tiny repo to see it can works with PR of @timelyportfolio : https://github.com/prise6/R-dygraphs-sync Anyway, @timelyportfolio provides good examples to run with current package. |
dygraphs/inst/htmlwidgets/dygraphs.js
Line 780 in 83c7d7a
Hi, thanks to this documentation, we can see that the javascript objet can be accessed.
In this implementation of Dygraph, i should access thanks to
HTMLWidgets.find('.dygraphs').dygraph
, but it seems that it is null.Am i wrong ? Is there a way to access the dygraph object ?
Thanks.
The text was updated successfully, but these errors were encountered: