Skip to content

Commit

Permalink
pagination works.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhang621 committed Nov 30, 2024
1 parent 81f792f commit 2943009
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion latentscope/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def query():
# only send back the first per_page rows
# per_page = 100
# rows_json = rows_json[:per_page]
# print("ROWS JSON", rows_json)

# send back the rows as json
return jsonify({
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/FilterDataTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function FilterDataTable({
setPageCount(totalPages);
}, [totalPages]);

console.log('==== FILTER DATA TABLE =====', { totalPages });
console.log('==== FILTER DATA TABLE =====', { indices, page });

const [expandedFeatureRows, setExpandedFeatureRows] = useState(new Set());

Expand Down
5 changes: 1 addition & 4 deletions web/src/pages/FullScreenExplore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,17 @@ function Explore() {
// Update defaultIndices when scopeRows changes
useEffect(() => {
if (scopeRows?.length) {
const start = page * PER_PAGE;
const end = start + PER_PAGE;
const indexes = scopeRows
.filter((row) => !deletedIndices.includes(row.ls_index))
.slice(start, end)
.map((row) => row.ls_index);
setDefaultIndices(indexes);

// get the total number of pages available
setPageCount(Math.ceil(scopeRows.length / PER_PAGE));
console.log('==== PAGE COUNT ====', pageCount);
}
}, [scopeRows]);


// ====================================================================================================
// Scatterplot related logic
// ====================================================================================================
Expand Down

0 comments on commit 2943009

Please sign in to comment.