Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Fixed rows columns #37

Merged
merged 66 commits into from
Aug 10, 2018
Merged

Fixed rows columns #37

merged 66 commits into from
Aug 10, 2018

Conversation

Marc-Andre-Rivet
Copy link
Contributor

Fixed columns and fixed rows

Started restructuring styles and making them more efficient

  • using a marker row to provide the expected width of columns
  • using stylesheet to provide most styles for cells instead of inlining styles

Marc-André Rivet added 30 commits July 30, 2018 16:55
- define base virtualization strategies
- define additional props
- add tscript support to project
- refactor controlledtable and table
# Conflicts:
#	dash_table/bundle.js
#	src/lib/components/Table.js
- no strategy & fe page strategy basics
- update props
- update fe and none strategy
- fix bug for when to create a new virtualizer
- copy/paste
- legacy behavior support (n-items + trailing)
- the build..
- fix cell key
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props
@Marc-Andre-Rivet
Copy link
Contributor Author

Running into some contradicting requirements between the fixed rows and the dropdown. Fixed rows require 'overflow-y: scroll', while the dropdown requires the overflow to be visible. Looking into what can be done..

@Marc-Andre-Rivet
Copy link
Contributor Author

Update: So yeah.. this is a bit of a pickle.. the structure is as follow:

container -> spreadsheet -> rows -> cells -> Dropdown / Select -> menu

container: provides the relative positioning
spreadsheet: provides the overflow rules

Decoupling the positioning and overflow allow for this type of scenario, but we would need the menu to be created as a child of container for the spreadsheet overflow / clipping to be prevented. Not sure there's enough flexibility with the Dropdown package to do something like that.. reading through the Dropdown & Select repos to gather intel for a solution, we are not the first ones to encounter this issue.

menu.style.top = (parentBoundingRect.y + parentBoundingRect.height) - relativeBoundingRect.y;
menu.style.left = parentBoundingRect.x - relativeBoundingRect.x;
menu.style.width = parentBoundingRect.width;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dropdown gets clipped by the overflow: auto/hidden/scroll.. to move around that, we make it absolutely positioned, find the relative parent and calculate the absolute position needed for it to be placed directly beneath its parent. Since the relative parent is above the element with overflow set, it does not get clipped.

@chriddyp
Copy link
Member

chriddyp commented Aug 9, 2018

It looks like this isn't working for me in Firefox 61. Firefox on the left, chrome on the right
fixed-rows-browser-comparison

@chriddyp
Copy link
Member

chriddyp commented Aug 9, 2018

It looks like there is a slight 1px shift starting at column 3 (presumabley where the <input/> starts?)

I'm testing this with the demo data and n_fixed_rows: 3
image

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented Aug 9, 2018

Answering to: #37 (comment)

Oh, nice! I did not test this on FF, only on Safari and Chrome.
Turns out stylesheets isn't standard across browsers.

Updating + I'll test against Edge tomorrow.

@chriddyp
Copy link
Member

chriddyp commented Aug 9, 2018

In FIrefox I also seem some odd scrolling in the headers with

            tableProps: {
                id: 'table',
                dataframe: clone(mockData.dataframe),
                columns: clone(mockData.columns),
                editable: true,
                // n_fixed_rows: 3,
                n_fixed_columns: 2,
                // row_deletable: true,
                // row_selectable: 'single',
                merge_column_headers: true
            },

image

@chriddyp
Copy link
Member

chriddyp commented Aug 9, 2018

I'm noticing this odd intermittent thing with horizontal scroll. If you look carefully in the input cell, it looks like the input is catching the horizontal scroll: the number inside the input moves left-to-right ever so slightly (like 1px?). If I move my mouse to the header, then it scrolls fine, and if I move my mouse to the border between the cells, it scrolls fine.

intermittent-column-scroll

@Marc-Andre-Rivet
Copy link
Contributor Author

Also experiencing weird stuff with the dropdowns (they cover the border/box-shadow)

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented Aug 10, 2018

Answering to: #37 (comment)

@chriddyp Updated to fix the scrolling issue when the table/column is not editable; when editable the problem was present before the PR, this is not a regression, I'll open an independent issue based on your comment and prioritize.

#40

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented Aug 10, 2018

Answering to: #37 (comment)

@chriddyp Overriding user agent defaults for table and input (Chrome -> 13px, FF -> 16px)
This will help a bit but is not a final fix. We need to rework the content of the headers further and move away from spans and probably go towards inline-block divs which will allow somewhat more predictable control over rendering.

@Marc-Andre-Rivet
Copy link
Contributor Author

Just found that the fix for the clipped dropdowns introduces a new problem for the fixed columns (lack of clipping)

image

@Marc-Andre-Rivet
Copy link
Contributor Author

Follow up to: #37 (comment)

Dropdown + fixed columns clipping fixed

@Marc-Andre-Rivet
Copy link
Contributor Author

@chriddyp Please have another go at it! Thx. Haven't fixed the dropdown styling, will fix it after or as part of the merge with your changes, as they impacted dropdowns too.

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit 043d821 into 3.0 Aug 10, 2018
Marc-Andre-Rivet added a commit that referenced this pull request Aug 17, 2018
* Virtualization (#36)

* virtualization
- define base virtualization strategies
- define additional props
- add tscript support to project

* virtualization
- refactor controlledtable and table

* virtualization
- no strategy & fe page strategy basics

* virtualization
- update props
- update fe and none strategy

* virtualization
- fix bug for when to create a new virtualizer

* virtualization

* virtualization
- copy/paste

* virtualization
- legacy behavior support (n-items + trailing)

* virtualization
- the build..

* virtualization
- fix cell key

* virtualization

* virtualization
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes

* remove expanded_rows and collapsable logic

* fix lint

* - refactor virtualization strategies
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props

* - viewport props (viewport dataframe & indices)
- ramda @types

* virtualization

* - virtualizer through memoize / controlled component instead of state

* fix render loop caused by virtualization when linked to BE

* be and fe usage examples

* restructure project

* refactor project structure

* clean up

* refactor virtualization (wip)

* clean up fe/be virtualization + paging + examples

* fix lint

* virtualization

* version 3.0.0dev

* revert

* revert

* revert

* fix lint

* fix pyling

* fix pylint

* pagination display

* pagination display

* fix demo code...

* fix pr comments

* fix pylint

* add tslint to build

* Fixed rows columns (#37)

* virtualization
- define base virtualization strategies
- define additional props
- add tscript support to project

* virtualization
- refactor controlledtable and table

* virtualization
- no strategy & fe page strategy basics

* virtualization
- update props
- update fe and none strategy

* virtualization
- fix bug for when to create a new virtualizer

* virtualization

* virtualization
- copy/paste

* virtualization
- legacy behavior support (n-items + trailing)

* virtualization
- the build..

* virtualization
- fix cell key

* virtualization

* virtualization
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes

* remove expanded_rows and collapsable logic

* fix lint

* - refactor virtualization strategies
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props

* - viewport props (viewport dataframe & indices)
- ramda @types

* virtualization

* - virtualizer through memoize / controlled component instead of state

* fix render loop caused by virtualization when linked to BE

* be and fe usage examples

* restructure project

* refactor project structure

* clean up

* refactor virtualization (wip)

* clean up fe/be virtualization + paging + examples

* fix lint

* virtualization

* version 3.0.0dev

* revert

* revert

* revert

* fix lint

* fix pyling

* fix pylint

* pagination display

* pagination display

* fix demo code...

* fix pr comments

* fix pylint

* add tslint to build

* refactor ControlledTable component + updates

* improve fixed rows

* refactor logic for creating headers and rows

* fixed columns

* build

* remove <Fragment> usage for 15.x support

* fix lint

* improve/fix styling in fixed_columns mode

* fixed rows and columns (wip)
* refactor some styling

* fix rendering with fixed columns

* fix binding

* demo app

* fix frozen columns (th cells) height

* change default cell width

* overflow scroll only if necessary

* dropdown not clipped by container/overflow

* fix percy test

* update builds

* update table style

* clean up styles

* fix FF styling

* not editable div instead of input

* fix header width

* no-clipping dropdown + clipping fixed columns

* fix fixed columns

* Merge with master

* readme update

* sort

* update python build

* fix sort

* rename version

* rebuild python dist

* 3.0 performance (#43)

* performance improvements
- use stylesheet element instead of inline styles for components
- refactor stylesheets usage (facade)
- switch out inputs for divs when inactive
- refactor cell component to simplify props
- update dataframe on blur instead of all changes

* remove testing div wrapper

* tslint - allow class arrow functions

* fix regression in stylesheet

* build python dist

* cell reorder

* fix dropdown regression

* - improve stylesheet facade
- fix column width bug
- improve fixed columns / rows styling

* fix dropdown menu regressions

* sanitize stylesheet columns overrides (w/ and w/o units)

* fix lint

* fix click when value is undefined|null|empty

* fix deletable columns

* n_fixed_columns must take hidden columns into consideration

* fix typo

* fix header merge with fixed columns

* update readme / limitations

* fix fixed cell rendering after columns props change

* fix fixed columns when hidden is not first or last of merged group

* fix lint

* cell alignment

* fix dropdown alignment
Marc-Andre-Rivet added a commit that referenced this pull request Aug 21, 2018
* virtualization
- define base virtualization strategies
- define additional props
- add tscript support to project

* virtualization
- refactor controlledtable and table

* virtualization
- no strategy & fe page strategy basics

* virtualization
- update props
- update fe and none strategy

* virtualization
- fix bug for when to create a new virtualizer

* virtualization

* virtualization
- copy/paste

* virtualization
- legacy behavior support (n-items + trailing)

* virtualization
- the build..

* virtualization
- fix cell key

* virtualization

* virtualization
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes

* remove expanded_rows and collapsable logic

* fix lint

* - refactor virtualization strategies
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props

* - viewport props (viewport dataframe & indices)
- ramda @types

* virtualization

* - virtualizer through memoize / controlled component instead of state

* fix render loop caused by virtualization when linked to BE

* be and fe usage examples

* restructure project

* refactor project structure

* clean up

* refactor virtualization (wip)

* clean up fe/be virtualization + paging + examples

* fix lint

* virtualization

* version 3.0.0dev

* revert

* revert

* revert

* fix lint

* fix pyling

* fix pylint

* pagination display

* pagination display

* fix demo code...

* fix pr comments

* fix pylint

* add tslint to build

* refactor ControlledTable component + updates

* improve fixed rows

* refactor logic for creating headers and rows

* Virtualization (#36)

* virtualization
- define base virtualization strategies
- define additional props
- add tscript support to project

* virtualization
- refactor controlledtable and table

* virtualization
- no strategy & fe page strategy basics

* virtualization
- update props
- update fe and none strategy

* virtualization
- fix bug for when to create a new virtualizer

* virtualization

* virtualization
- copy/paste

* virtualization
- legacy behavior support (n-items + trailing)

* virtualization
- the build..

* virtualization
- fix cell key

* virtualization

* virtualization
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes

* remove expanded_rows and collapsable logic

* fix lint

* - refactor virtualization strategies
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props

* - viewport props (viewport dataframe & indices)
- ramda @types

* virtualization

* - virtualizer through memoize / controlled component instead of state

* fix render loop caused by virtualization when linked to BE

* be and fe usage examples

* restructure project

* refactor project structure

* clean up

* refactor virtualization (wip)

* clean up fe/be virtualization + paging + examples

* fix lint

* virtualization

* version 3.0.0dev

* revert

* revert

* revert

* fix lint

* fix pyling

* fix pylint

* pagination display

* pagination display

* fix demo code...

* fix pr comments

* fix pylint

* add tslint to build

* fixed columns

* build

* remove <Fragment> usage for 15.x support

* fix lint

* improve/fix styling in fixed_columns mode

* fixed rows and columns (wip)
* refactor some styling

* fix rendering with fixed columns

* fix binding

* demo app

* fix frozen columns (th cells) height

* change default cell width

* overflow scroll only if necessary

* dropdown not clipped by container/overflow

* fix percy test

* update builds

* update table style

* clean up styles

* cypress e2e stub

* e2e stub

* e2e stub

* e2e stub

* e2e stub

* e2e stub

* Fixed rows columns (#37)

* virtualization
- define base virtualization strategies
- define additional props
- add tscript support to project

* virtualization
- refactor controlledtable and table

* virtualization
- no strategy & fe page strategy basics

* virtualization
- update props
- update fe and none strategy

* virtualization
- fix bug for when to create a new virtualizer

* virtualization

* virtualization
- copy/paste

* virtualization
- legacy behavior support (n-items + trailing)

* virtualization
- the build..

* virtualization
- fix cell key

* virtualization

* virtualization
- remove legacy (tail rows + display rows)
- be page virtualization strategy
- first be python prototypes

* remove expanded_rows and collapsable logic

* fix lint

* - refactor virtualization strategies
- placeholder for filter and sort
- placeholder for prototype / "state" readonly props

* - viewport props (viewport dataframe & indices)
- ramda @types

* virtualization

* - virtualizer through memoize / controlled component instead of state

* fix render loop caused by virtualization when linked to BE

* be and fe usage examples

* restructure project

* refactor project structure

* clean up

* refactor virtualization (wip)

* clean up fe/be virtualization + paging + examples

* fix lint

* virtualization

* version 3.0.0dev

* revert

* revert

* revert

* fix lint

* fix pyling

* fix pylint

* pagination display

* pagination display

* fix demo code...

* fix pr comments

* fix pylint

* add tslint to build

* refactor ControlledTable component + updates

* improve fixed rows

* refactor logic for creating headers and rows

* fixed columns

* build

* remove <Fragment> usage for 15.x support

* fix lint

* improve/fix styling in fixed_columns mode

* fixed rows and columns (wip)
* refactor some styling

* fix rendering with fixed columns

* fix binding

* demo app

* fix frozen columns (th cells) height

* change default cell width

* overflow scroll only if necessary

* dropdown not clipped by container/overflow

* fix percy test

* update builds

* update table style

* clean up styles

* fix FF styling

* not editable div instead of input

* fix header width

* no-clipping dropdown + clipping fixed columns

* fix fixed columns

* Merge with master

* readme update

* sort

* update python build

* fix sort

* rename version

* performance improvements
- use stylesheet element instead of inline styles for components
- refactor stylesheets usage (facade)
- switch out inputs for divs when inactive
- refactor cell component to simplify props
- update dataframe on blur instead of all changes

* remove testing div wrapper

* tslint - allow class arrow functions

* fix regression in stylesheet

* rebuild python dist

* build python dist

* cell reorder

* fix dropdown regression

* high level navigation and typing test

* navigation and selection tests in typescript using cypress

* remove old code

* refactor + cypress tests against Python BE / functional in CI

* add percy snapshots in JS

* update python tests

* pylint

* pylint

* pylint

* pylint

* pylint

* pylint

* pylint

* python3 map changed

* - improve stylesheet facade
- fix column width bug
- improve fixed columns / rows styling

* fix dropdown menu regressions

* sanitize stylesheet columns overrides (w/ and w/o units)

* fix lint

* 3.0 performance (#43)

* performance improvements
- use stylesheet element instead of inline styles for components
- refactor stylesheets usage (facade)
- switch out inputs for divs when inactive
- refactor cell component to simplify props
- update dataframe on blur instead of all changes

* remove testing div wrapper

* tslint - allow class arrow functions

* fix regression in stylesheet

* build python dist

* cell reorder

* fix dropdown regression

* - improve stylesheet facade
- fix column width bug
- improve fixed columns / rows styling

* fix dropdown menu regressions

* sanitize stylesheet columns overrides (w/ and w/o units)

* fix lint

* fix click when value is undefined|null|empty

* fix deletable columns

* n_fixed_columns must take hidden columns into consideration

* fix typo

* fix header merge with fixed columns

* update readme / limitations

* fix fixed cell rendering after columns props change

* fix fixed columns when hidden is not first or last of merged group

* fix lint

* cell alignment

* fix dropdown alignment

* fix e2e tests

* fix column width regression on navigate + test

* - improve keyboard navigation
- add tests for keyboard navigation
- add tests for column width
- improve stability of python BE for tests

* remove now renderer useless eslint file

* clean up tests implementation

* fix PR comments

* fix dropdown keyboard navigation

* pr - remove commented code
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the fixed-rows-columns branch October 12, 2018 13:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants