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

Change component name to DataTable #187

Merged
merged 3 commits into from
Oct 31, 2018
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,7 @@ Derived properties allow the component to expose complex state that can be usefu
## RC17- Linux install

Issue: https://github.com/plotly/dash-table/issues/137

## RC18 - Rename table component

Issue: https://github.com/plotly/dash-table/issues/154
2 changes: 1 addition & 1 deletion dash_table/bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_table/demo.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_table/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"src/dash-table/Table.js": {
"src/dash-table/DataTable.js": {
"description": "",
"displayName": "Table",
"displayName": "DataTable",
"methods": [],
"props": {
"active_cell": {
Expand Down
4 changes: 2 additions & 2 deletions dash_table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.0-rc17",
"version": "3.1.0-rc18",
"description": "Dash table",
"main": "build/index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
"build:js-dev": "run-s \"private::build -- --mode development\"",
"build:js-test": "run-s \"private::build -- --config webpack.test.config.js\"",
"build:js-test-watch": "run-s \"private::build -- --config webpack.test.config.js --watch\"",
"build:py": "./extract-meta src/dash-table/Table.js > dash_table/metadata.json && cp package.json dash_table",
"build:py": "./extract-meta src/dash-table/DataTable.js > dash_table/metadata.json && cp package.json dash_table",
"lint": "run-s private::lint.js private::lint.ts",
"test": "run-p --race private::host* private::runtests",
"test.visual": "build-storybook && percy-storybook",
Expand Down
4 changes: 2 additions & 2 deletions demo/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-magic-numbers: 0 */
import * as R from 'ramda';
import React, {Component} from 'react';
import { Table } from 'dash-table';
import { DataTable } from 'dash-table';
import {mockData} from './data';
import { memoizeOne } from 'core/memoizer';
import Logger from 'core/Logger';
Expand Down Expand Up @@ -70,7 +70,7 @@ class App extends Component {
}

render() {
return (<Table
return (<DataTable
setProps={this.setProps}
{...this.state.tableProps}
{...{ filtering: 'fe' }}
Expand Down
2 changes: 1 addition & 1 deletion index.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
children=[
dcc.Location(id="location"),
html.Div(id="container"),
html.Div(style={"display": "none"}, children=dash_table.Table(id="hidden")),
html.Div(style={"display": "none"}, children=dash_table.DataTable(id="hidden")),
]
)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.0-rc17",
"version": "3.1.0-rc18",
"description": "Dash table",
"main": "build/index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
"build:js-dev": "run-s \"private::build -- --mode development\"",
"build:js-test": "run-s \"private::build -- --config webpack.test.config.js\"",
"build:js-test-watch": "run-s \"private::build -- --config webpack.test.config.js --watch\"",
"build:py": "./extract-meta src/dash-table/Table.js > dash_table/metadata.json && cp package.json dash_table",
"build:py": "./extract-meta src/dash-table/DataTable.js > dash_table/metadata.json && cp package.json dash_table",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

extract prop types from new file

"lint": "run-s private::lint.js private::lint.ts",
"test": "run-p --race private::host* private::runtests",
"test.visual": "build-storybook && percy-storybook",
Expand Down
6 changes: 3 additions & 3 deletions src/dash-table/Table.js → src/dash-table/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function isBackEnd(value) {
return ['be', false].indexOf(value) !== -1;
}

export default class Table extends Component {
export default class DataTable extends Component {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changing class name to be consistent

constructor(props) {
super(props);

Expand Down Expand Up @@ -726,5 +726,5 @@ export const propTypes = {
dropdown_properties: PropTypes.any,
};

Table.defaultProps = defaultProps;
Table.propTypes = propTypes;
DataTable.defaultProps = defaultProps;
DataTable.propTypes = propTypes;
4 changes: 2 additions & 2 deletions src/dash-table/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Environment from 'core/environment';
import Logger from 'core/Logger';

import Table from 'dash-table/Table';
import DataTable from 'dash-table/DataTable';

Logger.setDebugLevel(Environment.debugLevel);
Logger.setLogLevel(Environment.logLevel);

export {
Table
DataTable
};
2 changes: 1 addition & 1 deletion tests/cypress/dash/v_be_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
app.layout = html.Div(
[
html.Div(id="container", children="Hello World"),
dash_table.Table(
dash_table.DataTable(
id="table",
data=[],
pagination_mode="be",
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/dash/v_copy_paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
app.layout = html.Div(
[
html.Div(id="container", children="Hello World"),
dash_table.Table(
dash_table.DataTable(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing test usage

id="table",
data=df[0:250],
navigation="page",
Expand Down
12 changes: 6 additions & 6 deletions tests/dash/app_dataframe_backend_paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def layout():

section_title('Backend Paging'),

dash_table.Table(
dash_table.DataTable(
id=IDS["table"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand Down Expand Up @@ -65,7 +65,7 @@ def layout():

section_title('Backend Paging with Sorting'),

dash_table.Table(
dash_table.DataTable(
id=IDS["table-sorting"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand Down Expand Up @@ -93,7 +93,7 @@ def layout():
In this example, try sorting by continent and then any other column.
''')),

dash_table.Table(
dash_table.DataTable(
id=IDS["table-multi-sorting"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand Down Expand Up @@ -132,7 +132,7 @@ def layout():

''')),

dash_table.Table(
dash_table.DataTable(
id=IDS["table-filtering"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand All @@ -150,7 +150,7 @@ def layout():

section_title('Backend Paging with Filtering and Multi-Column Sorting'),

dash_table.Table(
dash_table.DataTable(
id=IDS["table-sorting-filtering"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand Down Expand Up @@ -181,7 +181,7 @@ def layout():
className="row",
children=[
html.Div(
dash_table.Table(
dash_table.DataTable(
id=IDS["table-paging-with-graph"],
columns=[
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
Expand Down
2 changes: 1 addition & 1 deletion tests/dash/app_dataframe_updating_graph_fe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def layout():
return html.Div(
[
html.Div(
dash_table.Table(
dash_table.DataTable(
id=IDS["table"],
columns=[
{"name": i, "id": i, "deletable": True} for i in df.columns
Expand Down
6 changes: 3 additions & 3 deletions tests/dash/app_dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def layout():

section_title('Dash Table with Per-Column Dropdowns'),

dash_table.Table(
dash_table.DataTable(
id=IDS['dropdown'],
data=df.to_dict('rows'),
columns=[
Expand Down Expand Up @@ -81,7 +81,7 @@ def layout():

section_title('Dash Table with Per-Cell Dropdowns via Filtering UI'),

dash_table.Table(
dash_table.DataTable(
id=IDS['dropdown-by-cell'],
data=df_per_row_dropdown.to_dict('rows'),
columns=[
Expand Down Expand Up @@ -140,7 +140,7 @@ def layout():

html.Div('This example uses a deprecated API, `dropdown_properties`.'),

dash_table.Table(
dash_table.DataTable(
id=IDS['dropdown-by-cell'],
data=df_per_row_dropdown.to_dict('rows'),
columns=[
Expand Down
4 changes: 2 additions & 2 deletions tests/dash/app_editor_with_configurable_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def update_table(*args):
rows = df.to_dict("rows")
else:
rows = df_small.to_dict("rows")
return dash_table.Table(
return dash_table.DataTable(
id=__name__,
columns=[{"name": i, "id": i} for i in df.columns],
data=rows,
Expand All @@ -126,7 +126,7 @@ def update_table(*args):
)


AVAILABLE_PROPERTIES = dash_table.Table(id="req").available_properties
AVAILABLE_PROPERTIES = dash_table.DataTable(id="req").available_properties


@app.callback(
Expand Down
2 changes: 1 addition & 1 deletion tests/dash/app_multi_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def layout():
df = pd.read_csv("datasets/gapminder.csv")
return dash_table.Table(
return dash_table.DataTable(
id=__name__,
columns=[
{"name": ["Year", ""], "id": "year"},
Expand Down
2 changes: 1 addition & 1 deletion tests/dash/app_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def layout():
df = pd.read_csv("./datasets/gapminder.csv")
return dash_table.Table(
return dash_table.DataTable(
id=__name__,
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict("rows"),
Expand Down
12 changes: 6 additions & 6 deletions tests/dash/app_sizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def layout():
html.H3("Dash Interactive Table"),
html.Div("These same styles can be applied to the dash table"),
section_title("Dash Table - Default Styles"),
dash_table.Table(
dash_table.DataTable(
id="sizing-1",
data=df.to_dict("rows"),
columns=[{"name": i, "id": i} for i in df.columns],
Expand All @@ -290,7 +290,7 @@ def layout():
allocates space.
"""
),
dash_table.Table(
dash_table.DataTable(
id="sizing-2",
data=df.to_dict("rows"),
content_style="grow",
Expand All @@ -317,7 +317,7 @@ def layout():
allocates space.
"""
),
dash_table.Table(
dash_table.DataTable(
id="sizing-3",
data=df.to_dict("rows"),
content_style="grow",
Expand All @@ -342,7 +342,7 @@ def layout():
The columns have a width/minWidth/maxWidth of 100px.
"""
),
dash_table.Table(
dash_table.DataTable(
id="sizing-4",
data=df.to_dict("rows"),
columns=[
Expand All @@ -366,7 +366,7 @@ def layout():
in that case
"""
),
dash_table.Table(
dash_table.DataTable(
id="sizing-5",
data=df.to_dict("rows"),
columns=[
Expand All @@ -390,7 +390,7 @@ def layout():
in that case
"""
),
dash_table.Table(
dash_table.DataTable(
id="sizing-6",
data=df.to_dict("rows"),
columns=[
Expand Down
8 changes: 4 additions & 4 deletions tests/dash/app_styling.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def layout():
# ...

section_title('Dash Table - Row Padding'),
dash_table.Table(
dash_table.DataTable(
id="styling-2",
data=df.to_dict("rows"),
columns=[
Expand All @@ -371,7 +371,7 @@ def layout():
# ...

section_title('Dash Table - Dark Theme with Cells'),
dash_table.Table(
dash_table.DataTable(
id="styling-6",
data=df.to_dict("rows"),
columns=[
Expand Down Expand Up @@ -410,7 +410,7 @@ def layout():
# ...

section_title('Dash Table - Highlighting Certain Columns'),
dash_table.Table(
dash_table.DataTable(
id="styling-9",
data=df.to_dict("rows"),
columns=[
Expand All @@ -432,7 +432,7 @@ def layout():
),

section_title('Dash Table - Highlighting Certain Cells'),
dash_table.Table(
dash_table.DataTable(
id="styling-10",
data=df.to_dict("rows"),
columns=[
Expand Down
Loading