Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0d92f83
[WIP][Vega] Use mapbox instead of leaflet #78395
alexwizp Dec 21, 2020
c693d60
move EMSClient to a separate bundle
alexwizp Jan 21, 2021
64aafd5
Merge branch 'master' into mapbox_vega
kibanamachine Jan 21, 2021
4bcdcc9
[unit testing] add tests for validation_helper.ts
alexwizp Jan 22, 2021
0e64d1c
[Bundle optimization] lazy loading of '@elastic/ems-client' only if u…
alexwizp Jan 22, 2021
1e67cb4
[Map] fix cursor: crosshair -> auto
alexwizp Jan 22, 2021
240728f
[unit testing] add tests for tms_raster_layer.test
alexwizp Jan 22, 2021
216f130
[unit testing] add tests for vega_layer.ts
alexwizp Jan 22, 2021
df82eb1
VSI related code was moved into a separate file / unit tests were added
alexwizp Jan 22, 2021
fe38c90
Merge branch 'master' into mapbox_vega
kibanamachine Jan 22, 2021
665c207
Add functional test for vega map
VladLasitsa Jan 22, 2021
aa3b241
[unit testing] add tests for map_service_setting.ts
alexwizp Jan 22, 2021
4fe48d8
Add unload in function test and delete some unneeded code from test
VladLasitsa Jan 24, 2021
913ea29
Merge branch 'master' into mapbox_vega
kibanamachine Jan 25, 2021
a0b3147
road_map -> road_map_desaturated
alexwizp Jan 25, 2021
33426d2
[unit testing] add more tests for map_service_settings.test.ts
alexwizp Jan 25, 2021
a0ea2fa
Add unit tests for view.ts
VladLasitsa Jan 25, 2021
4b599b1
Fix some remarks
VladLasitsa Jan 26, 2021
28f1a2b
Fix unit tests
VladLasitsa Jan 26, 2021
b767c61
remove tms_tile_layers enum
alexwizp Jan 26, 2021
4fdf70a
[unit testing] fix map_service_settings.test.ts
alexwizp Jan 26, 2021
e53c50e
Fix unit test for view.ts
VladLasitsa Jan 26, 2021
9e1e3d5
Merge branch 'master' into mapbox_vega
kibanamachine Jan 26, 2021
5b8e62f
Fix some comments
VladLasitsa Jan 28, 2021
9f6e8e2
Fix type check
VladLasitsa Jan 28, 2021
daca709
Merge branch 'master' into mapbox_vega
kibanamachine Jan 28, 2021
6dad8b7
Merge branch 'master' into mapbox_vega
kibanamachine Jan 29, 2021
3c97d8a
Fix CI
VladLasitsa Jan 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/plugins/vis_type_vega/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ import {
setData,
setInjectedVars,
setUISettings,
setMapsLegacyConfig,
setInjectedMetadata,
setMapServiceSettings,
} from './services';

import { createVegaFn } from './vega_fn';
import { createVegaTypeDefinition } from './vega_type';
import { IServiceSettings } from '../../maps_legacy/public';
import { IServiceSettings, MapsLegacyPluginSetup } from '../../maps_legacy/public';
import { ConfigSchema } from '../config';

import { getVegaInspectorView } from './vega_inspector';
import { getVegaVisRenderer } from './vega_vis_renderer';
import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings';

/** @internal */
export interface VegaVisualizationDependencies {
Expand All @@ -44,7 +45,7 @@ export interface VegaPluginSetupDependencies {
visualizations: VisualizationsSetup;
inspector: InspectorSetup;
data: DataPublicPluginSetup;
mapsLegacy: any;
mapsLegacy: MapsLegacyPluginSetup;
}

/** @internal */
Expand All @@ -68,8 +69,12 @@ export class VegaPlugin implements Plugin<Promise<void>, void> {
enableExternalUrls: this.initializerContext.config.get().enableExternalUrls,
emsTileLayerId: core.injectedMetadata.getInjectedVar('emsTileLayerId', true),
});

setUISettings(core.uiSettings);
setMapsLegacyConfig(mapsLegacy.config);

setMapServiceSettings(
new MapServiceSettings(mapsLegacy.config, this.initializerContext.env.packageInfo.version)
);

const visualizationDependencies: Readonly<VegaVisualizationDependencies> = {
core,
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/vis_type_vega/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CoreStart, NotificationsStart, IUiSettingsClient } from 'src/core/publi

import { DataPublicPluginStart } from '../../data/public';
import { createGetterSetter } from '../../kibana_utils/public';
import { MapsLegacyConfig } from '../../maps_legacy/config';
import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings';

export const [getData, setData] = createGetterSetter<DataPublicPluginStart>('Data');

Expand All @@ -24,13 +24,14 @@ export const [getInjectedMetadata, setInjectedMetadata] = createGetterSetter<
CoreStart['injectedMetadata']
>('InjectedMetadata');

export const [
getMapServiceSettings,
setMapServiceSettings,
] = createGetterSetter<MapServiceSettings>('MapServiceSettings');

export const [getInjectedVars, setInjectedVars] = createGetterSetter<{
enableExternalUrls: boolean;
emsTileLayerId: unknown;
}>('InjectedVars');

export const [getMapsLegacyConfig, setMapsLegacyConfig] = createGetterSetter<MapsLegacyConfig>(
'MapsLegacyConfig'
);

export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"config": {
"kibana": { "renderer": "svg", "type": "map", "mapStyle": false}
"kibana": { "type": "map", "mapStyle": "default", "latitude": 25, "longitude": -70, "zoom": 3}
},
"width": 512,
"height": 512,
Expand Down
11 changes: 10 additions & 1 deletion src/plugins/vis_type_vega/public/vega_view/vega_base_view.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ interface VegaViewParams {
serviceSettings: IServiceSettings;
filterManager: DataPublicPluginStart['query']['filterManager'];
timefilter: DataPublicPluginStart['query']['timefilter']['timefilter'];
// findIndex: (index: string) => Promise<...>;
}

export class VegaBaseView {
constructor(params: VegaViewParams);
init(): Promise<void>;
onError(error: any): void;
onWarn(error: any): void;
setView(map: any): void;
setDebugValues(view: any, spec: any, vlspec: any): void;
_addDestroyHandler(handler: Function): void;

destroy(): Promise<void>;

_$container: any;
_parser: any;
_vegaViewConfig: any;
_serviceSettings: any;
}
9 changes: 7 additions & 2 deletions src/plugins/vis_type_vega/public/vega_view/vega_base_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ export class VegaBaseView {

createViewConfig() {
const config = {
// eslint-disable-next-line import/namespace
logLevel: vega.Warn, // note: eslint has a false positive here
renderer: this._parser.renderer,
};

Expand Down Expand Up @@ -189,6 +187,13 @@ export class VegaBaseView {
};
config.loader = loader;

const logger = vega.logger(vega.Warn);

logger.warn = this.onWarn.bind(this);
logger.error = this.onError.bind(this);

config.logger = logger;

return config;
}

Expand Down
28 changes: 0 additions & 28 deletions src/plugins/vis_type_vega/public/vega_view/vega_map_layer.js

This file was deleted.

168 changes: 0 additions & 168 deletions src/plugins/vis_type_vega/public/vega_view/vega_map_view.js

This file was deleted.

Loading