Called to create the initial HTML string that is loaded on page. Override this method to provide you own custom HTML. :Example: class MyDash(dash.Dash): def interpolate_index(self, **kwargs): return '''<!DOCTYPE html>
(
self,
metas="",
title="",
css="",
config="",
scripts="",
app_entry="",
favicon="",
renderer="",
)
| 1347 | return index |
| 1348 | |
| 1349 | def interpolate_index( |
| 1350 | self, |
| 1351 | metas="", |
| 1352 | title="", |
| 1353 | css="", |
| 1354 | config="", |
| 1355 | scripts="", |
| 1356 | app_entry="", |
| 1357 | favicon="", |
| 1358 | renderer="", |
| 1359 | ): |
| 1360 | """Called to create the initial HTML string that is loaded on page. |
| 1361 | Override this method to provide you own custom HTML. |
| 1362 | |
| 1363 | :Example: |
| 1364 | |
| 1365 | class MyDash(dash.Dash): |
| 1366 | def interpolate_index(self, **kwargs): |
| 1367 | return '''<!DOCTYPE html> |
| 1368 | <html> |
| 1369 | <head> |
| 1370 | <title>My App</title> |
| 1371 | </head> |
| 1372 | <body> |
| 1373 | <div id="custom-header">My custom header</div> |
| 1374 | {app_entry} |
| 1375 | {config} |
| 1376 | {scripts} |
| 1377 | {renderer} |
| 1378 | <div id="custom-footer">My custom footer</div> |
| 1379 | </body> |
| 1380 | </html>'''.format(app_entry=kwargs.get('app_entry'), |
| 1381 | config=kwargs.get('config'), |
| 1382 | scripts=kwargs.get('scripts'), |
| 1383 | renderer=kwargs.get('renderer')) |
| 1384 | |
| 1385 | :param metas: Collected & formatted meta tags. |
| 1386 | :param title: The title of the app. |
| 1387 | :param css: Collected & formatted css dependencies as <link> tags. |
| 1388 | :param config: Configs needed by dash-renderer. |
| 1389 | :param scripts: Collected & formatted scripts tags. |
| 1390 | :param renderer: A script tag that instantiates the DashRenderer. |
| 1391 | :param app_entry: Where the app will render. |
| 1392 | :param favicon: A favicon <link> tag if found in assets folder. |
| 1393 | :return: The interpolated HTML string for the index. |
| 1394 | """ |
| 1395 | return interpolate_str( |
| 1396 | self.index_string, |
| 1397 | metas=metas, |
| 1398 | title=title, |
| 1399 | css=css, |
| 1400 | config=config, |
| 1401 | scripts=scripts, |
| 1402 | favicon=favicon, |
| 1403 | renderer=renderer, |
| 1404 | app_entry=app_entry, |
| 1405 | ) |
| 1406 |
no test coverage detected