Open danielkrizian opened 10 years ago
I believe renderChart2 will work fine. As far as I can tell, the issue is with chartOutput
which uses rCharts get_lib
which does not allow for other packages in the system.file(...,package="rCharts")
. I will update my fork of rCharts referenced in the readme to allow an option for other packages. I'll check with @ramnathv to see if there are any issues with this on the rCharts side.
I think this is more of an rCharts issue for single plots, so changed my dimple_layer branch of rCharts. To see it work, see this mini repo. Where we will need to make changes in this repo will be the layout_dygraphs
for multiple charts. I'll explore this here.
Great work @danielkrizian and @timelyportfolio! I have been out-of-action with rCharts, but will pick up stuff starting next week. Focus will be to clean up existing code, incorporating all the pull requests and merging dev with master. Once I get that done, I will work on making the changes to get Shiny working with packages depending on rCharts.
@ramnathv changes required were minimal with commit-get_lib
and commit-chartOutput
. If you deem ok, they will get pulled with the dimple_layer branch.
Perfect. I think that should do the trick. I will just do a quick scan of any other places where get_lib
is being called, so that we can update its signature.
@timelyportfolio I've tested the shiny - rcharts - dygraph example and can confirm it works - awesome.
Interestingly, on a windows machine running the shiny example on a shiny server causes several repaint issues with dygraph - essentially, several datapoints remain as residuals in the plot.
However, running the app locally with runApp() and had no such issues. Perhaps, isolated to my machine but would be interesting if other users have the same problem.
Thanks again - great to combine these tools.
I just realized that I was using dimple_layer locally, and that I never sent a pull request to @ramnathv for rCharts
, so the change was not picked up. I have isolated these changes and sent a new pull request.
Hi,
I appreciate the following problem may have multiple roots but I thought I'd start here and see if the problem can be reproduced. As mentioned previously, on a windows machine running the example on a shiny server causes several repaint issues with dygraph after zooming and panning - essentially, several datapoints remain as residuals in the plot.
However, running the app locally with runApp() has no such issues. Perhaps, isolated to my setup but would be interesting if others can reproduce the same problem.
Thanks @TonyDIRL. To reproduce, can you possibly share/link your code somehow (maybe through your forked repo)? That would be helpful for (diff) analysis
I experience the same issue on my Windows machine. I will try to debug it.
@danielkrizian - this problem seems specifically related to shiny-server. runApp() and runGist() do not seem to have repainting issues.
Hi @timelyportfolio , was wondering if you had an opportunity to debug the repainting issues with dygraph on a shiny server?
Looked more at this tonight. Strange but it only occurs for me in Chrome. Seems to work fine for me in RStudio browser and IE. I'll keep trying to figure this out.
Ok, by inspecting the elements I think I am one step closer. When I change all of the canvasses to have height = 1000
and width = 400
and then gs[0].updateOptions({})
to refresh, it all works nicely. Now, I just need to see where the improper sizing takes place and why it is different in Chrome. Anybody have any ideas?
Thank you @timelyportfolio for debugging. I tried in firefox previously but had similar issues to Chrome. Interestingly, the issue is inconsistent in Chrome - on occasion the correct canvas sizes are generated.
I've very little knowledge of html so I've posted this query on the Shiny google group so hopefully we will get some feedback there.
Quick update:
I made an app without Bootstrap, and I can confirm that Bootstrap is not causing the problem, so my first suspicion did not correct anything.
Not at all what I thought. Error on my side comes in here. Somehow my Chrome was zoomed to 90%, and that caused the issue. When I CTRL+0 to return to 100% or manually overrode the scales with canvasScale=1
and hiddenScale=1
, everything worked fine. I am not sure we need to change anything if this is the case. I guess we could consider skipping or modifying the canvasScale
check. We might file an issue over at dygraphs.
Note: when I set zoom to something less than 100% in IE, I get the same issue.
Nice work. @timelyportfolio. I can confirm across multiple machines and browser versions it is a zooming issue. Nice find - I was digging around this without success for quite a while.
Were you able to manually override the canvasScale=1 and hiddenScale=1 with some JS from within R?
I'll log the issue with dygraphs.
@pshevtsov , could you send a pull request to danvk
please? I think the simplest reproducible case we have right now is https://github.com/timelyportfolio/rCharts_dygraphs_shiny/, or can this case be further stripped down to pure JavaScript?
Actually, the tests included in dygraphs
experience this same bug. For instance, set browser zoom to <100% and open zoom.html. You should see the same bug.
Strange, to me the graph behaves correctly even when I zoom Chrome (Windows 7):
To get the error zoom < 100 then refresh.
Ok, I see now (clicking refresh is needed). Thanks, well isolated
try to work on the shiny integration by implementing what is in rCharts and maybe improving by having a look at ggvis. Can we use
renderChart2
from otherrCharts
libraries?