mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] Line charts: explicitly update X-axis whenever xScale changes (#14814)
* Explicitly update X-axis whenever xScale changes * Changelog
This commit is contained in:
3
.changelog/14814.txt
Normal file
3
.changelog/14814.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Fixed line charts to update x-axis (time) where relevant
|
||||
```
|
||||
@@ -350,6 +350,13 @@ export default class LineChart extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
recomputeXAxis(el) {
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
d3.select(el.querySelector('.x-axis')).call(this.xAxis);
|
||||
}
|
||||
}
|
||||
|
||||
mountD3Elements() {
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
d3.select(this.element.querySelector('.x-axis')).call(this.xAxis);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
...attributes
|
||||
{{did-insert this.onInsert}}
|
||||
{{did-update this.renderChart}}
|
||||
{{did-update this.recomputeXAxis this.xScale}}
|
||||
{{window-resize this.updateDimensions}}>
|
||||
<svg data-test-line-chart aria-labelledby="{{this.titleId}}" aria-describedby="{{this.descriptionId}}">
|
||||
<title id="{{this.titleId}}">{{this.title}}</title>
|
||||
|
||||
Reference in New Issue
Block a user