Py.Cafe

maartenbreddels/

ipyflex-example-quickstart

Simple example from ipyflex

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from ipyflex import FlexLayout
import ipywidgets as ipw
# Create the widget dictionary for FlexLayout
widgets = {
    'Widget 1' : ipw.HTML('<h1>Widget 1</h1>'),
    'Widget 2' : ipw.HTML('<h1>Widget 2</h1>'),
    'Widget 3' : ipw.HTML('<h1>Widget 3</h1>'),
    'Widget 4' : ipw.HTML('<h1>Widget 4</h1>')
}
# Initialize an empty dashboard
FlexLayout(widgets, style={'height':'400px'})
# Load saved template with a non-editable dashboard
page = FlexLayout(widgets, style={'height':'400px'}, template='quickstart.json', editable=False, header=True)