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

Refactor API - remove column.hidden #473

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
#### REMOVED
- `column.clearable`: Allows clearing the value of a dropdown cell.
Removed in favor of `dropdown_**` `clearable` nested property.
- `column.hidden`: Allows hiding column
Removed. Stay tuned by following https://github.com/plotly/dash-table/issues/314.
- `column.options`
Removed. Redundant with `dropdown`.
- `pagination_settings`
Expand Down Expand Up @@ -43,7 +45,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- `n_fixed_columns`: Will fix columns to the left.
Renamed to `fixed_columns`
Now accepts an object { headers: boolean, data: number } instead of a number.
{ headers: true } determines the number of columns to fix automatically. For example, if the rows are selectable or deletable, { headers: true } would fix those columns automatically. If { headers: true, data: 2 }, it would fix the first two data columns in addition to the selectable and deletable if visible.
{ headers: true } determines the number of columns to fix automatically. For example, if the rows are selectable or deletable, { headers: true } would fix those columns automatically. If { headers: true, data: 2 }, it would fix the first two data columns in addition to the selectable and deletable if visible.
- `n_fixed_rows`: Will fix rows to the top.
Renamed to `fixed_rows`
Now accepts an object { headers: boolean, data: number } instead of a number.
Expand Down
8 changes: 0 additions & 8 deletions src/dash-table/dash/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@ export const propTypes = {
specifier: PropTypes.string
}),

/**
* If True, then the column and its data is hidden.
* This can be useful if you want to transport extra
* meta data (like a data index) to and from callbacks
* but you don't necessarily want to display that data.
*/
hidden: PropTypes.bool,

/**
* The `id` of the column.
* The column `id` is used to match cells in data
Expand Down
2 changes: 1 addition & 1 deletion tests/visual/percy-storybook/Header.percy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ storiesOf('DashTable/Headers', module)
{ name: ['Year', ''], id: 'year' },
{ name: ['City', 'Montreal'], id: 'montreal' },
{ name: ['City', 'Toronto'], id: 'toronto' },
{ name: ['City', 'Ottawa'], id: 'ottawa', hidden: true },
{ name: ['City', 'Ottawa'], id: 'ottawa' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is still interesting w/o the hidden nested prop. Keeping it!

{ name: ['City', 'Vancouver'], id: 'vancouver' },
{ name: ['Climate', 'Temperature'], id: 'temp' },
{ name: ['Climate', 'Humidity'], id: 'humidity' }
Expand Down
85 changes: 0 additions & 85 deletions tests/visual/percy-storybook/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,91 +386,6 @@ export default [
}
},

{
name: 'hidden-columns',
props: {
id: 'table',
editable: true,
selected_cells: [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]],
active_cell: [1, 1],
columns: [
{
name: 'Column 1',
id: 'column-1'
},
{
name: 'Column 2',
id: 'column-2',
hidden: true
},
{
name: 'Column 3',
id: 'column-3'
},
{
name: 'Column 4',
id: 'column-4'
}
],
data: [
{'column-1': 1, 'column-2': 'alpha', 'column-3': 2, 'column-4': 1},
{'column-1': 2, 'column-2': {data: 'whatever im hidden who cares'}, 'column-3': 2, 'column-4': 1},
{'column-1': 3, 'column-2': true, 'column-3': 2, 'column-4': 1},
{'column-1': 4, 'column-2': 'delta', 'column-3': 2, 'column-4': 1}
]
}
},

{
name: 'hidden-columns-with-merged-headers',
props: {
id: 'table',
editable: true,
selected_cells: [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]],
active_cell: [1, 1],
merge_duplicate_headers: true,
columns: [
{
name: ['Columns', 'Column 1'],
id: 'column-1'
},
{
name: ['Columns', 'Column 2'],
id: 'column-2',
hidden: true
},
{
name: ['Columns', 'Column 3'],
id: 'column-3'
},
{
name: ['Columns', 'Column 4'],
id: 'column-4'
},
{
name: ['Colors', 'Blue'],
id: 'column-5'
},
{
name: ['Colors', 'Red'],
id: 'column-6',
hidden: true

},
{
name: ['Colors', 'Orange'],
id: 'column-7'
}
],
data: [
{'column-1': 1, 'column-2': 'alpha', 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1},
{'column-1': 2, 'column-2': {data: 'whatever im hidden who cares'}, 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1},
{'column-1': 3, 'column-2': true, 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1},
{'column-1': 4, 'column-2': 'delta', 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1}
]
}
},

{
name: 'per-cell dropdowns',
props: {
Expand Down