-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
11 changed files
with
287 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { resolve } from 'path'; | ||
import { Legacy } from '../../../../kibana'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function VisualizationsPlugin(kibana: any) { | ||
const config: Legacy.PluginSpecOptions = { | ||
id: 'visualizations', | ||
require: ['data'], | ||
publicDir: resolve(__dirname, 'public'), | ||
config: (Joi: any) => { | ||
return Joi.object({ | ||
enabled: Joi.boolean().default(true), | ||
}).default(); | ||
}, | ||
init: (server: Legacy.Server) => ({}), | ||
}; | ||
|
||
return new kibana.Plugin(config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "visualizations", | ||
"version": "kibana" | ||
} |
42 changes: 42 additions & 0 deletions
42
src/legacy/core_plugins/visualizations/public/filters/filters_service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
// @ts-ignore | ||
import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; | ||
|
||
/** | ||
* Vis Filters Service | ||
* | ||
* @internal | ||
*/ | ||
export class FiltersService { | ||
public setup() { | ||
return { | ||
VisFiltersProvider, | ||
createFilter, | ||
}; | ||
} | ||
|
||
public stop() { | ||
// nothing to do here yet | ||
} | ||
} | ||
|
||
/** @public */ | ||
export type FiltersSetup = ReturnType<FiltersService['setup']>; |
20 changes: 20 additions & 0 deletions
20
src/legacy/core_plugins/visualizations/public/filters/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export { FiltersService, FiltersSetup } from './filters_service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { FiltersService, FiltersSetup } from './filters'; | ||
import { TypesService, TypesSetup } from './types'; | ||
|
||
class VisualizationsPlugin { | ||
private readonly filters: FiltersService; | ||
private readonly types: TypesService; | ||
|
||
constructor() { | ||
this.filters = new FiltersService(); | ||
this.types = new TypesService(); | ||
} | ||
|
||
public setup() { | ||
return { | ||
filters: this.filters.setup(), | ||
types: this.types.setup(), | ||
}; | ||
} | ||
|
||
public stop() { | ||
this.filters.stop(); | ||
this.types.stop(); | ||
} | ||
} | ||
|
||
/** | ||
* We export visualizations here so that users importing from 'plugins/visualizations' | ||
* will automatically receive the response value of the `setup` contract, mimicking | ||
* the data that will eventually be injected by the new platform. | ||
*/ | ||
export const visualizations = new VisualizationsPlugin().setup(); | ||
|
||
/** @public */ | ||
export interface VisualizationsSetup { | ||
filters: FiltersSetup; | ||
types: TypesSetup; | ||
} | ||
|
||
/** @public types */ | ||
export { | ||
Vis, | ||
VisParams, | ||
VisProvider, | ||
VisState, | ||
VisualizationController, | ||
VisType, | ||
VisTypesRegistry, | ||
Status, | ||
} from './types'; |
32 changes: 32 additions & 0 deletions
32
src/legacy/core_plugins/visualizations/public/types/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export { | ||
TypesService, | ||
// types | ||
TypesSetup, | ||
Vis, | ||
VisParams, | ||
VisProvider, | ||
VisState, | ||
VisualizationController, | ||
VisType, | ||
VisTypesRegistry, | ||
Status, | ||
} from './types_service'; |
59 changes: 59 additions & 0 deletions
59
src/legacy/core_plugins/visualizations/public/types/types_service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
// @ts-ignore | ||
import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; | ||
// @ts-ignore | ||
import { VisProvider as Vis } from 'ui/vis/index.js'; | ||
// @ts-ignore | ||
import { VisFactoryProvider as VisFactory } from 'ui/vis/vis_factory'; | ||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; | ||
|
||
/** | ||
* Vis Types Service | ||
* | ||
* @internal | ||
*/ | ||
export class TypesService { | ||
public setup() { | ||
return { | ||
Vis, | ||
VisFactory, | ||
VisTypesRegistryProvider, | ||
defaultFeedbackMessage, // make default in base vis type, or move? | ||
}; | ||
} | ||
|
||
public stop() { | ||
// nothing to do here yet | ||
} | ||
} | ||
|
||
/** @public */ | ||
export type TypesSetup = ReturnType<TypesService['setup']>; | ||
|
||
/** @public types */ | ||
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, VisType } from 'ui/vis/vis_types/vis_type'; | ||
export { VisTypesRegistry } from 'ui/registry/vis_types'; | ||
export { Status } from 'ui/vis/update_status'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export { VisFiltersProvider, createFilter } from './vis_filters'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters