-
Notifications
You must be signed in to change notification settings - Fork 47
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
HTML ui #45
Comments
Hi, thanks for approaching. May you share more about what you mean by "HTML ui"? Thanks. |
Well I allready found an solution :-) With Shiny UI:App.R:
With HTML UI:Server.R:
www/index.html
and then add echarts.js to the www/ library This works, and shows ECharts2Shiny with HTML ui. However I would like it to not wrap it in 'fluidPage' in the renderWordcloud function - line 124 in word_cloud.R. Generally I think, it would be better to just return the 'js_statement' and then aks the users to enclose it into a renderUI function - like:
|
Hi @emillykkejensen , thanks so much for exploring and share! I had the current design as I thought it may be good to include But do let me know if you have any other good suggestions! I would be more than happy to refine it with your input. |
Okay - here's an idea:
(line 124-127)
just tried it locally and it work perfect :) |
Then how should we set the default value for If there is no predominant advantage, I may prefer to keep current design. |
It not a buden to write 'wrap_in_renderUI = FALSE' - it's a burden if one can't use ECharts2Shiny with HTML ui. By defaulting wrap_in_renderUI to TRUE, no change is made to the users currently using the function - but by including this extra argument, more people are able to use it. There really is no downside to it and there is a major advantage with it - the posibility to use ECharts2Shiny with HTML ui or with other Shiny ui's not based on the fluid layout (eg. fixed layout, flex layout, split layout etc. that do not use fluidPage()) :-) |
I understand the point you're trying to make now: enabling ECharts2Shiny with HTML ui (www/index.html) etc. Kindly allow me some time to check the code again and see how we can move forward with the inspiration of your idea. Will get back to you on this for sure ;-) |
Sounds good :-) |
Hi @emillykkejensen , I have checked the codes and please check the findings as below ;-) I must admit I've made a "mistake" in statement
Actually we don't need to include
I've made this change in branch dev_2, commit f7ecc1f, to all the relevant .R files in /R folder. Then let's go back to your question: how we can make this package work better with HTML ui. Actually with the current codes, you can already use different layouts (fixed layout, flex layout, split layout etc, as you pointed out). The command above will render the <script></script> in the final applicaiton, what we need to do is only to prepare the corresponding Hence your question is also solved: we are able to adopt diverse layouts while we don't need to make big change. We don't need to bother to add the argument Please let me know your thoughts. Thanks again for reaching out so that I can find the mistake I made. |
That could work. However I would like to stick to shiny's intended way of doing things, where you write the output to the server.R like: output$wordcloud <- renderUI(renderWordcloud(data = c('A', 'A', 'A', 'B', 'B', 'C', 'A'))) The main reason, is that I'm doing some work on my data before I put it into the renderWordcloud function, and I would like to do that work inside a reactive expression. |
Hi @emillykkejensen , for this request, I still think the current design is "good enough". My mainconcern is that it may increase the complexity if we try to have a reactive expression and do data manipulation inside it. As you may have found, the current design is quite straightforward :"translate" R data object into Javascript statements. I think it's better not to touch it. I hope you can kindly understand this. I'm not sure about your specific need but possibly you may want to refer to this example example-5 Use Reactive Values. |
Hi
I was wondering, what I need to do for ECharts2Shiny to work with HTML ui?
The text was updated successfully, but these errors were encountered: