From 0ea7be9e379897b4375ab5cf8c3bdf2bcfe0b072 Mon Sep 17 00:00:00 2001 From: Raheel Date: Thu, 10 Dec 2020 18:35:45 -0500 Subject: [PATCH 01/12] explain_button_added --- lib/dashboard.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/dashboard.py b/lib/dashboard.py index 33e482f..3b0ec52 100644 --- a/lib/dashboard.py +++ b/lib/dashboard.py @@ -212,19 +212,19 @@ def dash(self, df, mode): PLOTLY_LOGO = "https://i.ibb.co/ZTWtVDV/explainx-logo.png" menu = dbc.Row( - [ + [ dbc.Col(dbc.NavItem(dbc.NavLink("Home", href="/apps/")), - style={'width': "150px", 'fontSize': '10px'}), + style={'width': "150px", 'fontSize': '12px'}), dbc.Col(dbc.NavItem(dbc.NavLink("Global Explanation", href="/apps/global_explanation")), - style={'width': "150px", 'fontSize': '10px'}), + style={'width': "150px", 'fontSize': '12px'}), dbc.Col(dbc.NavItem(dbc.NavLink("Local Explanation", href="/apps/local_explanation")), - style={'width': "150px", 'fontSize': '10px'}), + style={'width': "150px", 'fontSize': '12px'}), dbc.Col(dbc.NavItem(dbc.NavLink("Feature Interaction", href="/apps/feature_interaction")), - style={'width': "150px", 'fontSize': '10px'}), + style={'width': "150px", 'fontSize': '12px'}), dbc.Col(dbc.NavItem(dbc.NavLink("Distributions", href="/apps/distribution")), - style={'width': "150px", 'fontSize': '10px'}), + style={'width': "150px", 'fontSize': '12px'}), dbc.Col(dbc.NavItem(dbc.NavLink("Cohort Analysis", href="/apps/cohort")), - style={'width': "150px", 'fontSize': '10px'}) + style={'width': "150px", 'fontSize': '12px'}) ], @@ -240,13 +240,20 @@ def dash(self, df, mode): dbc.Row( [ dbc.Col(html.Img(src=PLOTLY_LOGO, height="30px")), - dbc.Col(dbc.NavbarBrand("explainX.ai", className="ml-2", - style={'fontSize': '15px', 'color': 'black'})), + dbc.Col( + dbc.NavbarBrand("explainX.ai", + style={'fontSize': '15px', 'color': 'black'} + )), + dbc.Col( + dbc.Button("Explain your own model!", + color="danger", + style={ + 'fontSize': '12px'})) ], align="center", no_gutters=True, ), - href="https://www.explainx.ai", + href="https://www.explainx.ai/register", ), dbc.NavbarToggler(id="navbar-toggler"), From 78e375daca9f2b0a6f5430a2dd1b8acac9ab4ae1 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Fri, 11 Dec 2020 16:27:36 -0500 Subject: [PATCH 02/12] Update dashboard.py --- lib/dashboard.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/dashboard.py b/lib/dashboard.py index 3b0ec52..16b809b 100644 --- a/lib/dashboard.py +++ b/lib/dashboard.py @@ -198,15 +198,6 @@ def dash(self, df, mode): available_columns = list(df.columns) - # external_stylesheets = [dbc.themes.BOOTSTRAP, - # # { - # # 'href': 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css', - # # 'rel': 'stylesheet' - # # } - # ] - - # app = JupyterDash(__name__, external_stylesheets=external_stylesheets) - app.title = "explainX.ai - Main Dashboard" PLOTLY_LOGO = "https://i.ibb.co/ZTWtVDV/explainx-logo.png" @@ -253,7 +244,7 @@ def dash(self, df, mode): align="center", no_gutters=True, ), - href="https://www.explainx.ai/register", + href="https://www.github.com/explainx/explainx", ), dbc.NavbarToggler(id="navbar-toggler"), From 9398da67ffb8913c45a4282f06dcb12942c16f74 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:25:25 -0500 Subject: [PATCH 03/12] Create hotjar.js --- hotjar.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 hotjar.js diff --git a/hotjar.js b/hotjar.js new file mode 100644 index 0000000..36c3223 --- /dev/null +++ b/hotjar.js @@ -0,0 +1,8 @@ + (function(h,o,t,j,a,r){ + h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; + h._hjSettings={hjid:2146099,hjsv:6}; + a=o.getElementsByTagName('head')[0]; + r=o.createElement('script');r.async=1; + r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; + a.appendChild(r); + })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); From d2cc3fabc38bd48f7ccba057a37fd74f9a43d3b2 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:25:36 -0500 Subject: [PATCH 04/12] Update app.py --- lib/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/app.py b/lib/app.py index 318f57b..c04943a 100644 --- a/lib/app.py +++ b/lib/app.py @@ -12,9 +12,12 @@ } ] -app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True) +# external JavaScript files +external_scripts = ['https://www.google-analytics.com/analytics.js',] + +app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True, external_scripts=external_scripts) app.title = "explainX.ai - Main Dashboard" -server = app.server \ No newline at end of file +server = app.server From b85854499f75890fa8c8e633f3b42d2c015e9050 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:26:19 -0500 Subject: [PATCH 05/12] Update app.py --- lib/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app.py b/lib/app.py index c04943a..bfb8a55 100644 --- a/lib/app.py +++ b/lib/app.py @@ -13,7 +13,7 @@ ] # external JavaScript files -external_scripts = ['https://www.google-analytics.com/analytics.js',] +external_scripts = ['https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js'] app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True, external_scripts=external_scripts) From 7af0191fa1e902ba8ee0781e58a9a73d171c2667 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:33:55 -0500 Subject: [PATCH 06/12] Update app.py --- lib/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/app.py b/lib/app.py index bfb8a55..95356d4 100644 --- a/lib/app.py +++ b/lib/app.py @@ -13,7 +13,8 @@ ] # external JavaScript files -external_scripts = ['https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js'] +external_scripts = ['https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js', + {'src': 'https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js'}] app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True, external_scripts=external_scripts) From 0ab57cca4e51e04863c18f2d134443d8616a33e3 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:42:15 -0500 Subject: [PATCH 07/12] Create custom-script.js --- lib/assets/custom-script.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/assets/custom-script.js diff --git a/lib/assets/custom-script.js b/lib/assets/custom-script.js new file mode 100644 index 0000000..61967d6 --- /dev/null +++ b/lib/assets/custom-script.js @@ -0,0 +1,9 @@ + + (function(h,o,t,j,a,r){ + h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; + h._hjSettings={hjid:2146099,hjsv:6}; + a=o.getElementsByTagName('head')[0]; + r=o.createElement('script');r.async=1; + r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; + a.appendChild(r); + })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); From 3b2540593655639e5825813d9f2802039020acca Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 16:42:56 -0500 Subject: [PATCH 08/12] Update app.py --- lib/app.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/app.py b/lib/app.py index 95356d4..3a69f9a 100644 --- a/lib/app.py +++ b/lib/app.py @@ -18,6 +18,29 @@ app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True, external_scripts=external_scripts) +app.index_string = ''' + + + + {%metas%} + {%title%} + {%favicon%} + {%css%} + {%scripts%} + + +
My Custom header
+ {%app_entry%} +
+ {%config%} + + {%renderer%} +
+
My Custom footer
+ + +''' + app.title = "explainX.ai - Main Dashboard" From 83f4184160b20040cab97f1931aecd3f415ea4b7 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 17:43:09 -0500 Subject: [PATCH 09/12] Update app.py --- lib/app.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/app.py b/lib/app.py index 3a69f9a..e24899b 100644 --- a/lib/app.py +++ b/lib/app.py @@ -27,16 +27,26 @@ {%favicon%} {%css%} {%scripts%} + -
My Custom header
+ {%app_entry%}
{%config%} {%renderer%}
-
My Custom footer
+ ''' From 2abfa19dadbaf775c16a00f29f3660318142af05 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 17:51:29 -0500 Subject: [PATCH 10/12] Update app.py --- lib/app.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/app.py b/lib/app.py index e24899b..7f13221 100644 --- a/lib/app.py +++ b/lib/app.py @@ -12,11 +12,9 @@ } ] -# external JavaScript files -external_scripts = ['https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js', - {'src': 'https://raw.githubusercontent.com/explainX/explainx/share_button/hotjar.js'}] -app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True, external_scripts=external_scripts) + +app = JupyterDash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True) app.index_string = ''' @@ -27,16 +25,17 @@ {%favicon%} {%css%} {%scripts%} - + + From 66d5a22dd3baa03131f7718c114ba8c05c0f24a7 Mon Sep 17 00:00:00 2001 From: Raheel Ahmad Date: Wed, 23 Dec 2020 17:51:47 -0500 Subject: [PATCH 11/12] Update app.py --- lib/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app.py b/lib/app.py index 7f13221..7da2b57 100644 --- a/lib/app.py +++ b/lib/app.py @@ -24,7 +24,7 @@ {%title%} {%favicon%} {%css%} - {%scripts%} + + +