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

Update vega to version 4 #30628

Merged
merged 7 commits into from
Feb 14, 2019
Merged

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Feb 11, 2019

Summary

Resolves #22644

Updates version of vega-lib and vega-lite to the most recent stable release. Tested against some complex examples from the vega-lite website and didn't encounter any errors so far.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately

@flash1293 flash1293 changed the title [wip] [skip-ci] Update vega to version 4 Update vega to version 4 Feb 11, 2019
@flash1293 flash1293 added Feature:Vega Vega visualizations Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Feb 11, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@flash1293 flash1293 requested a review from nyurik February 11, 2019 15:17
@flash1293
Copy link
Contributor Author

Jenkins, test this.

Copy link
Contributor

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking through the Vega v4 breaking changes, and it seems the only thing we might have to handle is the new fetch interface for data loading. This may affect "url": "https://..." as well as (maybe) type: emsfile loading. See https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/vega/public/vega_view/vega_base_view.js#L141 where the v3 data loading is handled.

docs/visualize/vega.asciidoc Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@@ -116,8 +116,8 @@ describe('VegaParser._parseSchema', () => {
expect(vp.spec).to.eql({ $schema: 'https://vega.github.io/schema/vega/v3.0.json' });
expect(vp.warnings).to.have.length(1);
});
it('vega', test('https://vega.github.io/schema/vega/v3.0.json', false, 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead modifying those tests, we might want instead to add new tests, since the v3.0 schema should still work. So I think we should just create a new test testing for vega 4.0. And just modify the test that checks for invalid vega schema to v5.0.

Also these test names are super bad, so maybe we could properly rename that test to: should support v3.0 schema, should support v4.0 schema, should not support v5.0 schema. (Why is the test for the newer Vega spec that's not yet supported even called vega old :D).

@@ -116,8 +116,8 @@ describe('VegaParser._parseSchema', () => {
expect(vp.spec).to.eql({ $schema: 'https://vega.github.io/schema/vega/v3.0.json' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should switch the default specification to Vega 4 now. But that might break existing Vega visualisations, so I think we can't do it 🤔 Meaning from now on the default spec will always stay Vega 3.0. Kind of stupid, but maybe we should have forbidden specs without a schema in the first place.

Copy link
Contributor Author

@flash1293 flash1293 Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - Suggestion: We remove the default version as a breaking change in 8.0 and leave it at 3.0 for now (in a separate PR)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that suggestion. I'll open an issue, for that plan.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -8,6 +8,10 @@ into Kibana, either standalone, or on top of a map. To see Vega in action,
watch this
https://www.youtube.com/watch?v=lQGCipY3th8[short introduction video].

Currently Vega version 4.4 and VegaLite version 2.6 are supported.

NOTE: In Vega it is possible to load data dynamically, e.g. by setting signals as data urls. This is not supported in Kibana as all data is fetched at once prior to passing it to the vega renderer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vega renderer -> Vega renderer (for consistency)

@flash1293
Copy link
Contributor Author

@nyurik About the the data loading - I tested with http urls and they worked without any problems.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, Tested with some known broken specs, and seem to work now.

@nyurik
Copy link
Contributor

nyurik commented Feb 13, 2019

@nyurik About the the data loading - I tested with http urls and they worked without any problems.

Were you able to load external data via URL without changing kibana.yml file? By default, loading should be prohibited for security reasons.

@flash1293
Copy link
Contributor Author

@nyurik No, only after changing kibana.yml

Copy link
Contributor

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Turns out fetch is irrelevant to us, sanitizer api is the same as before. Yeppi! Now time to backport it to 5.5 😄

@nyurik
Copy link
Contributor

nyurik commented Feb 14, 2019

Just to make things interesting... vega/vega#1561

@flash1293 flash1293 merged commit 2ede2e3 into elastic:master Feb 14, 2019
@flash1293 flash1293 deleted the chore/vega-update branch February 14, 2019 10:35
flash1293 added a commit to flash1293/kibana that referenced this pull request Feb 14, 2019
flash1293 added a commit to flash1293/kibana that referenced this pull request Feb 14, 2019
flash1293 added a commit to flash1293/kibana that referenced this pull request Feb 14, 2019
@LeeDr LeeDr mentioned this pull request Feb 15, 2019
1 task
@ctrongduc
Copy link

Good job on updating to the new version 👍, next step would be v5, I'm exited now 💯
How do I try Kibana with this new version? I pull the docker image version 7.0.0-beta1, but it's still running on version 3.3.1

https://www.docker.elastic.co/

@flash1293
Copy link
Contributor Author

Hi @ctrongduc we are also excited! The vega 5 upgrade is tracked here: #31413
We will have to fix some stuff in our webpack infrastructure for this to work though.

Unfortunately the vega upgrade didn't make it in beta-1, but it should be in the next release. Till then you can check out master and yarn kbn bootstrap && yarn start

@dypsilon
Copy link

Thank you so much for this upgrade!
With which version will it be released? I am using 7.6.2 but if I try to use the v4.json schema, I receive the following message: "The input spec uses vega-lite v4, but current version of vega-lite is 2.6.0."

@flash1293
Copy link
Contributor Author

@dypsilon This is just about updating vega to version 4, not vega lite - these are two separate libraries with diverging version numbers. Unfortunately the most currently supported version of vega-lite is 2.6

@dypsilon
Copy link

@flash1293 I see, thank you for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Vega Vega visualizations release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0 v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Vega] Update to most recent version (4.2 at least)
6 participants