import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import itertools
import json
import pandas as pd
import numpy as np
import plotly

app = dash.Dash()

app.scripts.config.serve_locally = True
# app.css.config.serve_locally = True

ROW = [
    {'a': 'AA', 'b': 1},
]

options = {
    'row': [
        ['single row', ROW],
        ['five rows', ROW*5],
        ['thirty rows', ROW*30]
    ],
    'min_height': [
        ['none', None],
        ['800', 800],
        ['200', 200]
    ],
    'filterable': [
        ['true', True],
        ['false', False]
    ]
}

layout = []
for opt in itertools.product(options['row'],
                             options['min_height'],
                             options['filterable']):
    layout.extend([
        html.H3('row={}, min_height={}, filterable={}'.format(
            *[o[0] for o in opt]
        )),
        dt.DataTable(
            rows=opt[0][1],
            min_height=opt[1][1],
            filterable=opt[2][1]
        )
    ])

app.layout = html.Div(layout, className="container")


app.css.append_css({
    'external_url': 'https://codepen.io/chriddyp/pen/bWLwgP.css'
})

if __name__ == '__main__':
    app.run_server(debug=True)
