Feat(uti): Last failed tests
[csit.git] / resources / tools / dash / app / pal / trending / trending.py
index dd323c5..1c64677 100644 (file)
 """Instantiate the Trending Dash applocation.
 """
 import dash
+import dash_bootstrap_components as dbc
 
 from .layout import Layout
 
 
-def init_trending(server):
+def init_trending(server, time_period=None):
     """Create a Plotly Dash dashboard.
 
     :param server: Flask server.
@@ -30,18 +31,16 @@ def init_trending(server):
     dash_app = dash.Dash(
         server=server,
         routes_pathname_prefix=u"/trending/",
-        external_stylesheets=[
-            u"/static/dist/css/styles.css",
-            u"https://fonts.googleapis.com/css?family=Lato",
-        ],
+        external_stylesheets=[dbc.themes.LUX],
     )
 
-    # Custom HTML layout
     layout = Layout(
         app=dash_app,
-        html_layout_file="pal/trending/html_layout.txt",
-        spec_file="pal/trending/spec_test_selection.yaml",
-        graph_layout_file="pal/trending/layout.yaml"
+        html_layout_file="pal/templates/trending_layout.jinja2",
+        graph_layout_file="pal/trending/layout.yaml",
+        data_spec_file="pal/data/data.yaml",
+        tooltip_file="pal/data/tooltips.yaml",
+        time_period=time_period
     )
     dash_app.index_string = layout.html_layout
     dash_app.layout = layout.add_content()