Skip to content

Commit

Permalink
Forward port bqplot/bqplot#1619
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jul 27, 2023
1 parent 0d60e03 commit 6e44d50
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scales/LinearScaleModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ export class LinearScaleModel extends ScaleModel {
}

protected updateDomain() {
// 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.minFromData
? this.min
: d3Array.min(
Expand Down

0 comments on commit 6e44d50

Please sign in to comment.