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

[Lens] Ignore global filters in data layers #143493

Closed
stratoula opened this issue Oct 18, 2022 · 18 comments · Fixed by #159248
Closed

[Lens] Ignore global filters in data layers #143493

stratoula opened this issue Oct 18, 2022 · 18 comments · Fixed by #159248
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@stratoula
Copy link
Contributor

Describe the feature:
There are users that are asking to add the Ignore global filters functionality (per data layer) in Lens. This is useful in some cases, for example I want to filter some visualizations in a dashboard but exclude others from filtering.

This functionality also exists in TSVB so we should consider enabling it for the TSVB to Lens transition.
Moreover it already exists in the annotations layer.

image

@stratoula stratoula added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Oct 18, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@dej611
Copy link
Contributor

dej611 commented Oct 19, 2022

Should it be per layer or per visualization?
Probably the former is easier to implement given the current state, but the latter makes more sense to me in your use case.

@stratoula
Copy link
Contributor Author

Good question, TSVB allows both (per layer and per chart)
I was thinking that the per layer is closer to what we are doing with annotations and maybe gives more flexibility to the users but I see your point! @ninoslavmiskovic wdyt?

@flash1293
Copy link
Contributor

+1 for the per layer switch, no need to make it more complex with another switch in another place IMHO

@ninoslavmiskovic
Copy link
Contributor

Do we know if users are using the per chart on TSVB?

@flash1293
Copy link
Contributor

@ninoslavmiskovic we don't track that

@ninoslavmiskovic
Copy link
Contributor

In that case let's go for the layer to ensure consistency within Lens.

@stratoula
Copy link
Contributor Author

I was thinking about this feature. I wonder if it makes sense to also have an indicator on the dashboard level that this panel is ignoring the dashboard filters. (?)

@flash1293
Copy link
Contributor

Cc’ing the @elastic/kibana-presentation for the comment above - has there been thoughts along those lines? It seems to fit the “Panel filters” badge well

@Heenawter
Copy link
Contributor

We have an issue defined for having a visual indicator for when global filters don't apply to a visualization (for example, when multiple data views are used in a single dashboard). I think this could tie nicely into that! 👀 cc @cqliu1

@nreese
Copy link
Contributor

nreese commented Oct 26, 2022

Another thing to consider is that part of the panel could be ignoring global filters while another part of the panel could be using global filters.

In Maps, individual layers can ignore global search and global time. This information is conveyed to users via a tooltip on each layer that specifies whether the results are narrowed by global time and global search.

Screen Shot 2022-10-26 at 9 13 25 AM

@ThomThomson
Copy link
Contributor

Great call about adding this info alongside the filter ignored system @Heenawter. IMO, we should maybe go further and combine all of the filtering information for a panel into one universal filtering info badge. The badge would serve the purpose of showing the user that something is up with the filtering of this panel, and clicking on it would surface relevant information like:

  • Are there any panel-level filters saved into this panel?
  • Are there global filters that are ignored by this panel due to a data view conflict etc?
  • Are the individual layers of this panel configured with their own filters? Are they configured to ignore all or some of the global filters?

Since we already rely on the Embeddable implementations to surface the filters, we could modify our code to also allow them to surface some custom filtering info UI. That way, embeddable types like Lens and Maps which have multiple layers could build and display their own layer filtering info in this modal / flyout.

@nreese, even though Maps has the advantage of showing the layers in context, I think it could be beneficial to surface the panel filtering info via this badge as well. Do you think that might work?

@stratoula
Copy link
Contributor Author

@ThomThomson ++ on your proposal. It will be super useful for our users to have this information on the dashboard level.

@jack-morrison
Copy link

jack-morrison commented Nov 8, 2022

Are the newer Controls implemented as global filters? (IIRC the now deprecated Input Controls appeared to work by adding/removing filters.) If this proposal would allow for a data layer to ignore a dashboard's Control selections, I'd be very excited about this feature.

My use case would be to essentially to "fix" a baseline series on a chart that remains stable through an end-user making Controls selections which would otherwise filter out the baseline's data.

[Control] Job #: 456
---------------------
[Chart] 
Series showing Job 123 (fixed baseline; ignores Control/global filters)
Series showing Job 456 (variable through Control selections)

To my knowledge, this isn't possible today in Lens using non-timeseries data.

@ThomThomson
Copy link
Contributor

ThomThomson commented Nov 8, 2022

@jack-morrison I can confirm from the Dashboard side that it does pass down Control selections as filters to its children. It does that without creating new filter pills, but from the Lens POV, all passed down filters should be treated the same.

@jack-morrison
Copy link

@ThomThomson thanks for the quick response and info. If I understand correctly, this proposal should enable the use case I've been hoping for!

@stratoula stratoula added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Dec 21, 2022
@code4mankind
Copy link

++ for the per layer switch - we are hitting this same limitation. The dashboard controls (filters) are passed thru to the "children" lens view, however, the annotation layer on the lens view does not respect the controls (filters).

In it's current form, it makes the annotations layer unusable. Our dashboard controls typically represent environments/services and require the selection of one option only in each control (providing a narrow filter for the dashboard). However, the annotations layer will overlay with data from all environments/services which can be misleading.

@stratoula
Copy link
Contributor Author

@code4mankind annotations layer has this setting, not sure if you have seen it.
image

@dej611 dej611 self-assigned this Jun 6, 2023
dej611 added a commit that referenced this issue Jun 9, 2023
## Summary

Fixes #143493

* Add the switch control in Layer Settings
  * [x] Make sure it does not duplicate on Annotation Layer Settings 
  * [x] Data Layers
  * [x] Reference line layers
  * [x] Extended dataView picker to support multiple icons
    * [x] Added unit tests 
  * [x] Functional tests

<img width="351" alt="Screenshot 2023-06-07 at 15 28 19"
src="https://github.com/elastic/kibana/assets/924948/00dc5523-0bec-4e9c-b1d0-4d36804b29f9">
<img width="340" alt="Screenshot 2023-06-07 at 15 31 31"
src="https://github.com/elastic/kibana/assets/924948/d36ca147-5d8c-4123-9be3-2932844cbd15">
<img width="331" alt="Screenshot 2023-06-07 at 15 28 25"
src="https://github.com/elastic/kibana/assets/924948/c7d4f166-b8ab-4439-a83c-debf82b913ad">
<img width="324" alt="Screenshot 2023-06-07 at 15 27 59"
src="https://github.com/elastic/kibana/assets/924948/3738a7e0-6e49-4e22-b857-965a953b4b84">
<img width="323" alt="Screenshot 2023-06-07 at 15 27 53"
src="https://github.com/elastic/kibana/assets/924948/5965bf1c-0e25-4c0e-b54f-fa315157fd44">


*  Create `IgnoreGlobalFilter` shared component folder
   * [x] Layer setting control component
   * [x] Info badge component
   
 * Extends `esaggs_fn` to support the flag
   * [x] Avoid to pass the filter to the handler if set
   * [x] Add unit tests

* Notification badges
* [x] Extends the badge component in Embeddable to support grouped
messages
    * [x] Added unit tests
  
<img width="750" alt="Screenshot 2023-06-07 at 15 31 39"
src="https://github.com/elastic/kibana/assets/924948/01bf8203-9133-4429-9b79-17ec67613c7e">
<img width="828" alt="Screenshot 2023-06-07 at 15 30 57"
src="https://github.com/elastic/kibana/assets/924948/9acb78f2-d061-4225-a4af-b3a66e7454fc">
<img width="756" alt="Screenshot 2023-06-07 at 15 27 43"
src="https://github.com/elastic/kibana/assets/924948/b9f79aed-7c02-4060-9c0f-61f438dc031d">


* Add support for Open in Lens
  * [x] Add unit tests for each converter
  * [x] Functional tests


### Checklist

Delete any items that are not applicable to this PR.

- [x] 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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Stratoula Kalafateli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants