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] Data Frame Analytics results view: add link to custom visualizations for viewing scatterplot charts #149647

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Jan 26, 2023

Summary

This PR adds a link to the custom visualization UI from scatterplot matrix charts in the data frame analytics job wizard and results views. This allows you to view the data and edit the visualization inside the custom visualization editor, and then save it to a dashboard to explore the data alongside other contextual information.

image

Related meta issue: #131551

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

index,
body: {
fields: fieldsToFetch,
size: 1000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we apply the value from the UI dropdown to select the amount of docs to fetch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - updated in e14f32f

@walterra
Copy link
Contributor

Really great feature! I tested with different types of jobs and outlier detection and regression seems to work well. With classification somehow the chart doesn't end up fully populated in the Vega editor unfortunately.

This is how it looks in the DFA results page:

image

This is how it ends up in the Vega Editor:

image

The data seems to get fully fetched, when I do a drag select it ends up like this:

image

<EuiLink
onClick={async () => {
const customVisLink = getCustomVisualizationLink();
await application.navigateToApp('visualize#', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want it opening in a new tab or the same tab? Currently after the Visualize tab opens, the Save and return / Cancel buttons open up Dashboard. If it opens in the same tab, can the Save and return / Cancel buttons return you to the DFA page from which Visualize was opened?

Copy link
Contributor Author

@alvarezmelissa87 alvarezmelissa87 Jan 30, 2023

Choose a reason for hiding this comment

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

Opening it up in the same tab in e14f32f

As far as the cancel/return buttons - I'm not seeing them - could you share how you're getting them in the custom vis UI view?

Copy link
Contributor

Choose a reason for hiding this comment

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

This happens only if you add the charts to a dashboard from Visualize. Looks like that action adds this to session storage:

EMBEDDABLE_STATE_TRANSFER: {
    "visualize": {
        "originatingApp": "dashboards",
        "embeddableId": "e14aa766-2fc1-40c1-ac2f-8daeb9fa4c0c",
        "searchSessionId": "d95d87ba-8eb0-4034-b23e-57423357f4e2"
    }
}

Any subsequent opening of visualize from the ML DFA pages will then result in the 'Save and return' and 'Cancel' buttons appearing in the header and redirecting to the dashboard rather than ML. Maybe we can set ML as the originating app, or if not, clear that key? Makes sense to address in a follow up.

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@alvarezmelissa87
Copy link
Contributor Author

alvarezmelissa87 commented Jan 30, 2023

@walterra - the issue regarding the classification job results not showing up correctly (#149647 (comment)) has been fixed in e14f32f

The other updates have been made cc @peteharverson

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 3.4MB 3.4MB +1.6KB
Unknown metric groups

ESLint disabled line counts

id before after diff
ml 556 557 +1

Total ESLint disabled count

id before after diff
ml 559 560 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @alvarezmelissa87

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

Tested the latest version and classification charts now get correctly displayed in the Vega editor! Would be great to have a functional test so we can track regressions should anything with the Vega Editor change, but can be done in a follow up.

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.

Tested latest changes and LGTM.

Would be good to fix that return / cancel behavior in a follow up if possible from the ML code.

@alvarezmelissa87 alvarezmelissa87 merged commit e534d87 into elastic:main Jan 31, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jan 31, 2023
alvarezmelissa87 added a commit that referenced this pull request Feb 2, 2023
… link to custom visualization (#150103)

## Summary

Follow up to #149647
Link to flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1856

This PR adds a functional test for the scatterplot matrix link in the
DFA results view to custom visualizations UI.


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this pull request Feb 6, 2023
…ions for viewing scatterplot charts (elastic#149647)

## Summary

This PR adds a link to the custom visualization UI from scatterplot
matrix charts in the data frame analytics job wizard and results views.
This allows you to view the data and edit the visualization inside the
custom visualization editor, and then save it to a dashboard to explore
the data alongside other contextual information.

<img width="884" alt="image"
src="https://user-images.githubusercontent.com/7405507/215125288-9d5527fa-6074-42bd-98f1-2c04cd025432.png">

Related meta issue: elastic#131551

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Data Frame Analytics ML data frame analytics features :ml release_note:enhancement v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants