Handle loading component suites dynamically #46
Description
Related to plotly/dash-table-experiments#28 and plotly/dash-core-components#162
It was explained in more detail on the community boards https://community.plot.ly/t/display-tables-in-dash/4707/40?u=chriddyp:
A little context: When Dash serves the page, it crawls the app.layout to see which component libraries are being used (e.g. dash_core_components). Then, with this list of unique component libraries, it serves the necessary JS and CSS bundles that are distributed with those component libraries.
In this case, we’re serving dash_table_experiments on a separate page, as the response of a callback. Dash only sees dash_html_components and dash_core_components in the app.layout and so it doesn’t serve the necessary JS and CSS bundles that are required for the dash-table-components component that is rendered in the future.
This is a design flaw of Dash. For now, you can get around this issue by rendering a hidden dash-table-experiments component in the layout like:
app.layout = html.Div([
html.Div(id='content'),
dcc.Location(id='location', refresh=False),
html.Div(dt.DataTable(rows=[{}]), style={‘display’: ‘none’})
])
Ideally, we'd request dash's backend for the component suites on demand, rather than all upfront.