-
Notifications
You must be signed in to change notification settings - Fork 913
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
[Chore] Add vega-lite
v5 dependency and bundle from source
#3076
Merged
joshuarrrr
merged 5 commits into
opensearch-project:main
from
joshuarrrr:chore/vega-lite-v5-from-source
Jan 9, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e410fb7
[Chore] Add vega-lite v5 dep and bundle from source
joshuarrrr 8dbc4a7
[Chore] Update vega-lite defaults and tests to v5
joshuarrrr 1d3823a
[Chore] Remove backwards-compatible hacks for `main` target
joshuarrrr ad59146
Merge branch 'main' into chore/vega-lite-v5-from-source
joshuarrrr 289e33c
[Chore] Fix webpack config filter
joshuarrrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,7 +456,7 @@ | |
"ui-select": "0.19.8", | ||
"vega": "^5.17.3", | ||
"vega-interpreter": "npm:@amoo-miki/[email protected]", | ||
"vega-lite": "^4.16.8", | ||
"vega-lite": "^5.6.0", | ||
"vega-schema-url-parser": "^2.1.0", | ||
"vega-tooltip": "^0.24.2", | ||
"vinyl-fs": "^3.0.3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
{ | ||
/* | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewers - sorry for sneaking in a somewhat unrelated change, but the lack of indentation in the tutorial spec has been driving me nuts for weeks, and I couldn't resist fixing while I was already editing this file. |
||
|
||
Welcome to Vega visualizations. Here you can design your own dataviz from scratch using a declarative language called Vega, or its simpler form Vega-Lite. In Vega, you have the full control of what data is loaded, even from multiple sources, how that data is transformed, and what visual elements are used to show it. Use help icon to view Vega examples, tutorials, and other docs. Use the wrench icon to reformat this text, or to remove comments. | ||
Welcome to Vega visualizations. Here you can design your own dataviz from scratch using a declarative language called Vega, or its simpler form Vega-Lite. In Vega, you have the full control of what data is loaded, even from multiple sources, how that data is transformed, and what visual elements are used to show it. Use help icon to view Vega examples, tutorials, and other docs. Use the wrench icon to reformat this text, or to remove comments. | ||
|
||
This example graph shows the document count in all indexes in the current time range. You might need to adjust the time filter in the upper right corner. | ||
*/ | ||
This example graph shows the document count in all indexes in the current time range. You might need to adjust the time filter in the upper right corner. | ||
*/ | ||
|
||
$schema: https://vega.github.io/schema/vega-lite/v4.json | ||
$schema: https://vega.github.io/schema/vega-lite/v5.json | ||
title: Event counts from all indexes | ||
|
||
// Define the data source | ||
data: { | ||
url: { | ||
/* | ||
An object instead of a string for the "url" param is treated as an OpenSearch query. Anything inside this object is not part of the Vega language, but only understood by OpenSearch Dashboards and OpenSearch server. This query counts the number of documents per time interval, assuming you have a @timestamp field in your data. | ||
/* | ||
An object instead of a string for the "url" param is treated as an OpenSearch query. Anything inside this object is not part of the Vega language, but only understood by OpenSearch Dashboards and OpenSearch server. This query counts the number of documents per time interval, assuming you have a @timestamp field in your data. | ||
|
||
OpenSearch Dashboards has a special handling for the fields surrounded by "%". They are processed before the the query is sent to OpenSearch. This way the query becomes context aware, and can use the time range and the dashboard filters. | ||
*/ | ||
OpenSearch Dashboards has a special handling for the fields surrounded by "%". They are processed before the the query is sent to OpenSearch. This way the query becomes context aware, and can use the time range and the dashboard filters. | ||
*/ | ||
|
||
// Apply dashboard context filters when set | ||
%context%: true | ||
// Filter the time picker (upper right corner) with this field | ||
%timefield%: @timestamp | ||
|
||
/* | ||
See .search() documentation for : https://opensearch.org/docs/latest/clients/javascript/ | ||
*/ | ||
/* | ||
See .search() documentation for : https://opensearch.org/docs/latest/clients/javascript/ | ||
*/ | ||
|
||
// Which index to search | ||
index: _all | ||
|
@@ -53,29 +53,29 @@ See .search() documentation for : https://opensearch.org/docs/latest/clients/ja | |
size: 0 | ||
} | ||
} | ||
/* | ||
OpenSearch will return results in this format: | ||
/* | ||
OpenSearch will return results in this format: | ||
|
||
aggregations: { | ||
time_buckets: { | ||
buckets: [ | ||
{ | ||
key_as_string: 2015-11-30T22:00:00.000Z | ||
key: 1448920800000 | ||
doc_count: 0 | ||
}, | ||
{ | ||
key_as_string: 2015-11-30T23:00:00.000Z | ||
key: 1448924400000 | ||
doc_count: 0 | ||
aggregations: { | ||
time_buckets: { | ||
buckets: [ | ||
{ | ||
key_as_string: 2015-11-30T22:00:00.000Z | ||
key: 1448920800000 | ||
doc_count: 0 | ||
}, | ||
{ | ||
key_as_string: 2015-11-30T23:00:00.000Z | ||
key: 1448924400000 | ||
doc_count: 0 | ||
} | ||
... | ||
] | ||
} | ||
... | ||
] | ||
} | ||
} | ||
} | ||
|
||
For our graph, we only need the list of bucket values. Use the format.property to discard everything else. | ||
*/ | ||
For our graph, we only need the list of bucket values. Use the format.property to discard everything else. | ||
*/ | ||
format: {property: "aggregations.time_buckets.buckets"} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/plugins/vis_type_vega/public/test_utils/vegalite_graph.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Miki doesn't know English.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make a follow-up PR to fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3239