@@ -39,6 +39,7 @@ import {
3939 createGoalVisTypeDefinition ,
4040} from './vis_type_vislib_vis_types' ;
4141import { ChartsPluginSetup } from '../../../../plugins/charts/public' ;
42+ import { ConfigShema as VisTypeXyConfigShema } from '../../vis_type_xy' ;
4243
4344export interface VisTypeVislibDependencies {
4445 uiSettings : IUiSettingsClient ;
@@ -73,19 +74,28 @@ export class VisTypeVislibPlugin implements Plugin<Promise<void>, void> {
7374 charts,
7475 } ;
7576
76- expressions . registerFunction ( createVisTypeVislibVisFn ) ;
77- expressions . registerFunction ( createPieVisFn ) ;
77+ const visTypeXy = core . injectedMetadata . getInjectedVar ( 'visTypeXy' ) as
78+ | VisTypeXyConfigShema [ 'visTypeXy' ]
79+ | undefined ;
7880
79- [
80- createHistogramVisTypeDefinition ,
81- createLineVisTypeDefinition ,
82- createPieVisTypeDefinition ,
83- createAreaVisTypeDefinition ,
84- createHeatmapVisTypeDefinition ,
85- createHorizontalBarVisTypeDefinition ,
86- createGaugeVisTypeDefinition ,
87- createGoalVisTypeDefinition ,
88- ] . forEach ( vis => visualizations . types . createBaseVisualization ( vis ( visualizationDependencies ) ) ) ;
81+ // if visTypeXy plugin is disabled it's config will be undefined
82+ if ( ! visTypeXy || ! visTypeXy . enabled ) {
83+ expressions . registerFunction ( createVisTypeVislibVisFn ) ;
84+ expressions . registerFunction ( createPieVisFn ) ;
85+
86+ [
87+ createHistogramVisTypeDefinition ,
88+ createLineVisTypeDefinition ,
89+ createPieVisTypeDefinition ,
90+ createAreaVisTypeDefinition ,
91+ createHeatmapVisTypeDefinition ,
92+ createHorizontalBarVisTypeDefinition ,
93+ createGaugeVisTypeDefinition ,
94+ createGoalVisTypeDefinition ,
95+ ] . forEach ( vis =>
96+ visualizations . types . createBaseVisualization ( vis ( visualizationDependencies ) )
97+ ) ;
98+ }
8999 }
90100
91101 public start ( core : CoreStart , deps : VisTypeVislibPluginStartDependencies ) {
0 commit comments