diff --git a/bqplot/_version.py b/bqplot/_version.py index 0f3e853fd..7bee46df4 100644 --- a/bqplot/_version.py +++ b/bqplot/_version.py @@ -1,4 +1,4 @@ -version_info = (0, 12, 40, 'final', 0) +version_info = (0, 12, 41, 'final', 0) _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''} diff --git a/js/package.json b/js/package.json index 2547d1fba..e9a9d4c03 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "bqplot", - "version": "0.5.41", + "version": "0.5.42", "description": "bqplot", "keywords": [ "jupyter", diff --git a/js/src/LinearScaleModel.ts b/js/src/LinearScaleModel.ts index e1d50cb07..c5f8f2b25 100644 --- a/js/src/LinearScaleModel.ts +++ b/js/src/LinearScaleModel.ts @@ -78,6 +78,17 @@ export class LinearScaleModel extends ScaleModel { update_domain() { const that = this; + // if all domains are empty, we reset to the default domain of (0, 1) + if ( + _.every(this.domains, (d) => { + return d.length === 0; + }) + ) { + this.domain = this.reverse ? [1, 0] : [0, 1]; + this.trigger('domain_changed', this.domain); + return; + } + const min = !this.min_from_data ? this.min : d3.min( diff --git a/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-12-linux.png b/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-12-linux.png new file mode 100644 index 000000000..f5e9ed2a8 Binary files /dev/null and b/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-12-linux.png differ diff --git a/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-13-linux.png b/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-13-linux.png new file mode 100644 index 000000000..7334d7268 Binary files /dev/null and b/ui-tests/tests/bqplot.test.ts-snapshots/dark-lines-update-ipynb-cell-13-linux.png differ diff --git a/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-12-linux.png b/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-12-linux.png new file mode 100644 index 000000000..9d781d8f4 Binary files /dev/null and b/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-12-linux.png differ diff --git a/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-13-linux.png b/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-13-linux.png new file mode 100644 index 000000000..054f2e46f Binary files /dev/null and b/ui-tests/tests/bqplot.test.ts-snapshots/light-lines-update-ipynb-cell-13-linux.png differ diff --git a/ui-tests/tests/notebooks/lines_update.ipynb b/ui-tests/tests/notebooks/lines_update.ipynb index df1b22b58..cd74b9ca4 100644 --- a/ui-tests/tests/notebooks/lines_update.ipynb +++ b/ui-tests/tests/notebooks/lines_update.ipynb @@ -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": {