Skip to content

How to pass information into the ellipsis argument of the widget's custom HTML function?Β #482

@daattali

Description

@daattali

The documentation shows that it's possible to create a custom HTML container for a widget:

WIDGETNAME_html <- function(id, style, class, ...){
  tags$span(id = id, class = class)
}

How can I, as the widget developer, pass information into the ellipsis argument?

More specifically, suppose I have the following widget definition:

MYWIDGET <- function(data, big = TRUE) {
  javascript_data = list()
  htmlwidgets::createWidget(name = 'MYWIDGET', x = javascript_data, width = 400, height = 400, big = big)
}

I would want the big argument to be passed to the custom HTML constructor so that I can add an HTML class to the tag. I know I can pass the information into the x parameter, and then deal with it from javascript, but I want to know how to access a variable in the widget's html construction before it gets into the javascript layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions