Skip to content

[ML] Reactive time-range selection in Single Metric Viewer#51008

Merged
darnautov merged 27 commits intoelastic:masterfrom
darnautov:ML-smv-timerange-brush-enhancement
Nov 25, 2019
Merged

[ML] Reactive time-range selection in Single Metric Viewer#51008
darnautov merged 27 commits intoelastic:masterfrom
darnautov:ML-smv-timerange-brush-enhancement

Conversation

@darnautov
Copy link
Copy Markdown
Contributor

Summary

The main purpose of this PR is to demonstrate how RxJS can improve UX and developer experience by helping to deal with async flow. As an example, I've used time-range selection with a brush on Single Metric Viewer. There is a wide range of functions and operators, for instance, I used debounceTime for postponing the actual API calls and fromFetch to take advantage of built-in abort signal for HTTP requests cancellation on transforming the Observable with switchMap.

Nov-19-2019 10-18-10

Some of the files have been migrated to TS, but it's not the main focus so suggestions regarding missing interfaces and types appreciated! Besides, there are new files that partially duplicate the code from JS services, which will be updated and merged accordingly.

Checklist

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@darnautov darnautov changed the title [ML] Reactive time-range selection in SMV [ML] [WIP] Reactive time-range selection in SMV Nov 19, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@darnautov darnautov changed the title [ML] [WIP] Reactive time-range selection in SMV [ML] Reactive time-range selection in SMV Nov 20, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@walterra
Copy link
Copy Markdown
Contributor

I couldn't find a definitive reference in any of the style guides, but Kibana uses a $ postfix for observable names, might be worth revisiting the PR code and see where that's applicable/useful.

@darnautov darnautov force-pushed the ML-smv-timerange-brush-enhancement branch from 292f9e0 to 98e8fd7 Compare November 20, 2019 14:50
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Copy link
Copy Markdown
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.

Overall this is looking good. On Firefox I am occasionally seeing a blank focus chart on switching jobs, with these errors in the console:

image

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

Great work, I added some minor suggestions. Will report back once I did some local testing 😅

Copy link
Copy Markdown
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

Latest changes LGTM, also tested locally in Chrome/OSX.

Copy link
Copy Markdown
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.

Tested on FF/Chrome/Safari and LGTM ⚡️

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@darnautov darnautov force-pushed the ML-smv-timerange-brush-enhancement branch from ac068dc to 828fc04 Compare November 22, 2019 15:41
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@darnautov darnautov merged commit a1a256d into elastic:master Nov 25, 2019
@darnautov darnautov deleted the ML-smv-timerange-brush-enhancement branch November 25, 2019 11:21
darnautov added a commit to darnautov/kibana that referenced this pull request Nov 25, 2019
* [ML] http service to TS, add httpCall using fromFetch

* [ML] types, add esSearchRx

* [ML] timeresiesexplorer_contans to ts

* [ML] timeseries_search_service to TS, add getMetricDataRx

* [ML] result service with observables

* [ML] update resolvers, forecast data support

* [ML] wip timeseriesexplorer

* [ML] fix state update for zoom

* [ML] skip loading update

* [ML] cleanup contextChartSelected

* [ML] add to subscriptions

* [ML] update imports

* [ML] timeseriesexplorer_utils

* [ML] refactor result service

* [ML] getAnnotations

* [ML] rename subject

* [ML] fix explorer and unit tests

* [ML] fix forecast

* [ML] replace skipWhilte with filter

* [ML] rename http$

* [ML] rename esSearch$

* [ML] remove filter operator, check for contextChartData before calculating the default range

* [ML] remove casting for FocusData

* [ML] replace with an arrow function

* [ML] fix Job import path

* [ML] fix annotations
darnautov added a commit that referenced this pull request Nov 25, 2019
* [ML] http service to TS, add httpCall using fromFetch

* [ML] types, add esSearchRx

* [ML] timeresiesexplorer_contans to ts

* [ML] timeseries_search_service to TS, add getMetricDataRx

* [ML] result service with observables

* [ML] update resolvers, forecast data support

* [ML] wip timeseriesexplorer

* [ML] fix state update for zoom

* [ML] skip loading update

* [ML] cleanup contextChartSelected

* [ML] add to subscriptions

* [ML] update imports

* [ML] timeseriesexplorer_utils

* [ML] refactor result service

* [ML] getAnnotations

* [ML] rename subject

* [ML] fix explorer and unit tests

* [ML] fix forecast

* [ML] replace skipWhilte with filter

* [ML] rename http$

* [ML] rename esSearch$

* [ML] remove filter operator, check for contextChartData before calculating the default range

* [ML] remove casting for FocusData

* [ML] replace with an arrow function

* [ML] fix Job import path

* [ML] fix annotations
@lcawl lcawl changed the title [ML] Reactive time-range selection in SMV [ML] Reactive time-range selection in Single Metric Viewer Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants