📣 Dash for R v0.4.0 released

I’m pleased to announce the release of Dash for R v0.4.0, which provides several new features while bundling in updates to all core Dash component libraries.

We’re also aiming for our first CRAN release this month, so look for that announcement to appear soon!

Changelog
https://github.com/plotly/dashR/releases/tag/v0.4.0

Highlights

  • Support for inline clientside callbacks in JavaScript #140

  • Support for arbitrary file extensions for assets within component libraries #186

  • show_undo_redo parameter is now supported for stepping through the history of the application state #194

  • Dash for R now requires dashHtmlComponents v1.0.3

  • Dash for R now requires dashCoreComponents v1.10.0

  • Dash for R now requires dashTable v4.7.0

Previous Releases

:mag_right: In Depth

Inline clientside callbacks

Dash for R used to require that JavaScript code to be executed by callbacks “clientside” was first placed into the assets folder, e.g. for a callback like this:

app$callback(
  output('output-clientside', 'children'),
  params=list(input('input', 'value')),
  clientsideFunction(
    namespace = 'clientside',
    function_name = 'display'
    )
)

one would also require adding a script like this clientside.js within assets:

if(!window.dash_clientside) {window.dash_clientside = {};}
window.dash_clientside.clientside = {
    display: function (value) {
        return 'Client says "' + value + '"';
    }
}

However, inline clientside callbacks make this extra step unnecessary. Now you have the option of composing JavaScript directly within your callbacks, like this:

app$callback(
  output('output-clientside', 'children'),
  params=list(input('input', 'value')),
  "
  function (value) {
        return 'Client says \\"' + value + '\\"';
  }"
)
2 Likes