Skip to content
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

Uncaught TypeError: instance.resize is not a function #301

Closed
Tixierae opened this issue Mar 13, 2018 · 4 comments
Closed

Uncaught TypeError: instance.resize is not a function #301

Tixierae opened this issue Mar 13, 2018 · 4 comments

Comments

@Tixierae
Copy link

Tixierae commented Mar 13, 2018

Minimal reproducible example:

library(shiny)
library(C3) # install via devtools::install_github("tixierae/shinyJsTutorials/tutorials/materials2/C3")

server = function(input,output) {
    my_df = reactive({
        input$button
        my_df = list(a=runif(1,0,100),b=runif(1,0,100),c=runif(1,0,100))
        list(my_df=my_df)
    })
    output$my_pie1 = renderC3Pie({
        C3Pie(value = my_df()$my_df)
    })
}
ui = shinyUI(
    navbarPage(id="main", position = "fixed-top", title=NULL, inverse=T, selected="tab1",
        tabPanel("tab1",
            fluidRow(br(),br(),br(),
                actionButton("button", "Draw!"),
                C3PieOutput("my_pie1")
            )
        ),
        tabPanel("tab2",
            fluidRow(br(),br(),br(),
            )
        )
    )
)
shinyApp(ui=ui, server=server)

Procedure to reproduce the error (happens at least on Chrome and Firefox):

  • go to 'tab2'
  • generously zoom in or out
  • go back to 'tab1'. The app is now frozen.

Inspect on Chrome shows:

Uncaught TypeError: instance.resize is not a function
    at Object.resize (htmlwidgets.js:822)
    at exports.OutputBinding.shinyBinding.resize (htmlwidgets.js:526)
    at output_binding_adapter.js:12
    at OutputBindingAdapter.onResize (utils.js:114)
    at HTMLDivElement.<anonymous> (init_shiny.js:305)
    at Function.each (jquery.min.js:2)
    at n.fn.init.each (jquery.min.js:2)
    at j (init_shiny.js:298)
    at Debouncer.$invoke (input_rate.js:56)
    at Debouncer.immediateCall (input_rate.js:44)

I'm working with the dev version of htmlwidgets (installed from GitHub).
C3 is originally from the frissanalytics tutorials (https://shiny.rstudio.com/articles/js-widget-functionality.html). I just modified the colors of the pie chart.

@timelyportfolio
Copy link
Collaborator

Hi @Tixierae, I know it is hard to know sometimes where to post an issue, but please try not to crosspost and if you do, please list where all you have asked a question FrissAnalytics/shinyJsTutorials#17. This is not an htmlwidgets issue, so I will answer there.

@Tixierae
Copy link
Author

Thanks for the quick reply. My apologies! I didn't know that crossposting was considered bad practice.

@timelyportfolio
Copy link
Collaborator

@Tixierae hard to keep up with all the rules of the internet :) Hope the answer helps.

@Tixierae
Copy link
Author

Tixierae commented Apr 5, 2018

@timelyportfolio Any chance you could look into this issue: FrissAnalytics/shinyJsTutorials#18?
Your help would be much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants