diff --git a/src/Reusables/Sidebars.py b/src/Reusables/Sidebars.py index 7526d8e..3db3ae7 100644 --- a/src/Reusables/Sidebars.py +++ b/src/Reusables/Sidebars.py @@ -209,6 +209,17 @@ def pg5(): ), + html.Div([ + dmc.MultiSelect(id='Mdropdown51', label='Escolha a(s) disciplina(s)', value=[], + data=Disc, searchable=True, clearable=True) + ]), + + + html.Div([ + dmc.MultiSelect(id='Mdropdown52', label='Escolha o(s) professor(es)', value=[], + data=Prof, searchable=True, clearable=True) + ]), + html.Div([ html.Div([ @@ -218,7 +229,6 @@ def pg5(): ]), - html.Div([ dmc.Select(id='dropdown52', label='Regressão linear:', value=None, data=[ diff --git a/src/pages/pg4.py b/src/pages/pg4.py index 848548d..6fc3f40 100644 --- a/src/pages/pg4.py +++ b/src/pages/pg4.py @@ -60,10 +60,24 @@ @callback( Output('grid3', 'rowData'), Input('Dados_turmas', 'data'), + Input(component_id='Mdropdown41', component_property='value'), + Input(component_id='Mdropdown42', component_property='value'), ) -def Grid_maker(data): +def Grid_maker(data, mdrop1, mdrop2): + dff = pd.DataFrame(data) + + + if mdrop1: + dff = dff[dff['Disciplina'].isin(mdrop1)] + + if mdrop2: + dff = dff[dff['Professor'].isin(mdrop2)] + + + data = dff.to_dict('records') + return data @@ -90,7 +104,6 @@ def filterdata(n, rows, drop1): dff = pd.DataFrame(rows) - # Transformando os dados no eixo y em uma razão ao invés de número absoluto if drop1 == 'Média turma': var = drop1 diff --git a/src/pages/pg5.py b/src/pages/pg5.py index 212c69f..e782771 100644 --- a/src/pages/pg5.py +++ b/src/pages/pg5.py @@ -81,10 +81,24 @@ @callback( Output('grid4', 'rowData'), Input('Dados_turmas', 'data'), + Input(component_id='Mdropdown51', component_property='value'), + Input(component_id='Mdropdown52', component_property='value'), ) -def Grid_maker(data): +def Grid_maker(data, mdrop1, mdrop2): + dff = pd.DataFrame(data) + + + if mdrop1: + dff = dff[dff['Disciplina'].isin(mdrop1)] + + if mdrop2: + dff = dff[dff['Professor'].isin(mdrop2)] + + + data = dff.to_dict('records') + return data