From 411d66a259aa2f1ba8b8b73529944b571fab9859 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 19 May 2023 09:57:50 -0400 Subject: [PATCH 1/4] changelog for use_2to3, and fix setup.cfg as also mentioned in issue #4193 --- CHANGELOG.md | 1 + packages/python/plotly/setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 346dd66aa81..d0e9f80c271 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed another compatibility issue with Pandas 2.0, just affecting `px.*(line_close=True)` [[#4190](https://github.com/plotly/plotly.py/pull/4190)] - Added some rounding to the `make_subplots` function to handle situations where the user-input specs cause the domain to exceed 1 by small amounts [[#4153](https://github.com/plotly/plotly.py/pull/4153)] - Sanitize JSON output to prevent an XSS vector when graphs are inserted directly into HTML [[#4196](https://github.com/plotly/plotly.py/pull/4196)] + - Remove `use_2to3` setuptools arg, which is invalid in the latest Python and setuptools versions [[#4206](https://github.com/plotly/plotly.py/pull/4206)] ## [5.14.1] - 2023-04-05 diff --git a/packages/python/plotly/setup.cfg b/packages/python/plotly/setup.cfg index 1a82ac6f961..41917384385 100644 --- a/packages/python/plotly/setup.cfg +++ b/packages/python/plotly/setup.cfg @@ -1,6 +1,6 @@ [metadata] description_file = README.md -license_file = LICENSE.txt +license_files = LICENSE.txt [bdist_wheel] universal=1 From 3b4b324b23f3819f665003c3432ad3c6d7fa9136 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 19 May 2023 09:59:20 -0400 Subject: [PATCH 2/4] explicitly set figure height, for jupyterlab v4 --- packages/javascript/jupyterlab-plotly/src/Figure.ts | 3 +++ .../javascript/jupyterlab-plotly/src/plotly-renderer.ts | 6 +++++- packages/javascript/jupyterlab-plotly/style/index.css | 7 +------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/javascript/jupyterlab-plotly/src/Figure.ts b/packages/javascript/jupyterlab-plotly/src/Figure.ts index 29bf94bb417..3174ea34a6a 100644 --- a/packages/javascript/jupyterlab-plotly/src/Figure.ts +++ b/packages/javascript/jupyterlab-plotly/src/Figure.ts @@ -849,6 +849,9 @@ export class FigureView extends DOMWidgetView { // the model is not directly mutated by the Plotly.js library. var initialTraces = _.cloneDeep(this.model.get("_data")); var initialLayout = _.cloneDeep(this.model.get("_layout")); + if (!initialLayout.height) { + initialLayout.height = 360; + } var config = this.model.get("_config"); config.editSelection = false; diff --git a/packages/javascript/jupyterlab-plotly/src/plotly-renderer.ts b/packages/javascript/jupyterlab-plotly/src/plotly-renderer.ts index dcd32041d67..22d26aacda5 100644 --- a/packages/javascript/jupyterlab-plotly/src/plotly-renderer.ts +++ b/packages/javascript/jupyterlab-plotly/src/plotly-renderer.ts @@ -126,12 +126,16 @@ export class RenderedPlotly extends Widget implements IRenderMime.IRenderer { | any | IPlotlySpec; + if (!layout.height) { + layout.height = 360; + } + // Load plotly asynchronously const loadPlotly = async (): Promise => { if (RenderedPlotly.Plotly === null) { RenderedPlotly.Plotly = await import("plotly.js/dist/plotly"); RenderedPlotly._resolveLoadingPlotly(); - } + } return RenderedPlotly.loadingPlotly; }; diff --git a/packages/javascript/jupyterlab-plotly/style/index.css b/packages/javascript/jupyterlab-plotly/style/index.css index 15cdf2f9ad4..d5bd8eea6dd 100644 --- a/packages/javascript/jupyterlab-plotly/style/index.css +++ b/packages/javascript/jupyterlab-plotly/style/index.css @@ -21,12 +21,7 @@ overflow: hidden; } -/* Output styles */ -.jp-OutputArea .jp-RenderedPlotly { - min-height: 360px; -} - /* Document icon */ .jp-PlotlyIcon { background-image: var(--jp-icon-plotly); -} \ No newline at end of file +} From 8df887d6e3ceb338a2a65e3b02336bc4e64171e6 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 2 Jun 2023 17:42:40 -0400 Subject: [PATCH 3/4] pin jupyterlab=3 in full_build CI job --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index be8a88c814e..b633519c8f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -371,7 +371,7 @@ jobs: name: Create conda environment command: | conda create -n env --yes python=3.9 conda-build conda-verify - conda install -n env -c conda-forge jupyterlab nodejs=16 + conda install -n env -c conda-forge jupyterlab=3 nodejs=16 conda init bash mkdir output From 973b1399f7db6a464cc9c3962bf0c95d5b6ecb66 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 2 Jun 2023 18:02:18 -0400 Subject: [PATCH 4/4] changelog for jlab4 fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0e9f80c271..cbbaf3cb893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added some rounding to the `make_subplots` function to handle situations where the user-input specs cause the domain to exceed 1 by small amounts [[#4153](https://github.com/plotly/plotly.py/pull/4153)] - Sanitize JSON output to prevent an XSS vector when graphs are inserted directly into HTML [[#4196](https://github.com/plotly/plotly.py/pull/4196)] - Remove `use_2to3` setuptools arg, which is invalid in the latest Python and setuptools versions [[#4206](https://github.com/plotly/plotly.py/pull/4206)] + - Fix [#4066](https://github.com/plotly/plotly.py/issues/4066) JupyterLab v4 giving tiny default graph height [[#4227](https://github.com/plotly/plotly.py/pull/4227)] ## [5.14.1] - 2023-04-05