-
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
Fixes #163 |
These prop-types will end up in the documentation on dash.plot.ly. There are a few TODOs in there - @Marc-Andre-Rivet can you clarify them for me? I've linked many of the comments to GitHub issues as a way to better warn folks about properties that will probably change when we go from Check it out @Marc-Andre-Rivet @valentijnnieman @cldougl |
|
||
/** | ||
* TODO - What does this do? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used by the dropdown to know whether the value can be deleted (the 'x' is visible on hover)
* If True, then the data associated with this column is editable. | ||
* Note that this can be toggled on a per-table basis with the | ||
* higher level `editable` flag. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the table as a whole must be editable for this field to apply. A non-editable table + an editable field still results in a readonly cell. We could modify the table beahvior so that if table.editable is False, column.editable True overrides and vice versa. Right now it's inconvenient to have a table with n columns and only a small subset of editable columns.
|
||
/** | ||
* If True, then the name of this column is editable. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior with number (multi-lined header) missing
* two common behaviors: | ||
* TODO - `fit` - The table will ...? | ||
* `grow` - The table will expand to its parents container. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fit -> the table container will fit the content and not try to take all the available space in the parent
grow -> the table will try and aggressively take all available space
Similar idea is greedy vs. non-greedy regex.
This is clearly a prop that we will want to rework and/or get rid of if we can.
* If True, then the data in all of the cells is editable. | ||
* Note that this can be toggled on a per-column basis with the | ||
* `editable` flag inside the `columns` property. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See column.editable comment above
* so `n_fixed_columns=1` will fix the header row, | ||
* `n_fixed_rows=2` will fix the header row and the first row, | ||
* or the first two header rows (if there are multiple headers). | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same note as for n_fixed_columns applies here.
* `selected_cell` represents the cell that is currently | ||
* selected. | ||
* TODO - How is this different than `active_cell`? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selected_cell contains all the cells that are currently selected in the table while active_cell is the one with "focus"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be selected_cells
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/dash-table/Table.js
Outdated
* - `'fe'` refers to "front-end" paging: passing large data up-front | ||
* - `'be'` refers to "back-end" paging: updating the data on the fly via callbacks | ||
* - `False` will disable paging, attempting to render all of the data at once | ||
* TODO - What does `True` do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True is the same as 'fe'
src/dash-table/Table.js
Outdated
* - `current_page` represents which page the user is on. | ||
* Use this property to index through data in your callbacks with | ||
* backend paging. | ||
* TODO - What does `displayed_pages` to? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think displayed_pages can be removed, original implementation was taking page and infinite scroll into consideration. It should be removed.
|
||
/** | ||
* TODO - What does `navigation` do? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navigation should be PropTypes.oneOf(['page']) and would include other strategies like 'infinite_scroll' or similar in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be removed entirely at the moment.
src/dash-table/Table.js
Outdated
* responsibility of the developer to program the filtering | ||
* through a callback (where `filtering_settings` would be the input | ||
* and `data` would be the output). | ||
* TODO - What does `True` do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True behaves the same as 'fe'
* with the `fe` setting or via a callback in your | ||
* python "back-end" with the `be` setting. | ||
* Clicking on the sort arrows will update the | ||
* `sorting_settings` property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True is the same as 'fe'
/** | ||
* TODO - Is this the `selected_rows` or just the indicies w.r.t. | ||
* the original data? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the selected_rows. This array indicates the order in which the original data rows appear after being filtered and sorted.
/** | ||
* TODO - Is this the `selected_rows` or just the indicies w.r.t. | ||
* the original data? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the selected_rows. This array indicates the order in which the original data rows appear after being filtered and sorted and paged. While virtual encompasses the entire original data, this is limited to the items currently visible to the user.
src/dash-table/Table.js
Outdated
derived_virtual_indices: PropTypes.arrayOf(PropTypes.number), | ||
|
||
/** | ||
* DEPRECATED | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While column.options is fully deprecated (it can be replaced without loss with column_static_dropdown), derived_properties still offers a unique way of mapping dropdown values by datum/row index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nitpicks, using the new Github suggestion feature here and there, feel free to improve them or ignore them. Looks good!
src/dash-table/Table.js
Outdated
css: PropTypes.arrayOf(PropTypes.shape({ | ||
selector: PropTypes.string.isRequired, | ||
rule: PropTypes.string.isRequired | ||
})), | ||
|
||
/** | ||
* The contents of the table. | ||
* The keys in item in data should match the column IDs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The keys in item in data..." not sure what you mean here, a typo maybe?
* `selected_cell` represents the cell that is currently | ||
* selected. | ||
* TODO - How is this different than `active_cell`? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be selected_cells
then?
src/dash-table/Table.js
Outdated
/** | ||
* When we sort, should empty strings (`''`) be considered | ||
* valid values (they will appear first when sorting ascending) | ||
* or should they be ignored (always appearing last)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a question for us (missing a TODO?) or if it's the actual docstring, haha. If it is the docstring, maybe it's better to rewrite so it doesn't ask a question.
Thanks @Marc-Andre-Rivet and @valentijnnieman ! I just incorporated your edits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.