Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Performance improvements to annotations editing in Single Metric Viewer & buttons placement #83216

Merged
merged 20 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
db8673c
[ML] Change placement of annotation footer buttons
qn895 Nov 11, 2020
3d854a2
[ML] Fix performance issue with annotation/renderFocusChart on SMV
qn895 Nov 11, 2020
b5166e6
[ML] Add AnnotationUpdatesService and MlAnnotationComponent
qn895 Nov 12, 2020
528a8de
[ML] Update type definition
qn895 Nov 12, 2020
81e20c4
[ML] Add to AnnotationUpdatesService context, update tests
qn895 Nov 16, 2020
bafde0d
[ML] Update snapshots for AnnotationsTable
qn895 Nov 16, 2020
927b38d
Merge remote upstream into ml-annotations-smv-improvements
qn895 Nov 16, 2020
c4ebb5e
Merge remote-tracking branch 'upstream/master' into ml-annotations-sm…
qn895 Nov 16, 2020
d3d4ce4
Merge remote-tracking branch 'upstream/master' into ml-annotations-sm…
qn895 Nov 16, 2020
eb1da71
Merge remote-tracking branch 'upstream/master' into ml-annotations-sm…
qn895 Nov 16, 2020
6eff2c8
[ML] Delete MlAnnotationComponent
qn895 Nov 16, 2020
1365c52
[ML] Update updateBtn to grab by id
qn895 Nov 17, 2020
0cf7ad0
[ML] Rename update$, isAnnotationInitialized$
qn895 Nov 17, 2020
2165da7
[ML] Add MlAnnotationUpdatesContext.Provider, rename file
qn895 Nov 17, 2020
d2cb370
Merge upstream/main into ml-annotations-smv-improvements
qn895 Nov 17, 2020
3575d6a
Update test types
qn895 Nov 17, 2020
f179e79
Merge remote-tracking branch 'upstream/master' into ml-annotations-sm…
qn895 Nov 17, 2020
588bedd
[ML] Remove console log
qn895 Nov 18, 2020
b67515d
Merge remote-tracking branch 'upstream/master' into ml-annotations-sm…
qn895 Nov 18, 2020
9b8020b
[ML] Move annotationUpdatesService to beforeEach
qn895 Nov 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,16 @@ export class AnnotationFlyoutUI extends Component<CommonProps & Props> {
</EuiFormRow>
</EuiFlyoutBody>
<EuiFlyoutFooter>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiButtonEmpty iconType="cross" onClick={this.cancelEditingHandler} flush="left">
<EuiButtonEmpty onClick={this.cancelEditingHandler} flush="left">
<FormattedMessage
id="xpack.ml.timeSeriesExplorer.annotationFlyout.cancelButtonLabel"
defaultMessage="Cancel"
/>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} style={{ marginLeft: 'auto' }}>
{isExistingAnnotation && (
<EuiButtonEmpty color="danger" onClick={this.deleteConfirmHandler}>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
unhighlightFocusChartAnnotation,
ANNOTATION_MIN_WIDTH,
} from './timeseries_chart_annotations';
import { distinctUntilChanged } from 'rxjs/operators';

const focusZoomPanelHeight = 25;
const focusChartHeight = 310;
Expand Down Expand Up @@ -1798,7 +1799,15 @@ class TimeseriesChartIntl extends Component {
}

export const TimeseriesChart = (props) => {
const annotationProp = useObservable(annotation$);
const annotationProp = useObservable(
annotation$.pipe(
darnautov marked this conversation as resolved.
Show resolved Hide resolved
distinctUntilChanged((prev, curr) => {
// prevent re-rendering
return prev !== null && curr !== null;
})
)
);

if (annotationProp === undefined) {
return null;
}
Expand Down