Пример #1
0
def update_describe_cols(col):
    if (col != 0) and (col is not None):
        return du.data_profile_tables(variables, col).style_data_conditional
    else:
        return []
Пример #2
0
def update_describe_cols(col):
    if (col != 0) and (col is not None):
        return du.data_profile_tables(variables, col).columns
    else:
        return []
Пример #3
0
def update_describe(col, var_string):

    if (col != 0) and (col is not None):
        return du.data_profile_tables(var_string, col).data
    else:
        return []
Пример #4
0
                                 dict(name='Dropdown', args={'options': options, 'value': None, 'id': 'dropdown_3'})])

# -- make grids
figure_childs = du.figure_grid(3, layout_kwargs=layout_kwargs)
filter_controls = [dcc.Dropdown(options=[{'label': x, 'value': x} for x in selected_options],
                                id='filter_dropdown',
                                value=None)]


# -- LAYOUT
layout = html.Div([
    html.Div([
        row([
            column([html.H1('Dash Template', id='title'), *controls,
                    html.H2("Filter by:"), *filter_controls,
                    du.data_profile_tables(variables, layout_kwargs=table_layout_kwargs, id='ta_table')], className='two columns'),
            column(figure_childs, className='ten columns'), ])
    ])
])

# -- APP
# in place so we can reuse this script in multipage app. If run stand-alone, new all is initialized
if __name__ == 'template_app':
    from app import app
else:
    app = dash.Dash(__name__,
                    assets_folder=os.path.join(os.path.dirname(__file__)))
    app.layout = layout
    app.title = 'Dash template'

# -- CALLBACKS
Пример #5
0
def update_describe_cols(col, var_kids):
    variables = json.loads(var_kids)['variables'] if var_kids else {}
    if (col != 0) and (col is not None):
        return du.data_profile_tables(variables, col).style_data_conditional
    else:
        return []
Пример #6
0
    def test_data_profile_tables(self):

        table = du.data_profile_tables({})
        self.assertTrue(len(table.columns) == 2) and self.assertTrue(table.data == [])