X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Ftrending%2Ftrending.py;h=af1dc797220d3bd029f7e1eab4d38b7565d51d86;hb=refs%2Fchanges%2F62%2F36762%2F2;hp=99a571315af43f45d8afea6ec19f1011f911972e;hpb=1832b3e0127df9fefc4421502b5cd8da288ff576;p=csit.git diff --git a/resources/tools/dash/app/pal/trending/trending.py b/resources/tools/dash/app/pal/trending/trending.py index 99a571315a..af1dc79722 100644 --- a/resources/tools/dash/app/pal/trending/trending.py +++ b/resources/tools/dash/app/pal/trending/trending.py @@ -11,15 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Instantiate the Trending Dash applocation. +"""Instantiate the Trending Dash application. """ import dash -import dash_bootstrap_components as dbc +from ..utils.constants import Constants as C 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,17 +30,17 @@ def init_trending(server): dash_app = dash.Dash( server=server, - routes_pathname_prefix=u"/trending/", - external_stylesheets=[dbc.themes.LUX], + routes_pathname_prefix=C.TREND_ROUTES_PATHNAME_PREFIX, + external_stylesheets=C.EXTERNAL_STYLESHEETS ) - # Custom HTML layout layout = Layout( app=dash_app, - html_layout_file="pal/templates/trending_layout.jinja2", - spec_file="pal/trending/spec_test_selection.yaml", - graph_layout_file="pal/trending/layout.yaml", - data_spec_file="pal/data/data.yaml" + html_layout_file=C.TREND_HTML_LAYOUT_FILE, + graph_layout_file=C.TREND_GRAPH_LAYOUT_FILE, + data_spec_file=C.DATA_SPEC_FILE, + tooltip_file=C.TOOLTIP_FILE, + time_period=time_period ) dash_app.index_string = layout.html_layout dash_app.layout = layout.add_content()