Skip to content
Advertisement

Updating boxplot when choosing rows

I need to allow users to choose particular rows in a data frame and generate a boxplot.

My implementation does not allow me to update a boxplot when I choose rows. Can somebody please point out what I do wrong? I am interested in only one column which is [‘Phase’].

Here is my implementation.

JavaScript

Advertisement

Answer

I am inexperienced with Dash, but from the example in the official reference, I would guess that the reason is that the value of the active cell is not being retrieved. I found an example of updating a graph by clicking on a data table, so I used that as a basic form to create the code with appropriate sample data. The key point is that I set the initial active cell, and in the callback, I extract the data frame from the row and column data of the latest active cell, from the row index, and use that as the graph data.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement