Here is the MWE from the Clustergram documentation
import pandas as pd
import dash
from dash.dependencies import Input, Output
import dash_bio as dashbio
from dash import html, dcc
app = dash.Dash(__name__)
df = pd.read_csv('https://git.io/clustergram_brain_cancer.csv').set_index('ID_REF')
columns = list(df.columns.values)
rows = list(df.index)
app.layout = html.Div([
"Rows to display",
dcc.Dropdown(
id='my-default-clustergram-input',
options=[
{'label': row, 'value': row} for row in list(df.index)
],
value=rows[:10],
multi=True
),
html.Div(id='my-default-clustergram')
])
@app.callback(
Output('my-default-clustergram', 'children'),
Input('my-default-clustergram-input', 'value')
)
def update_clustergram(rows):
if len(rows) < 2:
return "Please select at least two rows to display."
figure=dashbio.Clustergram(
data=df.loc[rows].values,
column_labels=columns,
row_labels=rows,
color_threshold={
'row': 250,
'col': 700
},
hidden_labels='row',
height=800,
width=700
)
**figure.update_layout(**
** yaxis11=dict(**
** coloraxis_colorbar={'title':"My Title"},**
** ), **
** )**
return dcc.Graph(id='anything',figure=figure)
if __name__ == '__main__':
app.run_server(debug=True)
from the source dash-bio/_clustergram.py at master · plotly/dash-bio · GitHub it seems like the clustergram is yaxis11, hence my attempts
In general, i cannot get it to work.
My goal, overall, would be to set the ticks and ticklabels to custom values
Thanks!