Hmm, share an example of what? An app which shows images in a grid?
import dash
from dash import html, dcc
import dash_bootstrap_components as dbc
import plotly.graph_objs as go
import numpy as np
# create an image
img = np.random.randint(0, 255, size=(640, 640))
# grid shape (4 rows, 3 columns)
grid = np.zeros((4, 3))
rows, _ = grid.shape
content = []
for r in range(rows):
row = grid[r, :]
row_content = []
for c in row:
row_content.append(
dbc.Col(
# that is the actual content of the grid, in this case just one graph
dcc.Graph(
figure=go.Figure(
data=go.Heatmap(z=img),
layout={
'width': 640,
'height': 640,
'xaxis': {'scaleanchor': 'y'}
},
)
)
)
)
dbc_rows = dbc.Row(
children=row_content,
justify='center',
)
content.append(dbc_rows)
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = html.Div(
[
dbc.Container(
id='container',
children=content,
fluid=True
),
]
)
if __name__ == '__main__':
app.run(debug=True)
mred layout grid