I have no idea why this is happening and dont understand what to do to fix it. Any help appreciated.
Here is my code:
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(name, external_stylesheets = external_stylesheets)
app.layout = html.Div([
html.Div([
html.Div([
dcc.Dropdown(
id='xaxis_column',
options=[{'label': i.title(), 'value': i} for i in finalDf_tsne[PCA_tSNE_features]],
value='PC1',
className="four columns"
)],
style={'width': '25%', 'display': 'inline-block'}),
html.Div([
dcc.Dropdown(
id='yaxis_column',
options=[{'label': i.title(), 'value': i} for i in finalDf_tsne[PCA_tSNE_features]],
value='PC2',
className="four columns"
)],
style={'width': '25%', 'display': 'inline-block'}),
html.Div([
dcc.Dropdown(
id='zaxis_column',
options=[{'label': i.title(), 'value': i} for i in finalDf_tsne[PCA_tSNE_features]],
value='PC3',
className="four columns"
)],
style={'width': '25%', 'display': 'inline-block'}),
html.Div([
dcc.Dropdown(
id='protein',
options=[{'label': i.title(), 'value': i} for i in finalDf_tsne[features]],
value='C3d',
className="four columns"
)],
style={'width': '25%', 'display': 'inline-block'})
]),
html.Div([dcc.Graph(id='indicator-graphic')])
], className="container")
@app.callback(
Output(‘indicator-graphic’, ‘figure’),
[Input(‘xaxis_column’, ‘value’),
Input(‘yaxis_column’, ‘value’),
Input(‘zaxis_column’, ‘value’),
Input(‘protein’, ‘value’)])
def update_graph(xaxis_column_name, yaxis_column_name, zaxis_column_name, protein_name):
col = finalDf_tsne[protein_name]
return {
'data': go.scatter3d(
x=finalDf_tsne[xaxis_column_name],
y=finalDf_tsne[yaxis_column_name],
z=finalDf_tsne[zaxis_column_name],
mode='markers',
marker={'size': 8, 'color': col, 'colorscale': 'Jet', 'opacity': 0.8, "showscale": True,
"colorbar": {"thickness": 15, "len": 0.5, "x": 0.8, "y": 0.6, },}),
'layout': go.Layout(
xaxis={
'title': xaxis_column_name,
'type': 'linear'},
yaxis={
'title': yaxis_column_name,
'type': 'linear'},
zaxis={
'title': zaxis_column_name,
'type': 'linear'},
scene={"aspectmode": "cube"}
)
}
app.run_server(debug=False)