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] Migrate Timeseries Chart to React #25792

Merged
merged 4 commits into from
Nov 16, 2018

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Nov 16, 2018

Summary

  • Migrates the Timeseries Chart to be a React component wrapped by a minimal Angular wrapper.
  • The intent of this PR is to achieve the migration with minimal code changes. Git treats the React component file timeseries_charts.js as a new file but it's mostly the original d3 code from the angular directive wrapped now in React code. So for the review IMHO I suggest to not focus on all the granular d3 code but just how the React code wraps the previous code. Some code might look verbose, e.g. casting all the this.* members to const inside methods; but that allows the original code taken from angular to stay the same and is kind of a safety net to avoid regressions where this.something could end up inside another child function without the right context for this. If you have suggestions for changes to the original d3 code please add comments, I'll document them for a follow up PR in [ML] Migrate Timeseries Viewer Chart to React #25791.
  • This includes a new unit test to check the minimal props and setup required to run the new React component without errors. Future PR (hint hint annotations feature) will add more specific tests.

Tested:

  • The original behavior is intact that not the whole chart is re-rendered when the brush tool in the context chart is used.
  • Hovering anomalies in the anomaly table below the charts highlights anomalies in the chart
  • Tested forecasting and combinations of displaying model bounds/forecasts.

Checklist

For maintainers


Part of #25791 and #18374.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion, otherwise LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⚡️

@walterra walterra merged commit 2a52b4f into elastic:master Nov 16, 2018
@walterra walterra deleted the ml-reactivy-timeseries-chart branch November 16, 2018 17:09
walterra added a commit to walterra/kibana that referenced this pull request Nov 16, 2018
* [ML] Reactified Singleseries Chart.
* [ML] Adds an initialization test for TimeseriesChart.
* [ML] Restore original behavior of updating focus chart only when interacting with the brush selector.
* [ML] Tweaked comments.
walterra added a commit that referenced this pull request Nov 16, 2018
* [ML] Reactified Singleseries Chart.
* [ML] Adds an initialization test for TimeseriesChart.
* [ML] Restore original behavior of updating focus chart only when interacting with the brush selector.
* [ML] Tweaked comments.
@walterra walterra added the non-issue Indicates to automation that a pull request should not appear in the release notes label Nov 20, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sophiec20 sophiec20 added the Feature:Anomaly Detection ML anomaly detection label Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Anomaly Detection ML anomaly detection Feature:ml-results legacy - do not use :ml non-issue Indicates to automation that a pull request should not appear in the release notes refactoring v6.6.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants