Skip to content

Commit

Permalink
added virtualRowData
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutman committed Aug 24, 2023
1 parent bf2326a commit 7c2217e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/components/dataset_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dash_bootstrap_components as dbc
from typing import List
import pandas as pd
import dash_ag_grid as dag

from ..utils.database import getProjectDataset
from ..utils.helpers import generate_generic_DataTable
Expand All @@ -25,8 +26,8 @@
dmc.TabsPanel(
[
html.Div(
html.Div(),
id="project-itemSet-div",
children=[dag.AgGrid(id="project-itemSet-table")],
),
],
value="table",
Expand Down Expand Up @@ -98,16 +99,30 @@ def updateProjectItemStore(projectId: str, projectData: List[dict]) -> List[dict

@callback(
Output("filteredItem_store", "data"),
[Input("projectItem_store", "data"), Input("tasks-dropdown", "value")],
[
Input("projectItem_store", "data"),
Input("tasks-dropdown", "value"),
Input("project-itemSet-table", "filterModel"),
Input("project-itemSet-table", "virtualRowData"),

This comment has been minimized.

Copy link
@littlefishna

littlefishna Jul 10, 2024

This input for virtualRowData would blow off the browser memory. Feels like it keeps occupying browser memory. plotly/dash-ag-grid#306

],
)
def updateFilteredItemStore(projectItemSet, selectedTask):
def updateFilteredItemStore(
projectItemSet, selectedTask, tableFilterModel, virtualRowData
):
### Update the filteredItemStore based on selected task...
print(
len(projectItemSet),
"items originally, going to to try and filter",
selectedTask,
)

if tableFilterModel:
print("JC Gets to figure out how to use this too to the dataframe!")
print(tableFilterModel)

if virtualRowData:
print(len(virtualRowData), "rows in the virtual data table..")

if projectItemSet:
df = pd.json_normalize(projectItemSet, sep="-")

Expand Down

0 comments on commit 7c2217e

Please sign in to comment.