-
Notifications
You must be signed in to change notification settings - Fork 44
Support processUnpinnedColumns #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
datenzauberai
wants to merge
7
commits into
plotly:v35
Choose a base branch
from
datenzauberai:support_processUnpinnedColumns
base: v35
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+104
−4
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
05e8b45
Test for processUnpinnedColumns
b6803fd
Add processUnpinnedColumns
1de19ee
Linter fixes
5a9cf8e
Merge branch 'v35' into support_processUnpinnedColumns
AnnMarieW 6842f8b
Make sure that window width and column count+width are set-up properly.
13be364
Default pin_state to "left"
5ce5c54
Changelog
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import dash_ag_grid as dag | ||
| from dash import Dash, html, dcc | ||
| from . import utils | ||
| import uuid | ||
|
|
||
|
|
||
| def test_cd001_process_unpinned_columns(dash_duo): | ||
| """ Test that the processUnpinnedColumns function is called when the available viewport space is exceeded and the right most columns are unpinned.""" | ||
|
|
||
| # Make sure that the pinned columns will not fit in the available viewport space and | ||
| # the processUnpinnedColumns function will be called. | ||
| window_width = 1280 | ||
| dash_duo.driver.set_window_size(window_width, 720) | ||
|
|
||
| column_width = 300 | ||
| column_count = int(window_width / column_width) + 1 | ||
| row_count = 10 | ||
| row_data = [ | ||
| {f"COL_{col_idx}": uuid.uuid4().hex for col_idx in range(column_count)} for _ in range(row_count) | ||
| ] | ||
|
|
||
| app = Dash(__name__) | ||
| column_defs = [ | ||
| { | ||
| "field": col, | ||
| "pinned": "left", | ||
| "width": column_width, | ||
| } | ||
| for col in row_data[0].keys() | ||
| ] | ||
|
|
||
| app.layout = html.Div( | ||
| [ | ||
| dcc.Markdown( | ||
| "This grid uses a javascript function to make sure," | ||
| " that the right most columns are unpinned when the available viewport space is exceeded." | ||
| ), | ||
| dag.AgGrid( | ||
| columnDefs=column_defs, | ||
| rowData=row_data, | ||
| id="grid", | ||
| dashGridOptions={ | ||
| "processUnpinnedColumns": {"function": "unpinAllButFirstColumn(params)"}, | ||
| } | ||
| ), | ||
| ], | ||
| style={"margin": 20}, | ||
| ) | ||
| dash_duo.start_server(app) | ||
|
|
||
| grid = utils.Grid(dash_duo, "grid") | ||
|
|
||
| grid.wait_for_pinned_column(col_id="COL_0", pin_state="left") | ||
|
datenzauberai marked this conversation as resolved.
|
||
| for col_idx in range(1, column_count): | ||
| grid.wait_for_pinned_column(col_id=f"COL_{col_idx}", pin_state="scrolling") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.