Skip to content

Commit

Permalink
First round of PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschulz-COL committed Oct 25, 2023
1 parent 7670eab commit 205b759
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vizro-core/docs/pages/user_guides/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ from vizro.tables import dash_data_table
```
The Vizro version of the table differs in one way from the original table: it requires the user to provide a pandas dataframe as source of data.
This must be entered under the argument `data_frame`.
All other parameters of the [Dash DataTable](https://dash.plotly.com/datatable) can be entered as kwargs.
All other [parameters of the Dash DataTable](https://dash.plotly.com/datatable/reference) can be entered as kwargs.

!!! example "Dash DataTable"
=== "app.py"
Expand Down
6 changes: 2 additions & 4 deletions vizro-core/src/vizro/models/_components/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,15 @@ class Graph(VizroBaseModel):
"""

type: Literal["graph"] = "graph"
figure: CapturedCallable = Field(
..., import_path=px
) # TODO: needs to be refactored so plotly-independent or extendable - No, as within the boundaries of Graph model
figure: CapturedCallable = Field(..., import_path=px)
actions: List[Action] = []

# Component properties for actions and interactions
_output_property: str = PrivateAttr("figure")

# Re-used validators
_set_actions = _action_validator_factory("clickData")
_validate_callable = validator("figure", allow_reuse=True, always=True)(_process_callable_data_frame)
_validate_callable = validator("figure", allow_reuse=True)(_process_callable_data_frame)

# Convenience wrapper/syntactic sugar.
def __call__(self, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/models/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def wrapped(*args, **kwargs):

return wrapped
elif self._mode == "table":
# The table component

@functools.wraps(func)
def wrapped(*args, **kwargs):
if "data_frame" not in inspect.signature(func).parameters:
Expand Down
9 changes: 9 additions & 0 deletions vizro-core/src/vizro/static/css/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ div.right_side
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
padding: 0px 4px;
}

.table-title {
padding-bottom: 14px;
}

.table-container {
padding: 12px;
padding-left: 18px;
}

0 comments on commit 205b759

Please sign in to comment.