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

* 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>
This commit is contained in:
Melissa Alvarez 2022-09-23 09:17:41 -06:00 committed by GitHub
parent b3c80fe3cd
commit 2e91c672f0
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;