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

Using uiActions to navigate from discover to visualize #70178

Closed
timroes opened this issue Jun 29, 2020 · 3 comments · Fixed by #74121
Closed

Using uiActions to navigate from discover to visualize #70178

timroes opened this issue Jun 29, 2020 · 3 comments · Fixed by #74121
Assignees
Labels
Feature:Discover Discover Application Feature:Vis Editor Visualization editor issues Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@timroes
Copy link
Contributor

timroes commented Jun 29, 2020

We currently use a hardcoded link to navigate from discover via the field panel "Visualize" button to the visualize editor (or maps). Instead we should use the uiActions system and create a new trigger type VISUALIZE_DATA. The maps application and the visualize editor can then register actions to fulfill those trigger and jump into the apps. This way discover doesn't need to have knowledge about those apps, and we can later also implement jumping to Lens.

Open questions:

  • How should the trigger context for the VISUALIZE_DATA trigger look like. We need at least indexPattern (by id or name? but not every editor can work without a real indexPattern, so I would suggest by id) and a field. Maybe we should add some hints, on how we would analyze this, so we can actually hinting the editor that we want a bar chart? Or at least a categorical overview of the data?
  • When multiple actions are registered for the trigger (e.g. Lens/Visualize) should we just use the one with "highest priority" (if we even have any kind of priority (yet) for actions? Or should we show a selection what the user wants to do (do we need to handle that in Discover, or does the uiActions system take care of those?

This will be a requirement for #67415

@timroes timroes added Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Vis Editor Visualization editor issues labels Jun 29, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes
Copy link
Contributor Author

timroes commented Jul 16, 2020

I've discussed this with Stacey recently, and we think the trigger for this should be part of the uiActions plugin directly, since it might be a common use-case we want to have in multiple places, and should not be exported by the discover plugin alone.

I'd also suggest naming the trigger VISUALIZE_FIELD instead of VISUALIZE_DATA. I think the context passed with that trigger will be very simple (index pattern id, field name) and thus we might need a more complex trigger later (that e.g. could visualize multiple fields, etc.). I have the feeling with VISUALIZE_FIELD we're expressing more that simple use-case that this trigger is.

@stratoula stratoula self-assigned this Jul 29, 2020
@stratoula
Copy link
Contributor

After discussing it with the actions team we concluded on the final approach:

  1. We need a second trigger VISUALIZE__GEO_FIELD to visualize the geo-related fields.
  2. Discover has the logic if the field is geo or not so is going to trigger the corresponding trigger.
  3. We will add the visualize action for the VISUALIZE__FIELD to visualize.plugin. This is straightforward.
  4. For the other trigger things are more complicated as both maps app and tile_map plugin should register on this trigger.
  5. The map app "knows" if it is enabled so it is going to register its action only when it is enabled
  6. The tile map should know somehow if it hidden or not. If it is hidden not going to register its action (uiActions isCompatible method to be used).
  7. So, if the user has both maps and tile map enabled, Visualize button on discover will give to the user both actions
  8. If not, we would ideally want to hide this button (check uiActions.getTriggerCompatibleActions(triggerId, context))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application Feature:Vis Editor Visualization editor issues Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants