Skip to content

Commit e67f58c

Browse files
Develop (#133)
* 3.1 props refactoring (#106) * refactor virtualization, virtualization settings, and derived props * refactor renaming paging / pagination props * refactor virtual, viewport and pagination into adapters * isolate derived props * build update * fix regression * improve typing * fix test regression * simplify pagination adapter / refactor * lint * clean up unused props * - change factory - clean up props / build update * fix lint * bump version * add dash level props for virtual_dataframe * refactor fp / derived props * derived props * refactor viewport and virtual controlled props * fix fp regression * fix fp regression * refactor controlled table / table fp * controlled table purecomponent * fix test (rebrake it!) * fix selection regression for be paging/sorting/filtering * improve re-renders & controlled props * fix test regressions * update inner-selection fixture * remove useless spy * - fix pr comment - fix for IE/Edge * clean up * 3.0 clean offsets (#110) * refactor virtualization, virtualization settings, and derived props * refactor renaming paging / pagination props * refactor virtual, viewport and pagination into adapters * isolate derived props * build update * fix regression * improve typing * fix test regression * simplify pagination adapter / refactor * lint * clean up unused props * - change factory - clean up props / build update * fix lint * bump version * add dash level props for virtual_dataframe * cleaup offsets * triad validation * - define external facing classes and attributes * fix regression, update build * fix test regression (invalid props) * update test name * refactor fp / derived props * derived props * refactor viewport and virtual controlled props * fix fp regression * fix fp regression * refactor controlled table / table fp * controlled table purecomponent * fix test (rebrake it!) * fix selection regression for be paging/sorting/filtering * improve re-renders & controlled props * fix test regressions * update inner-selection fixture * remove useless spy * - control columns into visible columns - cleanup "hidden" conditional processing * update changelog * clean up header factory * apply style on first controlled table render * typo/merge miss * derived visible columns * - visual tests for hidden columns * rename functions * - fix dropdown styling regression * lint * 3.1 props fixes (#112) * props fixes * update changelog * bump version * filter typing * Update derivedViewport_test.ts Add basic viewport test with |df| > page_size * ☝️ 3 new review / documentation / target apps see discussion in plotly/dash-table#108 * 🙈 forgot file * 📝 incorporate @cldougl suggestions 🙇 * 3.1 refactor tests (#113) * props fixes * update changelog * bump version * filter typing * - delete unused usage files - restructure tests folder * - separate cypress and visual tests into 2 ci jobs * - build before tests! * add browsers to the node image for visual-test * 💯 add percent examples * 📝 title/example clarification * reformat sizing test app for failing tests (#125) * Removed .only from dash_test.ts * Production build instead of dev 🙈 * Fix failing tests * 3.1 refactor cells rendering (#123) * WIP - memoize cell event handlers as derived values - isolate cell event handlers * wip - attempt to isolate cell logic from input logic for individual datum * wip - celan up cell wrapper - isolate input logic a bit more * further down the rabbit hole.. - separating operation cells from content * fix dropdown navigation regression * fix selected row regression * renaming / restructuring * rename/restructure * - clean up zipping - separate wrappers from styles * rework style/ast cache * clean up * clean up * build update * improve rendering perf * optimize wrappers generation * build config * - fix typing regression - fix rendering perf regression * - fix navigation regression * simplify slightly the derived props / ui * fix copy/paste regressions * clean up wrapper props * clean up * fix regression on conditional dropdowns * wip, fp the headers * fp content, wrappers, labels, indices from header factory * fix regressions * fp the table itself * fix typing and behavior for table fp * fix sorting icon regression * fix regression * regression * fix column name regression with only 1 header row * fix header actions regression * fix style application on mount * fix regression edit cell in n-th page * fix editing on non-first page (continued) * fix test * 3.1 issue118 width behavior (#130) * WIP - memoize cell event handlers as derived values - isolate cell event handlers * wip - attempt to isolate cell logic from input logic for individual datum * wip - celan up cell wrapper - isolate input logic a bit more * further down the rabbit hole.. - separating operation cells from content * fix dropdown navigation regression * fix selected row regression * renaming / restructuring * rename/restructure * - clean up zipping - separate wrappers from styles * rework style/ast cache * clean up * clean up * build update * improve rendering perf * optimize wrappers generation * build config * - fix typing regression - fix rendering perf regression * - fix navigation regression * simplify slightly the derived props / ui * fix copy/paste regressions * clean up wrapper props * clean up * fix regression on conditional dropdowns * wip, fp the headers * fp content, wrappers, labels, indices from header factory * fix regressions * fp the table itself * fix typing and behavior for table fp * fix sorting icon regression * fix regression * regression * fix column name regression with only 1 header row * fix header actions regression * add width percentage support + content_style * fix style application on mount * fix visual regression with empty df * only apply row style when necessary * fix tab test (no offset) * clean up header styling * use dash-* classes * support default column width (override input behavior) * fix regression edit cell in n-th page * fix editing on non-first page (continued) * fix test * fit to content behavior * fix regressions * fix lint * add column width visual tests * fix dropdown minimum size when using default width * sizing examples * black * fix navigation test regression * fix regressions in visual tests * default column width - fix dropdown width eval * default width columns - fix width when first content row is search filter * percy - add delay before screenshot (attempt to fix FF visual tests) * debugging selenium * fix black * debug selenium * debug selenium * fix black * debug selenium * debug selenium * debug selenium * undo all selenium modifications * default column width - filter inputs behave like cell inputs (do not affect width) * - fixed rows+columns height evaluated correctly * remove dead code * remove .only from tests * add data-dash-column to filter cells * styling examples (#117) * 🌈 styling examples examples that represent of the level of customization that we need in dash-table. The examples are implemented with HTML tables to demonstrate the intended behaviour. I’d like to see each of these examples implemented with the `dash_table` syntax. We’ll use these examples as our `dash-table` documentation * ❌ removing black and pylint this keeps tripping us up and I don’t think it’s worth the pain right now. * Backend examples (#119) * 🏭 backend computed data usage examples * 📊 tying it together w a graph * ❓ not sure what `displayed_pages` does? * Dropdown usage examples (#120) * ⬇️ dropdown usage examples * add conditional dropdown example
1 parent fc73b3c commit e67f58c

File tree

113 files changed

+4817
-2382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+4817
-2382
lines changed

Diff for: packages/dash-table/.circleci/config.yml

+31-15
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,40 @@ jobs:
4949
command: npm run build:py
5050

5151
- run:
52-
name: Run hosts
52+
name: Run tests
5353
command: |
5454
. venv/bin/activate
5555
npm run test
5656
57+
58+
"visual-test":
59+
docker:
60+
- image: circleci/node:8.11.3-browsers
61+
62+
steps:
63+
- checkout
64+
65+
- restore_cache:
66+
key: deps1-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}-{{ checksum "package.json" }}
67+
68+
- run:
69+
name: Install package.json
70+
command: npm i
71+
72+
- save_cache:
73+
key: deps1-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}-{{ checksum "package.json" }}
74+
paths:
75+
- node_modules
76+
77+
- run:
78+
name: Run build:js
79+
command: npm run build:js
80+
81+
- run:
82+
name: Run visual tests
83+
command: npm run test.visual
84+
85+
5786
"node":
5887
docker:
5988
- image: circleci/node:8.11.3
@@ -114,20 +143,6 @@ jobs:
114143
paths:
115144
- "venv"
116145

117-
- run:
118-
name: Run black
119-
command: |
120-
. venv/bin/activate
121-
black tests/dash --check
122-
when: always
123-
124-
- run:
125-
name: Run pylint
126-
command: |
127-
. venv/bin/activate
128-
flake8 tests.dash
129-
when: always
130-
131146
- run:
132147
name: Run integration tests
133148
command: |
@@ -143,3 +158,4 @@ workflows:
143158
- "python-3.6"
144159
- "node"
145160
- "test"
161+
- "visual-test"

Diff for: packages/dash-table/.config/webpack/base.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = (preprocessor = {}, mode = 'development') => {
6262
},
6363
resolve: {
6464
alias: {
65-
'cypress': path.resolve('./tests/e2e/cypress/src'),
65+
'cypress': path.resolve('./tests/cypress/src'),
6666
'dash-table': path.resolve('./src/dash-table'),
6767
'core': path.resolve('./src/core'),
6868
'tests': path.resolve('./tests')

Diff for: packages/dash-table/CHANGELOG.md

+114-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
# Version 3.0 (ALPHA)
4+
5+
Version 3.0 of the Dash-Table expands vastly on the capability of the 2.x table and provides features:
6+
7+
- visually freezing rows and/or columns
8+
- filtering in either FE or BE, basic filtering UI
9+
- sorting in either FE or BE, basic sorting UI
10+
- pagination in either FE or BE, basic pagination UI
11+
- performance optimizations
12+
- basic coverage through e2e, integration and unit tests
13+
314
## RC1, RC2, RC3, RC4 (Virtualization, Freeze, Deletable & Editable Columns, Performance)
415

516
### Virtualization
@@ -189,14 +200,111 @@
189200

190201
Sorting arrow will no longer highlight.
191202

192-
## RC23 - Width percentage
203+
# Version 3.1 (BETA)
204+
205+
Version 3.1 of the Dash-Table builds upon the 3.0 table and solidifies the external facing API of the table
206+
207+
- introducing the notion of derived properties
208+
209+
- virtual and viewport dataframe and indices for more flexibility
210+
- code refactoring to simplify and improve the existing implementation / prepare for the future
211+
- documentation of the API and table features
212+
- additional e2e, integration and unit tests for a more mature development platform
213+
214+
### Derived Properties
215+
216+
Derived properties are new to 3.1
217+
They are readonly properties that represent a transform from multiple 'first-class' properties of the component.
218+
219+
For example, derived_viewport_dataframe is a readonly view based on
220+
f(dataframe, filtering params, sorting params, pagination params) --> derived_viewport_dataframe
221+
222+
Derived properties allow the component to expose complex state that can be useful for a Dash Server developer but without introducing dual states, a situation where multiple properties may represent the same state within the component, making it necessary to reconcile them on each prop update.
223+
224+
## RC1 - Virtual and Viewport Dataframe
225+
226+
- 4 new external facing derived properties and 4 internal facing controlled properties that represent:
227+
1. the filtered and sorted dataframe and the indices mapping
228+
2. the filtered, sorted and paginated dataframe and the indices mapping
229+
230+
- derived_viewport_dataframe
231+
- derived_viewport_indices
232+
- derived_virtual_dataframe
233+
- derived_virtual_indices
234+
235+
In the event where sorting, filtering or pagination is done on the Dash Server, it is possible that some or all derived dataframes will be equal to the dataframe prop.
236+
237+
## RC2 - Clean up column offsets
238+
239+
- 1 new internal facing derived/controlled property:
240+
columns: Columns -> columns: VisibleColumns
241+
Gets rid of conditional processing for hidden columns in the cell and header factories as well as in navigation/selection handlers
242+
243+
- A bunch of offsets were introduced to the table in the previous development cycle (2.x -> 3.0). Turns out these offsets are neither useful or necessary
244+
- Validate compatibility of filtering, sorting, pagination
245+
- External facing classes and attributes
246+
* (ATTRIBUTE) data-dash-column=<columnId>
193247

194-
Columns can now accept '%' width, minWidth, maxWidth.
248+
.dash-cell,
249+
.dash-header {
250+
&[data-dash-column='ticker'] {
251+
// styling
252+
}
253+
}
254+
255+
* (CLASS) dash-cell
256+
* (CLASS) dash-header
257+
258+
* (CLASS) dash-delete-cell
259+
* (CLASS) dash-delete-header
260+
* (CLASS) dash-select-cell
261+
* (CLASS) dash-select-header
262+
263+
* (CLASS) dash-cell-value
264+
265+
* (CLASS) dash-freeze-left
266+
* (CLASS) dash-freeze-top
267+
* (CLASS) dash-spreadsheet
268+
* (CLASS) dash-spreadsheet-container
269+
* (CLASS) dash-spreadsheet-inner
270+
271+
## RC3 - Miscellaneous fixes for pagination, virtual df and viewport df
272+
273+
Issue: https://github.com/plotly/dash-table/pull/112
274+
275+
## RC4 - Columns width percentage and default (fit to content) support
276+
277+
* Added prop content_style that takes values 'fit' or 'grow' (Default='fit')
278+
* Added width percentage support
279+
* Modified default column behavior from fixed width to 'fit content'
280+
* Modified width, min-width, max-width interaction on columns
281+
282+
### Width percentage
283+
284+
Columns can now accept '%' width, minWidth, maxWidth
195285

196286
For the percentages to have meaning, the dash-table must be forced to have a width and the content of the dash-table must be forced to grow to fill the available space made available by the container (by default the table is only as big as it needs to be).
197287

198-
Added prop content_style that takes values 'fit' or 'grow' (Default='fit')
288+
To use percentage-based column widths, add:
289+
290+
* content style
291+
content_style='grow'
292+
293+
* table style (example)
294+
table_style=[{ selector: '.dash-spreadsheet', rule: 'width: 100%; max-width: 100%' }]
295+
296+
* column with %-based width
297+
columns=[{
298+
id: 'column',
299+
width: '40%'
300+
}]
301+
302+
### Default column width
303+
304+
Columns now default to 'fit to content' when no width is defined
305+
306+
Note: If pagination is used or the dataframe modified, the column width will be re-evaluated on each modification.
307+
308+
### Interaction between width, min-width and max-width
199309

200-
1. Add the prop content_style='grow' to make the table fill its space, this will make sure the % are applied to all the space available.
201-
2. Add the following selector (with the proper values) to the table_style prop
202-
{ selector: '.dash-spreadsheet', rule: 'width: 100%; max-width: 100%' }
310+
Column min-width and max-width do not default to width value is not defined.

Diff for: packages/dash-table/TODO.md

-95
This file was deleted.

Diff for: packages/dash-table/cypress.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"video": false,
3-
"fixturesFolder": "./tests/e2e/cypress/fixtures",
4-
"integrationFolder": "./tests/e2e/cypress/integration",
5-
"pluginsFile": "./tests/e2e/cypress/plugins/index.js",
6-
"screenshotsFolder": "./tests/e2e/cypress/screenshots",
7-
"supportFile": "./tests/e2e/cypress/support/index.js",
8-
"videoFolder": "./tests/e2e/cypress/videos"
3+
"fixturesFolder": "./tests/cypress/fixtures",
4+
"integrationFolder": "./tests/cypress/tests",
5+
"pluginsFile": "./tests/cypress/plugins/index.js",
6+
"screenshotsFolder": "./tests/cypress/screenshots",
7+
"supportFile": "./tests/cypress/support/index.js",
8+
"videoFolder": "./tests/cypress/videos"
99
}

Diff for: packages/dash-table/dash_table/bundle.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: packages/dash-table/dash_table/demo.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)