Skip to content

Inline clientside callbacks in Dash for R #135

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

Closed
rpkyle opened this issue Oct 31, 2019 · 1 comment
Closed

Inline clientside callbacks in Dash for R #135

rpkyle opened this issue Oct 31, 2019 · 1 comment
Assignees
Labels
dash-stage-in_review enhancement feature request Community request for a package enhancement size: 1
Milestone

Comments

@rpkyle
Copy link
Contributor

rpkyle commented Oct 31, 2019

As noted in plotly/dash#956 and plotly/dash#967, it would be very convenient for app developers who wish to leverage JavaScript callbacks to compose these directly within the callback method. One approach might be to pass the JS directly as a string:

app$callback(
  output('out-component', 'value'),
  params=list(input('in-component1', 'value'), input('in-component2', 'value')),
  clientsideFunction(
    "
    function(largeValue1, largeValue2) {
        return someTransform(largeValue1, largeValue2);
    }
    "
    )
)

The namespace / function name can be determined in a fashion similar as what's done in DashPy (plotly/dash#967), or not, with the _dashprivate_ prefix.

This feature should be reasonably straightforward to implement in Dash for R, and it would help improve developer ergonomics if it were available.

@rpkyle
Copy link
Contributor Author

rpkyle commented Apr 27, 2020

Resolved by #140; closing.

@rpkyle rpkyle closed this as completed Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dash-stage-in_review enhancement feature request Community request for a package enhancement size: 1
Projects
None yet
Development

No branches or pull requests

2 participants