X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=csit.infra.dash%2Fapp%2Fcdash%2Fnews%2Fnews.py;h=b5cc5483a8c8613e6f592809aab6c7ee3a3cef4c;hb=c31372861134f29ae6eec8d98874e030e57ab5f1;hp=eda70d385fe21d4b50a025a0271a5a4ca2028454;hpb=20432cc3b4321f16c82e22ac54d6bf979391ee71;p=csit.git diff --git a/csit.infra.dash/app/cdash/news/news.py b/csit.infra.dash/app/cdash/news/news.py index eda70d385f..b5cc5483a8 100644 --- a/csit.infra.dash/app/cdash/news/news.py +++ b/csit.infra.dash/app/cdash/news/news.py @@ -14,16 +14,25 @@ """Instantiate the News Dash application. """ import dash +import pandas as pd from ..utils.constants import Constants as C from .layout import Layout -def init_news(server): +def init_news( + server, + data_stats: pd.DataFrame, + data_trending: pd.DataFrame + ) -> dash.Dash: """Create a Plotly Dash dashboard. :param server: Flask server. :type server: Flask + :param data_stats: Pandas dataframe with staistical data. + :param data_trending: Pandas dataframe with trending data. + :type data_stats: pandas.DataFrame + :type data_trending: pandas.DataFrame :returns: Dash app server. :rtype: Dash """ @@ -37,9 +46,9 @@ def init_news(server): layout = Layout( app=dash_app, - html_layout_file=C.HTML_LAYOUT_FILE, - data_spec_file=C.DATA_SPEC_FILE, - tooltip_file=C.TOOLTIP_FILE, + data_stats=data_stats, + data_trending=data_trending, + html_layout_file=C.HTML_LAYOUT_FILE ) dash_app.index_string = layout.html_layout dash_app.layout = layout.add_content()