esquisse icon indicating copy to clipboard operation
esquisse copied to clipboard

enhance esquisse-module with ggplotly support

Open xiangnandang opened this issue 4 years ago • 13 comments

working on a solution for #34 and #84 and beyond

@pvictor ,

I have implemented (a "re-layout" branch on my fork, https://github.com/xiangnandang/esquisse/tree/re-layout), to include initial support for ggplotly, and displaying filtered datatable together, where all components of ggplot2, ggplotly, and filtered datatable are controlled by same filterDF module, and similarly ggplot2 and ggplotly use same labels/options controls.

Screenshots are attached. The only caveats I found is that, to make the three components, ggplot2, (gg)plotly, and datatable in a tabpanel arrangement (which does not support fill/flex layout), I had to hard code the dropInput and dragulaInput at 100px height (this is actually not necessary but I always found this helps save space), and more importantly the graphing/table area at 800px height, and to accommodate for small screen, I wrapped the entire layoutAddin with tags$div("overflow-y:scroll").

Let me know what do you think, and does it make sense to move this branch to the main repo, so that can be refined and later merged with master?

Best, Xiangnan

Screen Shot 2020-05-12 at 9 29 10 PM Screen Shot 2020-05-12 at 9 29 35 PM Screen Shot 2020-05-12 at 9 29 49 PM

xiangnandang avatar May 13 '20 01:05 xiangnandang

I would very happily take a look and assist with some beta testing, but I have been so far unable to install this in my R env. Had to download the zip file eventually due to devtools::github_install throwing errors which I suspect are firewall related.

So I then used install.packages on the local zip file.

I can see that something has happened as when I type esquisse-re-layout:: it appears as a package option in the console window of RStudio. But no functions are suggested.

When I try eg esquisse-re-layout::esquisser() I get the following;

Error: object 'esquisse' not found

I am probably doing something really basic and stupid. Usually only download packages rfom CRAN once they're available, essentially to avoid this kind of thing.

Any advice is appreciated - your work looks very interesting.

DanielPascoe avatar Jun 05 '20 09:06 DanielPascoe

Hi @DanielPascoe , first you need to have "devtools" package to install this specific branch, try:

devtools::install_github("xiangnandang/esquisse", ref = "re-layout")

I'm glad you find this interesting, and be willing to test it out. The status of this is really at ideation stage, and certainly bugs exist, layouts need to be optimized, and many other issues. Feel free to get back here to share any issues/feedbacks you have.

Best, Xiangnan

xiangnandang avatar Jun 05 '20 15:06 xiangnandang

Hi Xiangnan

Thanks for the response.

I actually had figured out how to install that branch and had done precisely that on a personal laptop (where firewall issues wouldn't get in the way.

However on that occasion I simply saw a different set of errors;

  • installing source package 'esquisse' ... ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Error: object 'numericRangeInput' is not exported by 'namespace:shinyWidgets' Execution halted ERROR: lazy loading failed for package 'esquisse'

I think I would be better off installing from the zip file but I seem to have failed miserably in that task also so far....

DanielPascoe avatar Jun 05 '20 22:06 DanielPascoe

@DanielPascoe , my initial thought is that you need to update your local shinyWidgets package, by simply running

install.packages("shinyWidgets")

Please let me know if it fixes.

xiangnandang avatar Jun 05 '20 22:06 xiangnandang

@xiangnandang ... I have installed your fork on my Mac and it worked fine... but on my Win10 company laptop I was not able to get it installed..... Your approach to get plotly as one additional option is really great, your facet row/column integration is nice and really welcome.

@pvictor Do you see a chance to implement the above mentioned features in your package?

Beside using the package as a RStudio addin I do enhance the visualization possibities of KNIME (www.knime.org)

@pvictor @xiangnandang THANK YOU VERY MUCH FOR YOUR WORK !!

frajuegies avatar Jul 08 '20 11:07 frajuegies

@xiangnandang Still never managed to install this. If I try using devtools::install_github("xiangnandang/esquisse", ref = "re-layout") I get a cannot resolve host error. So I guess it's failing on corporate firewall.

If I try and download manually from github and extract the zipfile it never seems to find the package even if I place a folder in the relevant library loc manually.

I'd really love to take a look at this as it looks extremely promising. So I hope it gets folded into the main body of work and ends up on CRAN at some point as that seems to be the only way I can install this for some unknown reason. Clearly user error on my part.

DanielPascoe avatar Jul 08 '20 14:07 DanielPascoe

@DanielPascoe , to install the re-layout branch, you can foolow these steps :

  • Go here : https://github.com/xiangnandang/esquisse/tree/re-layout and download zip :

image

  • then use remotes::install_local("esquisse-re-layout.zip") (change the path to point to the downloaded zip file)

You do not need to open the zip file.

@xiangnandang : my only concern with this relayout is that it's not optimal in addin mode.

@frajuegies , @xiangnandang I plan to release on CRAN facet's features next week, then we'll can discuss about plotly support (I also would like to test it with ggiraph package)

pvictor avatar Jul 08 '20 15:07 pvictor

Dear @pvictor ,

You might consider the brushing possibility of ggplot graphs in a shiny environment.... just a thought to improve interactivity further. Plotly is as well a very nice approach, but it might disturb the format / look of the underlying ggplot graph.

It would be as well great if the format of the axis text would change with the (point) size..... (I apologize for creating so many ideas and thereby possible work)

Best regards, Jürgen

frajuegies avatar Jul 08 '20 18:07 frajuegies

@DanielPascoe , to install the re-layout branch, you can foolow these steps :

  • Go here : https://github.com/xiangnandang/esquisse/tree/re-layout and download zip :

image

  • then use remotes::install_local("esquisse-re-layout.zip") (change the path to point to the downloaded zip file)

You do not need to open the zip file.

@xiangnandang : my only concern with this relayout is that it's not optimal in addin mode.

@frajuegies , @xiangnandang I plan to release on CRAN facet's features next week, then we'll can discuss about plotly support (I also would like to test it with ggiraph package)

Ok so I followed those steps. Seemed to need to rename the folder once installed, from esquisse-re-layout to simply esquisse.

Then tried calling esquisser(<my_dataset>) and seem to have gotten a little further as it attempted to render, briefly, before throwing another error....

Listening on http://127.0.0.1:4774 Warning: Error in if: argument is of length zero 75: select_geom_controls 74: observeEventHandler 3: shiny::runApp 2: runGadget 1: esquisser

I am wondering if only a complete uninstall and reinstall of R, RStudio and all my packages will suffice.

DanielPascoe avatar Jul 09 '20 13:07 DanielPascoe

@xiangnandang , this would be great! Thank you for the effort

GitHunter0 avatar Jul 31 '20 03:07 GitHunter0

@DanielPascoe , to install the re-layout branch, you can foolow these steps :

  • Go here : https://github.com/xiangnandang/esquisse/tree/re-layout and download zip :

image

  • then use remotes::install_local("esquisse-re-layout.zip") (change the path to point to the downloaded zip file)

You do not need to open the zip file.

@xiangnandang : my only concern with this relayout is that it's not optimal in addin mode.

@frajuegies , @xiangnandang I plan to release on CRAN facet's features next week, then we'll can discuss about plotly support (I also would like to test it with ggiraph package)

Hi

I finally managed to get this installed. Had to use devtools::install_local("mypath/blah/blah/esquisse-re-layout.zip")

Additionally I seemed to have to manually do updates from CRAN on a ton of other packages (no bad thing to have these up to date).

So I can now call esquisser as normal but when trying to use the plotly tab I get an initial error of "no applicable method for 'plotly_build' applied to an object of class "shiny.tag"

Weirdly though, I just glanced over at the first machine I installed this on (I have a couple) and now I can see a faceted scatterplot rendering in plotly, that I had previously rendered earlier today on the ggplot2 tab. But not as a result of me changing anything (I don't think).

So a somewhat strange, tough to reproduce issue.

But nevertheless I will experiment now I finally got it working. Thanks again.....

DanielPascoe avatar Sep 23 '20 22:09 DanielPascoe

This is a nifty enhancement and we are eagerly expecting this. Is there a plan to move this to the main repo?

sarthi2395 avatar Sep 24 '20 02:09 sarthi2395

I'm very happy that you're making this. Do you know when this will be ready for everyone to use?

Thank you very much.

JoaoMatheusHneda avatar Oct 02 '21 06:10 JoaoMatheusHneda

Hola hay una forma de poner la barra latera abajo.

image

JoseVeraReyes avatar Apr 03 '23 07:04 JoseVeraReyes