Ml go scatter 3d bootstrap. How?

hi

I’m traying to do a ml scatter 3d with bootstrap, using its 2d on, but finding a problem:


In the callback for output(s):
  z-variable.options
Output 0 (z-variable.options) is already in use.
Any given output can only have one callback that sets it.
To resolve this situation, try combining these into
one callback function, distinguishing the trigger
by using `dash.callback_context` if necessary.

no idea …

is this code ok:

# functionality is the same for both dropdowns, so we reuse filter_options
app.callback(Output("x-variable", "options"), [Input("y-variable", "value")])(
    filter_options
)
app.callback(Output("y-variable", "options"), [Input("x-variable", "value")])(
    filter_options
)

app.callback(Output("z-variable", "options"), [Input("x-variable", "value")])(
    filter_options
)
app.callback(Output("z-variable", "options"), [Input("y-variable", "value")])(
    filter_options
)

please help, how can I do a ml cluster in 3d with bootstrap?

The problem is, that you have two callbacks updating the same component. You have to combine the two callbacks into a single callback like so:

app.callback(
    Output("z-variable", "options"), 
    [
        Input("x-variable", "value"),
        Input("y-variable", "value")
    ]
).....

or use the MultiplexerTransfom from dash-extensions.

Have a read here:

EDIT: Did you actually read the error message you got?

Hi, thanks for helping.

I’ve changed that, but two errors appear:

TypeError: filter_options() takes 1 positional argument but 2 were given

what do I change here:

def filter_options(v):
    """Disable option v"""
    return [
        {"label": col, "value": col, "disabled": col == v}
        for col in dff.columns
    ]

and also this:

ValueError: Invalid property specified for object of type plotly.graph_objs.Layout: 'zaxis'

I assume you changed the code to what I said, so you have two Inputs and your function- which only has one parameter.

Please read the information given in the links and try to create some easy example apps.