Skip to content

Commit

Permalink
Fix axes label color in dark mode.
Browse files Browse the repository at this point in the history
Also prevent x axis label from being cut off at the bottom by moving it up by a few pixels
  • Loading branch information
flekschas committed Sep 1, 2023
1 parent c48f872 commit 5a23c30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## v0.14.3

- Fix: don't return color, opacity, or size settings when `labeling` is defined
- Fix: prevent x-axis label to be cut off at the bottom
- Fix: axes label color in dark mode

## v0.14.2

Expand Down
4 changes: 3 additions & 1 deletion js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ class JupyterScatterView {

this.xAxisLabel
.text(labels[0])
.attr('fill', 'currentColor')
.attr('text-anchor', 'middle')
.attr('font-size', '12px')
.attr('font-weight', 'bold')
Expand All @@ -442,6 +443,7 @@ class JupyterScatterView {

this.yAxisLabel
.text(labels[1])
.attr('fill', 'currentColor')
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'hanging')
.attr('x', (height - yPadding) / 2)
Expand Down Expand Up @@ -1292,7 +1294,7 @@ class JupyterScatterView {
}

if (labels) {
this.xAxisLabel.attr('x', (width - xPadding) / 2).attr('y', height);
this.xAxisLabel.attr('x', (width - xPadding) / 2).attr('y', height - 4);
this.yAxisLabel.attr('x', (height - yPadding) / 2).attr('y', -width);
}
}
Expand Down

0 comments on commit 5a23c30

Please sign in to comment.