Comments (6)
@swsoyee I had forgotten that Shiny inputs do not use @alandipert magic hydrate
function like widgets do. I think using reactR.hydrate
from https://github.com/react-R/reactR/blob/master/srcjs/react-tools.js will be the key. Here is the source for hydrate
. tag
should look like the following and children can be nested.
{
name: /name of the React component or tag/,
attrib: /props for the component/,
children: /child components expressed as an array of tag objects/
}
I hope to show a minimal example this weekend. Let me know if you make any progress between now and then.
from reactr.
@swsoyee Sorry, I am just now seeing this. I wrestled with this issue in https://github.com/timelyportfolio/dataui. My solution is unfortunately quite messy by manually adding the components
argument as children
to the tag
as shown in https://github.com/timelyportfolio/dataui/blob/master/R/duisparkline.R#L108-L120. dataui
is a widget though, and I think you are after something similar for an input
. If I find some time, I'll try to extend the example to demonstrate something similar with an input.
Thanks so much for the issue, and I'd love any ideas, feedback, examples that you might have to enrich the R + react community and experience.
from reactr.
@timelyportfolio Thank you for your answer, I'll take a look at how you've implemented it in dataui
, and I'm looking forward to seeing your examples!
Thank you so much for developing reactR and for bringing modern React
into the world of R.
Both R and React are my main languages, so I'll find a way to contribute to this community when I have time.
from reactr.
@swsoyee couldn't wait for the weekend. Here is a really quick proof of concept with an example. Let me know if you have any questions or ideas.
from reactr.
@timelyportfolio It's really cool! I'll try it out soon and left some comments if I have any other questions.
from reactr.
@timelyportfolio @swsoyee : Have you tried more complex inputs like this:
children=list(datatable(iris))
I tried it and get the following error:
Fehler: No method asJSON S3 class: htmlwidget
Is there a workaround to get this to fixed?
from reactr.
Related Issues (20)
- Cannot reproduce reactR example HOT 5
- ReactR state and other components HOT 10
- reactR in pinkgorilla HOT 4
- reactR::scaffoldReactWidget() creates devtools::check() warnings HOT 2
- add/document recommended system dependencies for reactR HOT 1
- document best practices for CI/CD for react-based htmlwidgets HOT 4
- New examples on authoring inputs HOT 3
- About the `myWidget_html` function HOT 9
- Multiple Shiny inputs HOT 2
- explore integration with packer HOT 4
- write better introduction vignette/article HOT 6
- hydrate tag attributes HOT 2
- Empty attribs in React$Component should be an empty **named** list
- Opposite direction? Exporting htmlwidgets::saveWidget() as a Component for external React application? HOT 1
- Using a typescript(.tsx) file. HOT 7
- Use Plots or other HTML Based inputs in ReactR Components possible? HOT 3
- reactR and Shiny modules HOT 1
- Using Shiny and or R Outputs In React
- insure `component` retains `list` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactr.