Skip to content

Commit

Permalink
Retornando a opção de selecionar os professores e disciplinas com dro…
Browse files Browse the repository at this point in the history
…pdowns multi nas páginas 4 e 5.
  • Loading branch information
Oesterd committed Mar 5, 2024
1 parent a12cc33 commit 42be63d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/Reusables/Sidebars.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -218,7 +229,6 @@ def pg5():
]),



html.Div([
dmc.Select(id='dropdown52', label='Regressão linear:', value=None,
data=[
Expand Down
17 changes: 15 additions & 2 deletions src/pages/pg4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
Expand Down
16 changes: 15 additions & 1 deletion src/pages/pg5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 42be63d

Please sign in to comment.