Skip to content

Inline clientside callbacks in Dash for R #135

Closed

Description

@rpkyle

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.

Activity

  1. self-assigned this
    on Oct 31, 2019
  2. added this to the Dash v1.6 milestone on Nov 1, 2019
  3. modified the milestones: Dash v1.8, Dash Q1/2020 on Dec 2, 2019
  4. rpkyle commented on Apr 27, 2020

    @rpkyle
    ContributorAuthor

    Resolved by #140; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions