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][uiActions] Allow brushing and filtering at the same time using combined context #103062

Open
flash1293 opened this issue Jun 23, 2021 · 7 comments
Labels
Feature:Filters impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

Right now it's either possible to emit an ui action for the VALUE_CLICK_TRIGGER or SELECT_RANGE_TRIGGER for chart interactions because our chart types allowed these two things.

However the elastic-charts heatmap allows selecting a rectangle of cells at the same time - if one of the axes is a histogram axis, this is basically a click and select range action at the same time:
thenew

This should show the filter selection modal with three lines:

  • Apply gz
  • Apply css
  • Apply time range from x to y

I suggest extending the value click trigger for this to handle ranges as well:

Current state:

export interface ValueClickContext<T extends IEmbeddable = IEmbeddable> {
  embeddable?: T;
  data: {
    data: Array<{
      table: Pick<Datatable, 'rows' | 'columns'>;
      column: number;
      row: number;
      value: any;
    }>;
    timeFieldName?: string;
    negate?: boolean;
  };
}

Extension:

export interface ValueClickContext<T extends IEmbeddable = IEmbeddable> {
  embeddable?: T;
  data: {
    data: Array<{
      table: Pick<Datatable, 'rows' | 'columns'>;
      column: number;
      row: number;
      value: any;
    } | {
      table: Pick<Datatable, 'rows' | 'columns'>;
      column: number;
      range: number[];
    }>;
    timeFieldName?: string;
    negate?: boolean;
  };
}

This is basically pulling the range context data into the value click context.

What do you think @ppisljar ?

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@ppisljar
Copy link
Member

would that mean we get rid of the range select action completely ? should we simplify the typing then and say that we always do range selection, but possibly startdate === enddate for the case of simple value click ?

@flash1293
Copy link
Contributor Author

No strong opinion on how the API is going to look like

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Jun 28, 2021
@exalate-issue-sync exalate-issue-sync bot changed the title Allow brushing and filtering at the same time using combined context [uiActions] Allow brushing and filtering at the same time using combined context Jul 12, 2021
@ppisljar
Copy link
Member

i would suggest something like this:

export interface ValueClickContext<T extends IEmbeddable = IEmbeddable> {
  embeddable?: T;
  data: {
    data: Array<{
      table: Pick<Datatable, 'rows' | 'columns'>;
      column: number;
      range: number[];
      value: any;
    }>;
    timeFieldName?: string;
    negate?: boolean;
  };
}

if range.from === range.to then its a simple click

  • update the type of VALUE_CLICK_TRIGGER context
  • update value_click action to work with the new type
  • update all current usages of VALUE_CLICK_TRIGGER with correct context
  • update all current usages of RANGE_SELECT_TRIGGER to rather use new VALUE_CLICK_TRIGGER
  • remove RANGE_SELECT_TRIGGER and range select action

@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jul 22, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Jun 13, 2022
@vadimkibana vadimkibana added Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) and removed Team:AppServicesUx labels Jan 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@vadimkibana vadimkibana added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Jan 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@markov00
Copy link
Member

This is now possible to implement in the tooltip actions, we can add a function that says filter both time and selected series.

@ghudgins ghudgins changed the title [uiActions] Allow brushing and filtering at the same time using combined context [Lens][uiActions] Allow brushing and filtering at the same time using combined context Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Filters impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants