[ML] Explain Log Rate Spikes: ensure brush style is applied on brush creation (#141545) (#141667)

* ensure brush style is applied on brush creation

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 2e91c672f0)

Co-authored-by: Melissa Alvarez <melissa.alvarez@elastic.co>
This commit is contained in:
Kibana Machine 2022-09-23 10:25:02 -06:00 committed by GitHub
parent bd6c3171ac
commit 889c033bd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,6 +240,12 @@ export function DualBrush({
})
.each((brushObject: DualBrush, i, n) => {
const x = d3.scaleLinear().domain([min, max]).rangeRound([0, widthRef.current]);
// Ensure brush style is applied
brushObject.brush.extent([
[0, BRUSH_MARGIN],
[widthRef.current, BRUSH_HEIGHT - BRUSH_MARGIN],
]);
brushObject.brush(d3.select(n[i]));
const xStart = x(brushObject.start) ?? 0;
const xEnd = x(brushObject.end) ?? 0;