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] Provide formula helper to simplify integration of Lens instances #103055

Closed
dej611 opened this issue Jun 23, 2021 · 1 comment · Fixed by #122371
Closed

[Lens] Provide formula helper to simplify integration of Lens instances #103055

dej611 opened this issue Jun 23, 2021 · 1 comment · Fixed by #122371
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects

Comments

@dej611
Copy link
Contributor

dej611 commented Jun 23, 2021

Describe the feature:

A function a Lens consumer can import and given a formula string, return a parsed result as list of columns to use as Embeddable attributes.

Describe a specific use case for the feature:

When a consumer wants to integrate a Lens instance within his plugin and wants to provide a Formula operation for a dimension, the current setup requires the consumer to manually craft a formula string AND all the referenced columns with the right parameters in sync.

In particular case this can be a long and tricky task, for instance when using filtered metrics or long formulas.

@dej611 dej611 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jun 23, 2021
@elasticmachine
Copy link
Contributor

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

@kibanamachine kibanamachine added this to Long-term goals in Lens Jun 23, 2021
@flash1293 flash1293 moved this from Long-term goals to 8.1 in Lens Oct 19, 2021
@alexwizp alexwizp self-assigned this Jan 4, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 5, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 5, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 6, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 6, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 6, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 6, 2022
alexwizp added a commit to alexwizp/kibana that referenced this issue Jan 6, 2022
Lens automation moved this from 8.1 to Done Jan 17, 2022
alexwizp added a commit that referenced this issue Jan 17, 2022
…es (#122371)

* [Lens] Provide formula helper to simplify integration of Lens instances

Closes: #103055

* remove generateFormulaColumns from start contract

* upsertFormulaColumn

* add upsertFormulaColumn to start contract

* add integration with embedded_lens_examples

* upsert -> insertOrReplace

* add support of overriding operations

* add docs

* fix TS issues

* fix some comments

* fix PR comments

* fix PR comments

* fix CI

* Update x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/formula_helper.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* Update x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/formula_helper.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* remove useEffect

* move baseLayer part into getLensAttributes

* introduce stateHelperApi

* Map -> WeakMap

* remove [params.operations] from params

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ogupte pushed a commit to ogupte/kibana that referenced this issue Jan 28, 2022
…es (elastic#122371)

* [Lens] Provide formula helper to simplify integration of Lens instances

Closes: elastic#103055

* remove generateFormulaColumns from start contract

* upsertFormulaColumn

* add upsertFormulaColumn to start contract

* add integration with embedded_lens_examples

* upsert -> insertOrReplace

* add support of overriding operations

* add docs

* fix TS issues

* fix some comments

* fix PR comments

* fix PR comments

* fix CI

* Update x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/formula_helper.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* Update x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/formula_helper.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* remove useEffect

* move baseLayer part into getLensAttributes

* introduce stateHelperApi

* Map -> WeakMap

* remove [params.operations] from params

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
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
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
No open projects
Lens
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants