Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Callback init() TypeError under Windows 10

$
0
0

@JBLwar wrote:

Hello dash/plotly comunity!
I’m new to python in general and particularly with dash.

I write a script on linux (see below) including callbacks, working fine (layout+callback):

import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State 
from dash.exceptions import PreventUpdate

app = dash.Dash(__name__)
server = app.server
app.config['suppress_callback_exceptions'] = True

app.layout = html.Div([

    html.Div([
        html.Div([                
            html.Div([     
                ........................
                            html.Div([
                                html.Div([
                                    html.Div([
                                        html.P('Min')
                                    ]),
                                    html.Div([
                                        dcc.Input(
                                            id='Min',
                                            type='number',
                                            value=data[:,quantities.index(quantity)].min(),
                                        ),
                                    ])
                                ]),

                                html.Div([
                                    html.Div([
                                        html.P('Max')
                                    ]),
                                    html.Div([
                                        dcc.Input(
                                            id='Max',
                                            type='number',
                                            value=data[:,quantities.index(quantity)].max(),
                                        )                                      
                                    ])                                       
                                ]),

                            ],className='row'),

                ......................................

    ], className='row'),
])

#-------------- Callbacks -------------------
# ----------- Min/Max value -----------
@app.callback([
    Output('Min','value'),
    Output('Max','value'), 
],  [
    Input('Value_3d','value')
    ]
)

def update_slider(value):
    if value is None:
        raise PreventUpdate
    else:
        valuemin = data[:,quantities.index(value)].min()
        valuemax = data[:,quantities.index(value)].max()
        return valuemin, valuemax

But when I try to launch on my windows computer using my python env in anaconda. If I comment my callback the layout is working fine, otherwise it’s returning an error message :

Output('Min','value'),
TypeError: __init__() takes exactly 1 argument (3 given)

And I have no clue … Do you have any idea to solve or overpass it ?
Many Tanks

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles