Giter Club home page Giter Club logo

Comments (6)

timelyportfolio avatar timelyportfolio commented on June 16, 2024 1

@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.

timelyportfolio avatar timelyportfolio commented on June 16, 2024

@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.

swsoyee avatar swsoyee commented on June 16, 2024

@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.

timelyportfolio avatar timelyportfolio commented on June 16, 2024

@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.

swsoyee avatar swsoyee commented on June 16, 2024

@timelyportfolio It's really cool! I'll try it out soon and left some comments if I have any other questions.

from reactr.

Coding-Crashkurse avatar Coding-Crashkurse commented on June 16, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.