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

[Backport 2.16] [VisBuilder] Add Capability to generate dynamic vega #7410

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport faaa45c from #7288.

* [VisBuilder] Add Capability to generate dynamic vega

In this PR, we add the capability for Visbuilder to generate dynamic Vega and Vega-Lite
specifications based on user settings and aggregation configurations.

* developed functions buildVegaSpecViaVega and buildVegaSpecViaVegaLite
that can create either Vega or Vega-Lite specifications depending on the complexity
of the visualization.
* added VegaSpec and VegaLiteSpec interfaces to provide better type checking
* broken down the specification building into smaller, reusable components
(like buildEncoding, buildMark, buildLegend, buildTooltip) to make the code
more maintainable and easier to extend.
* added flattenDataHandler to prepare and transform data for use in Vega visualizations

Issue Resolve
#7067

Signed-off-by: Anan Zhuang <[email protected]>

* fix PR comments

* update file and functions names
* fix type errors
* fix area chart

Signed-off-by: Anan Zhuang <[email protected]>

* add unit tests

Signed-off-by: Anan Zhuang <[email protected]>

* enable embeddable for useVega

Signed-off-by: Anan Zhuang <[email protected]>

* remove buildVegaScales due to split it to smaller modules

Signed-off-by: Anan Zhuang <[email protected]>

* fix date for vega

Signed-off-by: Anan Zhuang <[email protected]>

* fix test

Signed-off-by: Anan Zhuang <[email protected]>

* Changeset file for PR #7288 created/updated

---------

Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit faaa45c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

❌ Invalid Changelog Heading

The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 77.10280% with 49 lines in your changes missing coverage. Please review.

Project coverage is 67.87%. Comparing base (8f36039) to head (a12f4f7).

Files Patch % Lines
...lder/public/visualizations/vega/components/mark.ts 72.72% 5 Missing and 4 partials ⚠️
...public/visualizations/common/expression_helpers.ts 0.00% 8 Missing ⚠️
...uilder/public/visualizations/vega/utils/helpers.ts 77.77% 3 Missing and 5 partials ⚠️
...er/public/visualizations/vega/vega_spec_factory.ts 16.66% 5 Missing ⚠️
...r/public/visualizations/vega/components/tooltip.ts 69.23% 1 Missing and 3 partials ⚠️
...blic/visualizations/vega/vega_lite_spec_builder.ts 71.42% 1 Missing and 3 partials ⚠️
...uilder/public/application/components/workspace.tsx 0.00% 2 Missing ⚠️
...ilder/public/embeddable/vis_builder_embeddable.tsx 0.00% 2 Missing ⚠️
.../public/visualizations/vega/components/encoding.ts 85.71% 0 Missing and 2 partials ⚠️
...er/public/visualizations/vega/vega_spec_builder.ts 86.66% 1 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             2.16    #7410      +/-   ##
==========================================
+ Coverage   67.80%   67.87%   +0.06%     
==========================================
  Files        3578     3589      +11     
  Lines       72123    72322     +199     
  Branches    11788    11837      +49     
==========================================
+ Hits        48905    49088     +183     
+ Misses      20246    20243       -3     
- Partials     2972     2991      +19     
Flag Coverage Δ
Linux_1 33.49% <77.10%> (+0.24%) ⬆️
Linux_2 55.66% <ø> (ø)
Linux_3 44.46% <ø> (ø)
Linux_4 34.20% <ø> (ø)
Windows_1 33.51% <77.10%> (+0.24%) ⬆️
Windows_2 55.61% <ø> (ø)
Windows_3 44.47% <ø> (ø)
Windows_4 34.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ananzh ananzh merged commit abeee70 into 2.16 Jul 23, 2024
69 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants