'Chage a different vol with Dash_Slicer

I’m trying to change automatically the vol when someone choose the option from the dropdown, I have eje2.npz, eje3.npz, eje4.npz. This in order to have a different database and show different images with dashslider. The dash_slider doesnt have an id as other ddc. I am out of ideas.

import dash
import dash_html_components as html
import imageio
import dash_bootstrap_components as dbc
from dash_slicer import VolumeSlicer
from dash import Dash, dcc, html, Input, Output  

app = dash.Dash(__name__, update_title=None)

vol = imageio.volread("eje1.npz")
slicer = VolumeSlicer(app, vol)
slicer.graph.config["scrollZoom"] = False

app.layout = dbc.Container([
    
                        dbc.Row([ 
                            html.H1("Reporte sobre postura", style={'text-align': 'center'}),
                            ]),
                        dbc.Row([
                            dbc.Col([
                                dcc.Dropdown(id="slct_30",
                                              options=[
                                                  {"label": "PRIMER", "value": 1},
                                                  {"label": "SEGUNDO", "value": 2},
                                                  {"label": "TERCERO", "value": 3},
                                                  {"label": "CUARTO", "value": 4}],
                                              multi=False,
                                              value=1,
                                              style={'width': "80%"}
                                              ),
                            
                                html.Div(id='output_container', children=[]),
                                html.Br(),
                            ],width={'size':5, 'offset':5},),
                        ]),
                        dbc.Row([ 
                                slicer.graph, slicer.slider, *slicer.stores
                                 
                            ]),
                        ])



@app.callback(
    [Output(component_id='output_container',component_property='children')],
    [Output(component_id='post_%', component_property='figure')],
    [Input(component_id='slct_30', component_property='value')]
)
def update_graph(option_slctd):
    print(option_slctd)
    print(type(option_slctd))
    container = "LAPSO DE 30 MINUTOS: {}".format(option_slctd)
    
    
    
    return container

if __name__ == "__main__":
    app.run_server(debug=True, dev_tools_props_check=False)

`



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source