diff --git a/src/platform/plugins/private/vis_types/vega/public/vega_view/vega_base_view.js b/src/platform/plugins/private/vis_types/vega/public/vega_view/vega_base_view.js index 89c2fbe8848c5..599d0f2837cd6 100644 --- a/src/platform/plugins/private/vis_types/vega/public/vega_view/vega_base_view.js +++ b/src/platform/plugins/private/vis_types/vega/public/vega_view/vega_base_view.js @@ -9,9 +9,8 @@ import moment from 'moment'; import dateMath from '@kbn/datemath'; -import { loader, logger, Warn, version as vegaVersion, expressionFunction } from 'vega'; +import { loader, logger, Warn, expressionFunction } from 'vega'; import { expressionInterpreter } from 'vega-interpreter'; -import { version as vegaLiteVersion } from 'vega-lite'; import { Utils } from '../data_model/utils'; import { i18n } from '@kbn/i18n'; import { buildQueryFilter, compareFilters } from '@kbn/es-query'; @@ -494,33 +493,6 @@ export class VegaBaseView { view, spec: vlspec || spec, }); - - if (window) { - 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 = vegaVersion; - window.VEGA_DEBUG.VEGA_LITE_VERSION = vegaLiteVersion; - 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.view = null; - window.VEGA_DEBUG.vega_spec = null; - window.VEGA_DEBUG.vegalite_spec = null; - window.VEGA_DEBUG = null; - } - }); - } } destroy() { diff --git a/src/platform/plugins/private/vis_types/vega/public/vega_visualization.test.tsx b/src/platform/plugins/private/vis_types/vega/public/vega_visualization.test.tsx index 22dd695c60d06..927e37316eb67 100644 --- a/src/platform/plugins/private/vis_types/vega/public/vega_visualization.test.tsx +++ b/src/platform/plugins/private/vis_types/vega/public/vega_visualization.test.tsx @@ -83,9 +83,6 @@ describe('VegaVisualizations', () => { }); test('should show vegalite graph and update on resize (may fail in dev env)', async () => { - const mockedConsoleLog = jest.spyOn(console, 'log'); // mocked console.log to avoid messages in the console when running tests - mockedConsoleLog.mockImplementation(() => {}); // comment this line when console logging for debugging comment this line - let vegaVis: InstanceType; try { vegaVis = new VegaVisualization(domNode, jest.fn()); @@ -116,9 +113,6 @@ describe('VegaVisualizations', () => { } finally { vegaVis.destroy(); } - // eslint-disable-next-line no-console - expect(console.log).toBeCalledTimes(2); - mockedConsoleLog.mockRestore(); }); test('should show vega graph (may fail in dev env)', async () => {