Skip to content
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

About the myWidget_html function #44

Closed
stla opened this issue Jul 31, 2020 · 9 comments
Closed

About the myWidget_html function #44

stla opened this issue Jul 31, 2020 · 9 comments

Comments

@stla
Copy link
Contributor

stla commented Jul 31, 2020

Hello,

Thank you for this great package. I've done a couple of packages based on it, such as shinyDatetimePicker and rAmCharts4.

I have a minor remark. The function scaffoldReactWidget generates a template R file which contains a function myWidget_html:

#' Called by HTMLWidgets to produce the widget's root element.
#' @rdname myWidget-shiny
myWidget_html <- function(id, style, class, ...) {
  htmltools::tagList(
    # Necessary for RStudio viewer version < 1.2
    reactR::html_dependency_corejs(),
    reactR::html_dependency_react(),
    reactR::html_dependency_reacttools(),
    htmltools::tags$div(id = id, class = class, style = style)
  )
}

It took me a while to understand the role of this function. The fact that it is grouped with the Shiny functions is puzzling. It is not specific to Shiny. So I would suggest to remove @rdname myWidget-shiny and to put @noRd instead (because this function has nothing to do in the documentation).

Another remark: in the Roxygen code of the template R file generated by scaffoldReactShinyInput, there is an import of restoreInput from shiny, but this function is not used (I don't know what it is by the way).

And a last one: there is a duplicated key path in webpack.config.js:

    output: {
        path: path.join(__dirname, 'inst', 'www', '${package}', 'myWidget'),
        path: path.join(__dirname, 'inst/htmlwidgets'),
        filename: 'myWidget.js'
    },

Cheers.

@timelyportfolio
Copy link
Collaborator

timelyportfolio commented Aug 1, 2020

@stla Thanks so much, and I tend to agree on all three suggestions.

confusing use of myWidget-shiny in documentation.

You are correct this has nothing to do with shiny, and I agree this can be confusing. In the past in traditional htmlwidgets I marked the *_html as internal see sunburstR, but noRd seems even better. I would also like to improve the documentation/comments describing the purpose of this function.

unused import of restoreInput

Yes, we should remove

#' @importFrom shiny restoreInput
.

duplicate path in webpack.config.js

I noticed this as well recently when building dataui. I will remove

path: path.join(__dirname, 'inst', 'www', '${package}', '${name}'),
. I believe this dates back to pre-input days.

Very happy to see rAmcharts4 and shinyDatetimePicker and thanks for pointing them out. Looks like you have it under control but let me know if I can help. I would like to build a gallery or at least a list of all reactR widgets and inputs.

@stla
Copy link
Contributor Author

stla commented Aug 1, 2020

Hello @timelyportfolio

I've just done shinyDatetimePickers, which replaces shinyDatetimePicker. It provides several datetime pickers.

For your gallery, you can add shinyChakraSlider and shinyCheckboxTree (I have to add a GIF for this one).

I think reactR was not necessary for rAmCharts4, but I find it's more easy with reactR (and I like to use react classes).

@stla
Copy link
Contributor Author

stla commented Oct 14, 2020

Hi @timelyportfolio , here is a new package for your gallery: aceEditor.

@timelyportfolio
Copy link
Collaborator

closed with #45

@stla
Copy link
Contributor Author

stla commented Jun 30, 2021

Hi @timelyportfolio here is a new package for your gallery: shinyChakraUI (work still in progress).

@timelyportfolio
Copy link
Collaborator

@stla very, very nice. Looking forward to more thoroughly playing, reviewing, and testing.

@stla
Copy link
Contributor Author

stla commented Jul 12, 2021

Thanks @timelyportfolio

A new one: shinyToastify.

@stla
Copy link
Contributor Author

stla commented Nov 13, 2021

Hi @timelyportfolio

Here is shinySelect.

@stla
Copy link
Contributor Author

stla commented Apr 17, 2023

Two new ones: DateTimeRangePicker (soon on CRAN) and reactCheckbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants