Skip to content

Commit

Permalink
Forward port fix scale domain no data #1619 (#1620)
Browse files Browse the repository at this point in the history
* fix: set domain to (0, 1) when no data is present

Fixes #1614

If no data is present, a scale has a domain of (0, 1) but if we
remove the data (set it to an empty array) afterwards, we set it
to (-inf, +inf) which causes rendering issues and make the bqplot
figure unable to restore itself.
It is more consistent to behave like no data was passed in, and use
(0, 1) for the domain.

* Update snapshots

* Require bqscales recent

* Update Playwright Snapshots

---------

Co-authored-by: Maarten A. Breddels <maartenbreddels@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 27, 2023
1 parent acb0fce commit cd8a636
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install_requires =
traittypes>=0.0.6
numpy>=1.10.4
pandas>=1.0.0,<3.0.0
bqscales>=0.3.1,<0.4
bqscales>=0.3.3,<0.4
classifiers =
Framework :: Jupyter
Framework :: Jupyter :: JupyterLab
Expand Down
2 changes: 1 addition & 1 deletion test-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- traittypes >=0.0.6
- numpy >=1.10.4,<2.0.0
- pandas >=1.0.0,<2.0.0
- bqscales >=0.3.1
- bqscales >=0.3.3
- scipy
- notebook
- yarn =3
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions ui-tests/tests/notebooks/lines_update.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@
"source": [
"lines.labels_visibility = 'label'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7444d361-f8f3-4641-88ef-fbe84450bfb3",
"metadata": {},
"outputs": [],
"source": [
"lines.x, lines.y = [], []"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "481f09e7-f7a9-4393-8388-a608b216ef41",
"metadata": {},
"outputs": [],
"source": [
"lines.x, lines.y = np.arange(len(y1)), [y1, y2, y3, y4]"
]
}
],
"metadata": {
Expand Down

0 comments on commit cd8a636

Please sign in to comment.