remove angular from Vis (#50402)
This commit is contained in:
parent
b5a0d4b03d
commit
4f888196b7
|
@ -21,7 +21,7 @@ import chrome from 'ui/chrome';
|
|||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
// @ts-ignore
|
||||
import { VisProvider } from '../../../../ui/public/visualize/loader/vis';
|
||||
import { Vis } from '../../../../ui/public/visualize/loader/vis';
|
||||
import { Visualization } from '../../../../ui/public/visualize/components';
|
||||
|
||||
export const visualization = () => ({
|
||||
|
@ -33,8 +33,6 @@ export const visualization = () => ({
|
|||
const visType = config.visType || visConfig.type;
|
||||
const $injector = await chrome.dangerouslyGetActiveInjector();
|
||||
const $rootScope = $injector.get('$rootScope') as any;
|
||||
const Private = $injector.get('Private') as any;
|
||||
const Vis = Private(VisProvider);
|
||||
|
||||
if (handlers.vis) {
|
||||
// special case in visualize, we need to render first (without executing the expression), for maps to work
|
||||
|
|
|
@ -57,7 +57,7 @@ import {
|
|||
subscribeWithScope,
|
||||
tabifyAggResponse,
|
||||
vislibSeriesResponseHandlerProvider,
|
||||
VisProvider,
|
||||
Vis,
|
||||
SavedObjectSaveModal,
|
||||
} from '../kibana_services';
|
||||
|
||||
|
@ -190,7 +190,6 @@ function discoverController(
|
|||
localStorage,
|
||||
uiCapabilities
|
||||
) {
|
||||
const Vis = Private(VisProvider);
|
||||
const responseHandler = vislibSeriesResponseHandlerProvider().handler;
|
||||
const getUnhashableStates = Private(getUnhashableStatesProvider);
|
||||
const shareContextMenuExtensions = Private(ShareContextMenuExtensionsRegistryProvider);
|
||||
|
|
|
@ -114,7 +114,7 @@ export { tabifyAggResponse } from 'ui/agg_response/tabify';
|
|||
export { vislibSeriesResponseHandlerProvider } from 'ui/vis/response_handlers/vislib';
|
||||
|
||||
// EXPORT types
|
||||
export { VisProvider } from 'ui/vis';
|
||||
export { Vis } from 'ui/vis';
|
||||
export { StaticIndexPattern, IndexPatterns, IndexPattern, FieldType } from 'ui/index_patterns';
|
||||
export { SearchSource } from 'ui/courier';
|
||||
export { ElasticSearchHit } from 'ui/registry/doc_views_types';
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* NOTE: It's a type of SavedObject, but specific to visualizations.
|
||||
*/
|
||||
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { updateOldState } from 'ui/vis/vis_update_state';
|
||||
import { VisualizeConstants } from '../visualize_constants';
|
||||
|
@ -39,7 +39,6 @@ import {
|
|||
uiModules
|
||||
.get('app/visualize')
|
||||
.factory('SavedVis', function (Promise, savedSearches, Private) {
|
||||
const Vis = Private(VisProvider);
|
||||
const SavedObject = Private(SavedObjectProvider);
|
||||
createLegacyClass(SavedVis).inherits(SavedObject);
|
||||
function SavedVis(opts) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import ngMock from 'ng_mock';
|
|||
import _ from 'lodash';
|
||||
import ChoroplethLayer from '../choropleth_layer';
|
||||
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import * as visModule from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { ImageComparator } from 'test_utils/image_comparator';
|
||||
import worldJson from './world.json';
|
||||
import EMS_CATALOGUE from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json';
|
||||
|
@ -50,7 +50,6 @@ const PIXEL_DIFF = 96;
|
|||
describe('RegionMapsVisualizationTests', function () {
|
||||
let domNode;
|
||||
let RegionMapsVisualization;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let vis;
|
||||
let dependencies;
|
||||
|
@ -113,7 +112,6 @@ describe('RegionMapsVisualizationTests', function () {
|
|||
visualizationsSetup.types.registerVisualization(() => createRegionMapTypeDefinition(dependencies));
|
||||
}
|
||||
|
||||
Vis = Private(visModule.VisProvider);
|
||||
RegionMapsVisualization = createRegionMapVisualization(dependencies);
|
||||
indexPattern = Private(LogstashIndexPatternStubProvider);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import * as visModule from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { ImageComparator } from 'test_utils/image_comparator';
|
||||
import dummyESResponse from './dummy_es_response.json';
|
||||
import initial from './initial.png';
|
||||
|
@ -65,7 +65,6 @@ let visRegComplete = false;
|
|||
describe('CoordinateMapsVisualizationTest', function () {
|
||||
let domNode;
|
||||
let CoordinateMapsVisualization;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let vis;
|
||||
let dependencies;
|
||||
|
@ -91,7 +90,6 @@ describe('CoordinateMapsVisualizationTest', function () {
|
|||
}
|
||||
|
||||
|
||||
Vis = Private(visModule.VisProvider);
|
||||
CoordinateMapsVisualization = createTileMapVisualization(dependencies);
|
||||
indexPattern = Private(LogstashIndexPatternStubProvider);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import $ from 'jquery';
|
|||
import ngMock from 'ng_mock';
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
import { createMetricVisTypeDefinition } from '../metric_vis_type';
|
||||
|
@ -34,7 +34,6 @@ describe('metric_vis - createMetricVisTypeDefinition', () => {
|
|||
beforeEach(
|
||||
ngMock.inject(Private => {
|
||||
setup = () => {
|
||||
const Vis = Private(VisProvider);
|
||||
const metricVisType = createMetricVisTypeDefinition();
|
||||
const indexPattern = Private(LogstashIndexPatternStubProvider);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import $ from 'jquery';
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { legacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy';
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { AppStateProvider } from 'ui/state_management/app_state';
|
||||
|
@ -36,7 +36,6 @@ describe('Table Vis - Controller', async function () {
|
|||
let Private;
|
||||
let $scope;
|
||||
let $el;
|
||||
let Vis;
|
||||
let fixtures;
|
||||
let AppState;
|
||||
let tableAggResponse;
|
||||
|
@ -63,7 +62,6 @@ describe('Table Vis - Controller', async function () {
|
|||
$compile = $injector.get('$compile');
|
||||
fixtures = require('fixtures/fake_hierarchical_data');
|
||||
AppState = Private(AppStateProvider);
|
||||
Vis = Private(VisProvider);
|
||||
tableAggResponse = legacyResponseHandlerProvider().handler;
|
||||
})
|
||||
);
|
||||
|
|
|
@ -25,7 +25,7 @@ import fixtures from 'fixtures/fake_hierarchical_data';
|
|||
import sinon from 'sinon';
|
||||
import { legacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { tabifyAggResponse } from 'ui/agg_response/tabify';
|
||||
import { round } from 'lodash';
|
||||
|
||||
|
@ -36,7 +36,6 @@ import { setup as visualizationsSetup } from '../../../../visualizations/public/
|
|||
describe('Table Vis - AggTable Directive', function () {
|
||||
let $rootScope;
|
||||
let $compile;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let settings;
|
||||
let tableAggResponse;
|
||||
|
@ -113,7 +112,6 @@ describe('Table Vis - AggTable Directive', function () {
|
|||
ngMock.inject(function ($injector, Private, config) {
|
||||
tableAggResponse = legacyResponseHandlerProvider().handler;
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
Vis = Private(VisProvider);
|
||||
settings = config;
|
||||
|
||||
$rootScope = $injector.get('$rootScope');
|
||||
|
|
|
@ -23,13 +23,12 @@ import expect from '@kbn/expect';
|
|||
import fixtures from 'fixtures/fake_hierarchical_data';
|
||||
import { legacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { tabifyAggResponse } from 'ui/agg_response/tabify';
|
||||
|
||||
describe('Table Vis - AggTableGroup Directive', function () {
|
||||
let $rootScope;
|
||||
let $compile;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let tableAggResponse;
|
||||
const tabifiedData = {};
|
||||
|
@ -69,7 +68,6 @@ describe('Table Vis - AggTableGroup Directive', function () {
|
|||
|
||||
tableAggResponse = legacyResponseHandlerProvider().handler;
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
Vis = Private(VisProvider);
|
||||
|
||||
$rootScope = $injector.get('$rootScope');
|
||||
$compile = $injector.get('$compile');
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import * as visModule from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { ImageComparator } from 'test_utils/image_comparator';
|
||||
import { TagCloudVisualization } from '../tag_cloud_visualization';
|
||||
import basicdrawPng from './basicdraw.png';
|
||||
|
@ -33,7 +33,6 @@ const PIXEL_DIFF = 64;
|
|||
describe('TagCloudVisualizationTest', function () {
|
||||
|
||||
let domNode;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let vis;
|
||||
let imageComparator;
|
||||
|
@ -57,7 +56,6 @@ describe('TagCloudVisualizationTest', function () {
|
|||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject((Private) => {
|
||||
Vis = Private(visModule.VisProvider);
|
||||
indexPattern = Private(LogstashIndexPatternStubProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ const APP_NAME = 'VisEditor';
|
|||
export class VisEditor extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const { vis } = props;
|
||||
this.appState = vis.API.getAppState();
|
||||
this.appState = props.appState;
|
||||
this.localStorage = new Storage(window.localStorage);
|
||||
this.state = {
|
||||
model: props.visParams,
|
||||
|
@ -183,7 +182,6 @@ export class VisEditor extends Component {
|
|||
dirty={this.state.dirty}
|
||||
autoApply={this.state.autoApply}
|
||||
model={model}
|
||||
appState={this.appState}
|
||||
savedObj={this.props.savedObj}
|
||||
timeRange={this.props.timeRange}
|
||||
uiState={this.uiState}
|
||||
|
@ -239,4 +237,5 @@ VisEditor.propTypes = {
|
|||
isEditorMode: PropTypes.bool,
|
||||
savedObj: PropTypes.object,
|
||||
timeRange: PropTypes.object,
|
||||
appState: PropTypes.object,
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ import ngMock from 'ng_mock';
|
|||
import $ from 'jquery';
|
||||
import { createVegaVisualization } from '../vega_visualization';
|
||||
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import * as visModule from 'ui/vis';
|
||||
import { Vis } from 'ui/vis';
|
||||
import { ImageComparator } from 'test_utils/image_comparator';
|
||||
|
||||
import vegaliteGraph from '!!raw-loader!./vegalite_graph.hjson';
|
||||
|
@ -50,7 +50,6 @@ const PIXEL_DIFF = 30;
|
|||
describe('VegaVisualizations', () => {
|
||||
let domNode;
|
||||
let VegaVisualization;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let vis;
|
||||
let imageComparator;
|
||||
|
@ -73,7 +72,6 @@ describe('VegaVisualizations', () => {
|
|||
);
|
||||
}
|
||||
|
||||
Vis = Private(visModule.VisProvider);
|
||||
|
||||
VegaVisualization = createVegaVisualization(vegaVisualizationDependencies);
|
||||
indexPattern = Private(LogstashIndexPatternStubProvider);
|
||||
|
|
|
@ -39,7 +39,6 @@ export { DefaultEditorSize } from 'ui/vis/editor_size';
|
|||
import * as types from 'ui/vis/vis';
|
||||
export type Vis = types.Vis;
|
||||
export type VisParams = types.VisParams;
|
||||
export type VisProvider = types.VisProvider;
|
||||
export type VisState = types.VisState;
|
||||
export { VisualizationController } from 'ui/vis/vis_types/vis_type';
|
||||
export { Status } from 'ui/vis/update_status';
|
||||
|
|
|
@ -20,15 +20,13 @@
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { tabifyGetColumns } from '../_get_columns';
|
||||
import { VisProvider } from '../../../vis';
|
||||
import { Vis } from '../../../vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
describe('get columns', function () {
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private) {
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -22,16 +22,14 @@ import fixtures from 'fixtures/fake_hierarchical_data';
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { tabifyAggResponse } from '../tabify';
|
||||
import { VisProvider } from '../../../vis';
|
||||
import { Vis } from '../../../vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
describe('tabifyAggResponse Integration', function () {
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private) {
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -20,11 +20,10 @@
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { TabbedAggResponseWriter } from '../_response_writer';
|
||||
import { VisProvider } from '../../../vis';
|
||||
import { Vis } from '../../../vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
describe('TabbedAggResponseWriter class', function () {
|
||||
let Vis;
|
||||
let Private;
|
||||
let indexPattern;
|
||||
|
||||
|
@ -32,7 +31,6 @@ describe('TabbedAggResponseWriter class', function () {
|
|||
beforeEach(ngMock.inject(function ($injector) {
|
||||
Private = $injector.get('Private');
|
||||
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { buildOtherBucketAgg, mergeOtherBucketAggResponse, updateMissingBucket } from '../../buckets/_terms_other_bucket_helper';
|
||||
import { VisProvider } from '../../../vis';
|
||||
import { Vis } from '../../../vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
const visConfigSingleTerm = {
|
||||
|
@ -158,7 +158,6 @@ describe('Terms Agg Other bucket helper', () => {
|
|||
function init(aggConfig) {
|
||||
ngMock.module('kibana');
|
||||
ngMock.inject((Private) => {
|
||||
const Vis = Private(VisProvider);
|
||||
const indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
|
||||
vis = new Vis(indexPattern, aggConfig);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import sinon from 'sinon';
|
||||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { VisProvider } from '..';
|
||||
import { Vis } from '..';
|
||||
import { AggType } from '../../agg_types/agg_type';
|
||||
import { AggConfig } from '../../agg_types/agg_config';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
@ -28,12 +28,10 @@ import { fieldFormats } from '../../registry/field_formats';
|
|||
|
||||
describe('AggConfig', function () {
|
||||
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private) {
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import sinon from 'sinon';
|
|||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { AggConfig } from '../../agg_types/agg_config';
|
||||
import { VisProvider } from '..';
|
||||
import { Vis } from '..';
|
||||
import { AggConfigs } from '../../agg_types/agg_configs';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { Schemas } from '../editors/default/schemas';
|
||||
|
@ -30,13 +30,11 @@ import { AggGroupNames } from '../editors/default/agg_groups';
|
|||
|
||||
describe('AggConfigs', function () {
|
||||
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private) {
|
||||
// load main deps
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -20,13 +20,12 @@
|
|||
import _ from 'lodash';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from '@kbn/expect';
|
||||
import { VisProvider } from '..';
|
||||
import { Vis } from '..';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { start as visualizations } from '../../../../core_plugins/visualizations/public/np_ready/public/legacy';
|
||||
|
||||
describe('Vis Class', function () {
|
||||
let indexPattern;
|
||||
let Vis;
|
||||
let visTypes;
|
||||
|
||||
let vis;
|
||||
|
@ -43,7 +42,6 @@ describe('Vis Class', function () {
|
|||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private) {
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
visTypes = visualizations.types;
|
||||
}));
|
||||
|
|
2
src/legacy/ui/public/vis/index.d.ts
vendored
2
src/legacy/ui/public/vis/index.d.ts
vendored
|
@ -18,5 +18,5 @@
|
|||
*/
|
||||
|
||||
export { AggConfig } from '../agg_types/agg_config';
|
||||
export { Vis, VisProvider, VisParams, VisState } from './vis';
|
||||
export { Vis, VisParams, VisState } from './vis';
|
||||
export { VisualizationController, VisType } from './vis_types/vis_type';
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export { VisProvider } from './vis';
|
||||
export { Vis } from './vis';
|
||||
|
|
2
src/legacy/ui/public/vis/vis.d.ts
vendored
2
src/legacy/ui/public/vis/vis.d.ts
vendored
|
@ -30,8 +30,6 @@ export interface Vis {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type VisProvider = (...dependencies: any[]) => Vis;
|
||||
|
||||
export interface VisParams {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
|
|
@ -38,10 +38,9 @@ import { start as visualizations } from '../../../core_plugins/visualizations/pu
|
|||
|
||||
import '../directives/bind';
|
||||
|
||||
export function VisProvider(Private, getAppState) {
|
||||
const visTypes = visualizations.types;
|
||||
const visTypes = visualizations.types;
|
||||
|
||||
class Vis extends EventEmitter {
|
||||
class Vis extends EventEmitter {
|
||||
constructor(indexPattern, visState) {
|
||||
super();
|
||||
visState = visState || {};
|
||||
|
@ -66,7 +65,6 @@ export function VisProvider(Private, getAppState) {
|
|||
filter: data => this.eventsSubject.next({ name: 'filterBucket', data }),
|
||||
brush: data => this.eventsSubject.next({ name: 'brush', data }),
|
||||
},
|
||||
getAppState,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -210,9 +208,8 @@ export function VisProvider(Private, getAppState) {
|
|||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
Vis.prototype.type = 'histogram';
|
||||
|
||||
return Vis;
|
||||
}
|
||||
|
||||
Vis.prototype.type = 'histogram';
|
||||
|
||||
export { Vis };
|
||||
|
|
|
@ -21,7 +21,7 @@ import $ from 'jquery';
|
|||
import _ from 'lodash';
|
||||
import expect from '@kbn/expect';
|
||||
import ngMock from 'ng_mock';
|
||||
import { VisProvider } from '../../vis';
|
||||
import { Vis } from '../../vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
||||
describe('visualize_legend directive', function () {
|
||||
|
@ -29,7 +29,6 @@ describe('visualize_legend directive', function () {
|
|||
let $compile;
|
||||
let $timeout;
|
||||
let $el;
|
||||
let Vis;
|
||||
let indexPattern;
|
||||
let fixtures;
|
||||
|
||||
|
@ -39,7 +38,6 @@ describe('visualize_legend directive', function () {
|
|||
$compile = $injector.get('$compile');
|
||||
$timeout = $injector.get('$timeout');
|
||||
fixtures = require('fixtures/fake_hierarchical_data');
|
||||
Vis = Private(VisProvider);
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
}));
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import _ from 'lodash';
|
|||
import fixtures from 'fixtures/fake_hierarchical_data';
|
||||
import $ from 'jquery';
|
||||
import FixturesVislibVisFixtureProvider from 'fixtures/vislib/_vis_fixture';
|
||||
import { VisProvider } from '../../../vis';
|
||||
import { Vis } from '../../../vis';
|
||||
import '../../../persisted_state';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
import { vislibSlicesResponseHandlerProvider } from '../../../vis/response_handlers/vislib';
|
||||
|
@ -113,7 +113,6 @@ describe('No global chart settings', function () {
|
|||
addTooltip: true
|
||||
};
|
||||
let chart1;
|
||||
let Vis;
|
||||
let persistedState;
|
||||
let indexPattern;
|
||||
let responseHandler;
|
||||
|
@ -123,7 +122,6 @@ describe('No global chart settings', function () {
|
|||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||
chart1 = Private(FixturesVislibVisFixtureProvider)(visLibParams1);
|
||||
Vis = Private(VisProvider);
|
||||
persistedState = new ($injector.get('PersistedState'))();
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
responseHandler = vislibSlicesResponseHandlerProvider().handler;
|
||||
|
@ -203,7 +201,6 @@ describe('Vislib PieChart Class Test Suite', function () {
|
|||
addTooltip: true
|
||||
};
|
||||
let vis;
|
||||
let Vis;
|
||||
let persistedState;
|
||||
let indexPattern;
|
||||
let data;
|
||||
|
@ -213,7 +210,6 @@ describe('Vislib PieChart Class Test Suite', function () {
|
|||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (Private, $injector) {
|
||||
vis = Private(FixturesVislibVisFixtureProvider)(visLibParams);
|
||||
Vis = Private(VisProvider);
|
||||
persistedState = new ($injector.get('PersistedState'))();
|
||||
indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
|
||||
responseHandler = vislibSlicesResponseHandlerProvider().handler;
|
||||
|
|
|
@ -33,10 +33,9 @@ import { PersistedState } from '../../persisted_state';
|
|||
|
||||
import { start as visualizations } from '../../../../core_plugins/visualizations/public/np_ready/public/legacy';
|
||||
|
||||
export function VisProvider(getAppState) {
|
||||
const visTypes = visualizations.types;
|
||||
const visTypes = visualizations.types;
|
||||
|
||||
class Vis extends EventEmitter {
|
||||
export class Vis extends EventEmitter {
|
||||
constructor(visState = { type: 'histogram' }) {
|
||||
super();
|
||||
|
||||
|
@ -58,7 +57,6 @@ export function VisProvider(getAppState) {
|
|||
this.eventsSubject.next({ name: 'brush', data });
|
||||
},
|
||||
},
|
||||
getAppState,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -140,7 +138,4 @@ export function VisProvider(getAppState) {
|
|||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
return Vis;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue