Skip to content

Nuke the Viewport component, FCize Canvas #1767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
94ac627
Replace Canvas placeholders with top/bottom padding
nstepien Oct 4, 2019
366a502
Move Viewport scroll state and logic into Canvas
nstepien Oct 4, 2019
08f462b
Nuke Viewport component
nstepien Oct 4, 2019
3a5176d
Nuke Viewport file
nstepien Oct 4, 2019
ad119e0
FCize Canvas
nstepien Oct 4, 2019
a2bcce6
completely unwrap the props object
nstepien Oct 4, 2019
1002572
Clean up a few props, fix tests
nstepien Oct 4, 2019
2c25355
Cleanup Canvas getRows
nstepien Oct 4, 2019
7337f21
Merge remote-tracking branch 'origin/am-improve-props' into ns-viewport
nstepien Oct 4, 2019
28e4261
Merge remote-tracking branch 'origin/am-improve-props' into ns-viewport
nstepien Oct 4, 2019
880d668
Merge remote-tracking branch 'origin/am-improve-props' into ns-viewport
nstepien Oct 4, 2019
8c02e97
fix new scrollLeft/Top usage in handleScroll
nstepien Oct 4, 2019
c516eed
Fix rowVisible{Start,End}Idx, improve top/bottom navigation accuracy
nstepien Oct 5, 2019
ca3d913
Don't use useMemo to get the clientHeight
nstepien Oct 5, 2019
5db09e1
Fix rowOverscanEndIdx usage
nstepien Oct 5, 2019
4ccf21c
Fix the tests
nstepien Oct 5, 2019
76f28ce
Move handleRowSelectionChange back in the root component to prevent s…
nstepien Oct 5, 2019
8e5805f
improve isScrolling example
nstepien Oct 5, 2019
c9b32a9
Remove viewportWidth props
nstepien Oct 5, 2019
7f64ab8
Remove scrollToRow, simplify/fix scrollToRowIndex usage
nstepien Oct 7, 2019
067afa6
Add a comment
nstepien Oct 7, 2019
c276753
Don't disable the eslint rule
nstepien Oct 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/scripts/example31-isScrolling.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useRef, useState } from 'react';
import ReactDataGrid from 'react-data-grid';
import exampleWrapper from '../components/exampleWrapper';
import React from 'react';
import { AreaChart, Area } from 'Recharts';

const getRandom = (min, max) => {
Expand All @@ -10,10 +10,17 @@ const getRandom = (min, max) => {
};

const ExpensiveFormatter = ({ isScrolling }) => {
if (isScrolling) {
const isReady = useRef(!isScrolling);
const [items] = useState(() => {
return [...Array(1000).keys()].map(i => ({ name: `Page ${i}`, uv: getRandom(0, 4000), pv: getRandom(0, 4000), amt: getRandom(0, 4000) })).slice(0, 50);
});

if (isScrolling && !isReady.current) {
return <div>is scrolling</div>;
}
const items = [...Array(1000).keys()].map(i => ({ name: `Page ${i}`, uv: getRandom(0, 4000), pv: getRandom(0, 4000), amt: getRandom(0, 4000) })).slice(0, 50);

isReady.current = true;

return (
<AreaChart
width={500}
Expand Down
Loading