I want to change te vol info and update the slider.graph with a callback, but it doesnt work. How can i solve this?
#--------------------------------Ejemplo sencillo
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([
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%"}
)
],width={'size':5, 'offset':5},),
]),
dbc.Row([
html.Div([
html.Br(),
slicer.graph,
slicer.slider,
*slicer.stores
]),
])
])
@app.callback(
# [Output(component_id=‘output_container’,component_property=‘children’)],
[Output(slicer.graph.id, component_property=‘figure’)],
# [Output(slicer.slider.id, 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)
vol = imageio.volread("eje"+option_slctd+".npz")
nslicer = VolumeSlicer(app, vol)
nslicer.graph.config["scrollZoom"] = False
return nslicer.graph
# return container
if name == “main”:
app.run_server(debug=True, dev_tools_props_check=False)