Hello,
I’m looking to create a Modal Image in this example.
Modal Image
So the point is to enlarge an image on click and then have the option to close it. I’m currently using this method of show images on my dashboard.
import dash
import dash_html_components as html
import base64app = dash.Dash()
image_filename = ‘my-image.png’ # replace with your own image
encoded_image = base64.b64encode(open(image_filename, ‘rb’).read())
app.layout = html.Div([
html.Img(src=‘data:image/png;base64,{}’.format(encoded_image.decode()))
])if name == ‘main’:
app.run_server(debug=True)
Advice? Thanks in advance.