Skip to content

Commit

Permalink
bump vegalite dep, fix dispose (#16335)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik authored Jan 30, 2018
1 parent d682ac5 commit 0d400a5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"uuid": "3.0.1",
"validate-npm-package-name": "2.2.2",
"vega-lib": "3.0.10",
"vega-lite": "2.1.0",
"vega-lite": "2.1.2",
"vega-schema-url-parser": "1.0.0",
"vision": "4.1.0",
"webpack": "3.6.0",
Expand Down
34 changes: 18 additions & 16 deletions src/core_plugins/vega/public/vega_view/vega_base_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,25 @@ export class VegaBaseView {
}

if (window) {
if (!view) {
// disposing, get rid of the stale debug info
delete window.VEGA_DEBUG;
} else {
if (window.VEGA_DEBUG === undefined && console) {
console.log('%cWelcome to Kibana Vega Plugin!', 'font-size: 16px; font-weight: bold;');
console.log('You can access the Vega view with VEGA_DEBUG. ' +
'Learn more at https://vega.github.io/vega/docs/api/debugging/.');
}

window.VEGA_DEBUG = window.VEGA_DEBUG || {};
window.VEGA_DEBUG.VEGA_VERSION = vega.version;
window.VEGA_DEBUG.VEGA_LITE_VERSION = vegaLite.version;
window.VEGA_DEBUG.view = view;
window.VEGA_DEBUG.vega_spec = spec;
window.VEGA_DEBUG.vegalite_spec = vlspec;
if (window.VEGA_DEBUG === undefined && console) {
console.log('%cWelcome to Kibana Vega Plugin!', 'font-size: 16px; font-weight: bold;');
console.log('You can access the Vega view with VEGA_DEBUG. ' +
'Learn more at https://vega.github.io/vega/docs/api/debugging/.');
}
const debugObj = {};
window.VEGA_DEBUG = debugObj;
window.VEGA_DEBUG.VEGA_VERSION = vega.version;
window.VEGA_DEBUG.VEGA_LITE_VERSION = vegaLite.version;
window.VEGA_DEBUG.view = view;
window.VEGA_DEBUG.vega_spec = spec;
window.VEGA_DEBUG.vegalite_spec = vlspec;

// On dispose, clean up, but don't use undefined to prevent repeated debug statements
this._addDestroyHandler(() => {
if (debugObj === window.VEGA_DEBUG) {
window.VEGA_DEBUG = null;
}
});
}
}

Expand Down
11 changes: 8 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
version "0.2.3"
resolved "https://registry.yarnpkg.com/@elastic/ui-ace/-/ui-ace-0.2.3.tgz#5281aed47a79b7216c55542b0675e435692f20cd"

"@types/json-stable-stringify@^1.0.32":
version "1.0.32"
resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e"

"@types/node@*":
version "9.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.3.0.tgz#3a129cda7c4e5df2409702626892cb4b96546dd5"
Expand Down Expand Up @@ -11807,10 +11811,11 @@ [email protected]:
vega-voronoi "2"
vega-wordcloud "^2.1"

[email protected].0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-2.1.0.tgz#8e6c1d438da6400eebdb53f0da7f9801b9da96f9"
[email protected].2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-2.1.2.tgz#ca94eb1d9633763ec6465e40fec7ed040779f695"
dependencies:
"@types/json-stable-stringify" "^1.0.32"
json-stable-stringify "^1.0.1"
tslib "^1.9.0"
vega-event-selector "^2.0.0"
Expand Down

0 comments on commit 0d400a5

Please sign in to comment.