Skip to content

Commit

Permalink
master core: fix final styles
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel committed Sep 28, 2024
1 parent d7c9b4d commit 80cc997
Show file tree
Hide file tree
Showing 13 changed files with 298 additions and 187 deletions.
37 changes: 32 additions & 5 deletions Dashboard/dataset/datasetLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def generateDataSetDistributions(df: pd.DataFrame, feature, legendTranslations,
def datasetLayout(dataTranslations):
commonTranslations = findTranslationsParent(dataTranslations, 'common')
distributionTranslations = findTranslationsParent(commonTranslations, 'distributions')
distributionTooltipTranslations = findTranslationsParent(distributionTranslations, 'tooltip')
datasetTranslations = findTranslationsParent(commonTranslations, 'dataset')
datasetTooltipTranslations = findTranslationsParent(datasetTranslations, 'tooltip')
correlationTranslations = findTranslationsParent(commonTranslations, 'correlation')
Expand All @@ -54,7 +55,6 @@ def datasetLayout(dataTranslations):
[
dcc.Loading(
[
html.Div(id='dummy', style={'display': 'none'}),
html.Div([
html.Plaintext(
[
Expand All @@ -64,6 +64,7 @@ def datasetLayout(dataTranslations):
className="rules-title",
style={"font-size": "30px"},
),
html.Div(className='separator'),
html.Div(
[
html.Div(
Expand Down Expand Up @@ -107,7 +108,7 @@ def datasetLayout(dataTranslations):
html.Div(
id="modified-dataset-view", style={"overflow": "scroll", "border-radius": "5px"}
),
html.Div(id="test-tert"),
html.Div(className='separator'),
]
),
html.Div(
Expand All @@ -117,6 +118,7 @@ def datasetLayout(dataTranslations):
className="rules-title",
),
html.Div(id="dataset-view", style={"overflow": "scroll", "border-radius": "5px"}),
html.Div(className='separator'),
]
),
html.Div(
Expand All @@ -129,11 +131,35 @@ def datasetLayout(dataTranslations):
],
style={'max-width': '800px', 'margin': 'auto auto 5rem auto'}
),
html.Div(className='separator'),
dbc.Row(
[
html.Plaintext(
setText(distributionTranslations, 'title', 'dashboard.data.common.distributions'),
className="rules-title",
html.Div([
html.Plaintext(
setText(distributionTranslations, 'title',
'dashboard.data.common.distributions'),
className="rules-title",
),
html.I(
id="distributions-info",
className="fa fa-info-circle info-icon",
),
dbc.Tooltip(
[
html.Plaintext(
[
setText(distributionTooltipTranslations, 'text-1',
'dashboard.data.common.distributions.tooltip'),
html.Strong(setText(distributionTooltipTranslations, 'text-2',
'dashboard.data.common.distributions.tooltip'))
]
),
],
className="personalized-tooltip",
target="distributions-info",
),
],
className="title-hint-container",
),
dbc.Col([
html.Plaintext(
Expand Down Expand Up @@ -163,6 +189,7 @@ def datasetLayout(dataTranslations):
lg=6,
xl=6,
xxl=6, ),
html.Div(className='separator'),
html.Div(
[
html.Plaintext(
Expand Down
1 change: 1 addition & 0 deletions Dashboard/importances/importancesLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def importancesLayout(importanceTranslations):
html.Div(id="importance-output-upload"),
style={"padding-top": "20px"},
),
html.Div(className='separator'),
html.Div(
[
html.I(
Expand Down
59 changes: 53 additions & 6 deletions Dashboard/metrics/metricsLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import plotly.express as px
import plotly.graph_objects as go

id_sufix = ["confusion-matrix", "roc-curve", "pred-real", "real-pred"]
id_sufix = ["confusion-matrix", "roc-curve", "pred-real", "real-pred", "partial-dependence"]


# REGRESSOR FUNCTIONS
Expand Down Expand Up @@ -159,7 +159,9 @@ def metricsRegressorLayout(metricsTranslations):
regressorRealPredTranslations = findTranslationsParent(regressorTranslations, 'real-prediction')
regressorRealPredTooltipTranslations = findTranslationsParent(regressorRealPredTranslations, 'tooltip')

regressorDependenceTranslations = findTranslationsParent(regressorTranslations, 'partial-dependence')
regressorDependenceTranslations = findTranslationsParent(regressorTranslations, id_sufix[4])
regressorPartialDepTooltipTranslations = findTranslationsParent(regressorDependenceTranslations, 'tooltip')


layout = html.Div(
[
Expand All @@ -171,6 +173,7 @@ def metricsRegressorLayout(metricsTranslations):
style={'width': 'max-content', 'margin': 'auto', 'overflow': 'scroll'}),
],
),
html.Div(className='separator'),
dbc.Row(
[
dbc.Col(
Expand Down Expand Up @@ -283,12 +286,55 @@ def metricsRegressorLayout(metricsTranslations):
),
],
),
html.Div(className='separator'),
dbc.Row(
[
html.Plaintext(
setText(regressorDependenceTranslations, 'title',
'dashboard.metrics.regressor.partial-dependence'),
className="rules-title",
html.Div([
html.Plaintext(
setText(regressorDependenceTranslations, 'title',
'dashboard.metrics.regressor.partial-dependence'),
className="rules-title",
),
html.I(
id=f"{id_sufix[4]}-info",
className="fa fa-info-circle info-icon",
),
dbc.Tooltip(
[
html.Plaintext(
[
setText(regressorPartialDepTooltipTranslations, 'text-1',
f'dashboard.metrics.regressor.{id_sufix[4]}'
'.tooltip'),
html.Strong(
setText(regressorPartialDepTooltipTranslations, 'text-2',
f'dashboard.metrics.regressor.{id_sufix[4]}'
'.tooltip')
),
]
),
html.Plaintext(
[
setText(regressorPartialDepTooltipTranslations, 'text-3',
f'dashboard.metrics.regressor.{id_sufix[4]}'
'.tooltip'),
html.Strong(
setText(regressorPartialDepTooltipTranslations, 'text-4',
f'dashboard.metrics.regressor.{id_sufix[4]}'
'.tooltip'),
),
html.Strong(
setText(regressorPartialDepTooltipTranslations, 'text-5',
f'dashboard.metrics.regressor.{id_sufix[4]}'
'.tooltip')
),
]
),
],
className="personalized-tooltip",
target=f"{id_sufix[4]}-info",
),
], className="title-hint-container",
),
dbc.Col([
html.Plaintext(
Expand Down Expand Up @@ -757,6 +803,7 @@ def metricsClassifierLayout(metricsTranslations):
),
],
),
html.Div(className='separator'),
html.Div(
[
html.I(
Expand Down
5 changes: 4 additions & 1 deletion Dashboard/predictions/predictionsLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def predictionsLayout(predictionsTranslations):
],
style={"padding-top": "20px"},
),
html.Div(className='separator', id='separator'),
dbc.Row(
[
dbc.Col(
Expand Down Expand Up @@ -853,6 +854,7 @@ def graph_trees_predictions(cl, n, cut_point, positive_class):
Output("predictions-class_selector-title", "hidden"),
Output(f"{id_sufix[0]}-container", "hidden"),
Output(f"{id_sufix[1]}-container", "hidden"),
Output("separator", "hidden"),
Output("current-class-data", "data"),
State("path", "href"),
Input("select", "value"),
Expand Down Expand Up @@ -1044,6 +1046,7 @@ def getFigure(fig):
False if not isRegressor else True,
False,
False,
False,
json.dumps(
{
"prediction": predictions_graph_data["values"][positive_class] if not isRegressor else
Expand All @@ -1055,7 +1058,7 @@ def getFigure(fig):
raise PreventUpdate

else:
return [], [], [], [], True, True, True, True, True, None
return [], [], [], [], True, True, True, True, True, True, None

if not isRegressor:
@app.callback(
Expand Down
2 changes: 2 additions & 0 deletions Dashboard/specificTrees/specificTreesLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def specificTreesLayout(specificTreesTranslations):
],
className="tree-creator",
),
html.Div(className='separator container'),
dbc.Row(
[
dbc.Col(
Expand Down Expand Up @@ -113,6 +114,7 @@ def specificTreesLayout(specificTreesTranslations):
],
style={"padding-top": "20px"},
),
html.Div(className='separator container'),
html.Div(
[
html.Plaintext(
Expand Down
2 changes: 2 additions & 0 deletions Dashboard/surrogate/surrogateLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def surrogateLayout(surrogateTranslations):
],
className="tree-creator",
),
html.Div(className='separator container'),
dbc.Row(
[
dbc.Col(
Expand Down Expand Up @@ -98,6 +99,7 @@ def surrogateLayout(surrogateTranslations):
],
style={"padding-top": "20px"},
),
html.Div(className='separator container'),
html.Div(
[
html.Plaintext(
Expand Down
12 changes: 0 additions & 12 deletions app/home/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@

{% block content %}
<div class="container text-center index-container">
<div id="model-buttons">
<div>
<a id="classifier-models-button" href="/processor/manage_classifiers" class="btn linked-button-card" role="button" aria-pressed="true"></a>
</div>
<div>
<a id="regressor-models-button" href="/processor/manage_regressors" class="btn linked-button-card" role="button" aria-pressed="true"></a>
</div>
</div>
<br>
<br>
<h1 id="home-title" style="text-transform: uppercase;"></h1>
<hr>
<div id="home-info">
Expand Down Expand Up @@ -99,8 +89,6 @@ <h2 id="conclusion"></h2>
window.document.getElementById('tree-image').src = `/static/images/home-tree-${currentLang}.png`
const homeTranslations = await t(["home"]);
window.document.getElementById('home-title').innerHTML = homeTranslations['info-title'];
window.document.getElementById('classifier-models-button').innerHTML = homeTranslations["classifier-btn"] ?? 'home.classifier-btn';
window.document.getElementById('regressor-models-button').innerHTML = homeTranslations["regressor-btn"] ?? 'home.regressor-btn';

window.document.getElementById('home-index').innerHTML = homeTranslations["index"] ?? 'home.index';
window.document.getElementById('home-index-intro').innerHTML = homeTranslations["index-intro"] ?? 'home.index-intro';
Expand Down
Loading

0 comments on commit 80cc997

Please sign in to comment.