Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Dash-canvas (R) and filter_null #53

@NKalavros

Description

@NKalavros

Hello all,

I was trying to translate an applet from Python to R, but encountered a problem. The snippet I used was from the tutorial at: https://dashr.plotly.com/dash-canvas

And it was this:

app <- Dash$new()

app$layout(
  htmlDiv(
    list(
      htmlH5("Press down the left mouse button and draw inside the canvas"),
      dashCanvas(id = 'canvas_101')
      
      )
    )
  )


app$run_server()

Which returns:

Error in filter_null(component$props) : 
  could not find function "filter_null"

Looking at the changelog https://github.com/plotly/dashR/blob/master/CHANGELOG.md, this function has been excised

I found the function to be:

filter_null <- function(x) {
  if (length(x) == 0 || !is.list(x)) return(x)
  x[!vapply(x, is.null, logical(1))]
}

And everything works normally afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions