@syncfusion/ej2-maps 19.4.56 → 19.4.57-105067
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -439
- package/README.md +73 -73
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1161 -638
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1200 -678
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +24 -3
- package/src/maps/maps.js +152 -90
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +26 -32
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +27 -35
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +33 -21
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +62 -31
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import { print as printFunction, createElement } from '@syncfusion/ej2-base';
|
|
3
|
+
import { Maps } from '../../index';
|
|
4
|
+
import { getElement, getClientElement } from '../utils/helper';
|
|
5
|
+
import { IPrintEventArgs } from '../model/interface';
|
|
6
|
+
import { beforePrint } from '../model/constants';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module enables the print functionality in maps.
|
|
10
|
+
*
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export class Print {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for Maps
|
|
17
|
+
*
|
|
18
|
+
* @param {Maps} control - Specifies the instance of the map
|
|
19
|
+
*/
|
|
20
|
+
constructor(control: Maps) { }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* To print the Maps
|
|
24
|
+
*
|
|
25
|
+
* @param {string[] | string | Element} elements - Specifies the element
|
|
26
|
+
* @returns {void}
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
public print(maps: Maps, elements?: string[] | string | Element): void {
|
|
30
|
+
let printWindow: Window = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
31
|
+
printWindow.moveTo(0, 0);
|
|
32
|
+
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
33
|
+
const argsData: IPrintEventArgs = {
|
|
34
|
+
cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
|
|
35
|
+
};
|
|
36
|
+
maps.trigger('beforePrint', argsData, (beforePrintArgs: IPrintEventArgs) => {
|
|
37
|
+
if (!argsData.cancel) {
|
|
38
|
+
printFunction(argsData.htmlContent, printWindow);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* To get the html string of the Maps
|
|
45
|
+
*
|
|
46
|
+
* @param {string[] | string | Element} elements - Specifies the html element
|
|
47
|
+
* @returns {Element} - Returns the div element
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private getHTMLContent(maps: Maps, elements?: string[] | string | Element): Element {
|
|
51
|
+
let div: Element = createElement('div');
|
|
52
|
+
let divElement: Element = maps.element.cloneNode(true) as Element;
|
|
53
|
+
if (maps.isTileMap) {
|
|
54
|
+
for (let i: number = 0; i < divElement.childElementCount; i++) {
|
|
55
|
+
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
56
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('height');
|
|
57
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('width');
|
|
58
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('top');
|
|
59
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('left');
|
|
60
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('right');
|
|
61
|
+
(divElement.children[i] as HTMLElement).style.removeProperty('overflow');
|
|
62
|
+
const svgElement: HTMLElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
63
|
+
(divElement.children[i].children[0] as HTMLElement).style.overflow = 'hidden';
|
|
64
|
+
(divElement.children[i].children[0] as HTMLElement).style.position = 'absolute';
|
|
65
|
+
(divElement.children[i].children[0] as HTMLElement).style.height = svgElement.style.height;
|
|
66
|
+
(divElement.children[i].children[0] as HTMLElement).style.width = svgElement.style.width;
|
|
67
|
+
(divElement.children[i].children[0] as HTMLElement).style.left = svgElement.style.left;
|
|
68
|
+
(divElement.children[i].children[0] as HTMLElement).style.top = svgElement.style.top;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (elements) {
|
|
74
|
+
if (elements instanceof Array) {
|
|
75
|
+
Array.prototype.forEach.call(elements, (value: string) => {
|
|
76
|
+
div.appendChild(getElement(value).cloneNode(true) as Element);
|
|
77
|
+
});
|
|
78
|
+
} else if (elements instanceof Element) {
|
|
79
|
+
div.appendChild(elements.cloneNode(true) as Element);
|
|
80
|
+
} else {
|
|
81
|
+
div.appendChild(getElement(elements).cloneNode(true) as Element);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
div.appendChild(divElement);
|
|
85
|
+
}
|
|
86
|
+
return div;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get module name.
|
|
90
|
+
*
|
|
91
|
+
* @returns {string} Returns the module name
|
|
92
|
+
*/
|
|
93
|
+
protected getModuleName(): string {
|
|
94
|
+
return 'Print';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* To destroy the print.
|
|
99
|
+
*
|
|
100
|
+
* @returns {void}
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
public destroy(): void { }
|
|
104
|
+
}
|
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps Themes doc
|
|
3
|
+
*/
|
|
4
|
+
import { IFontMapping, MapsTheme } from '../index';
|
|
5
|
+
import { IThemeStyle } from './interface';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Specifies Maps Themes
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
11
|
+
export namespace Theme {
|
|
12
|
+
/** @private */
|
|
13
|
+
export const mapsTitleFont: IFontMapping = {
|
|
14
|
+
size: '14px',
|
|
15
|
+
fontWeight: null,
|
|
16
|
+
color: '#424242',
|
|
17
|
+
fontStyle: 'Medium',
|
|
18
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
19
|
+
};
|
|
20
|
+
/** @private */
|
|
21
|
+
export const mapsSubTitleFont: IFontMapping = {
|
|
22
|
+
size: '13px',
|
|
23
|
+
fontWeight: null,
|
|
24
|
+
color: '#424242',
|
|
25
|
+
fontStyle: 'Medium',
|
|
26
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
27
|
+
};
|
|
28
|
+
/** @private */
|
|
29
|
+
export const tooltipLabelFont: IFontMapping = {
|
|
30
|
+
size: '12px',
|
|
31
|
+
fontWeight: 'Regular',
|
|
32
|
+
color: null,
|
|
33
|
+
fontStyle: 'Regular',
|
|
34
|
+
fontFamily: null
|
|
35
|
+
};
|
|
36
|
+
/** @private */
|
|
37
|
+
export const legendTitleFont: IFontMapping = {
|
|
38
|
+
size: '12px',
|
|
39
|
+
fontWeight: 'Medium',
|
|
40
|
+
color: null,
|
|
41
|
+
fontStyle: 'Medium',
|
|
42
|
+
fontFamily: null
|
|
43
|
+
};
|
|
44
|
+
/** @private */
|
|
45
|
+
export const legendLabelFont: IFontMapping = {
|
|
46
|
+
size: '13px',
|
|
47
|
+
fontWeight: 'Medium',
|
|
48
|
+
color: null,
|
|
49
|
+
fontStyle: 'Medium',
|
|
50
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
51
|
+
};
|
|
52
|
+
/** @private */
|
|
53
|
+
export const dataLabelFont: IFontMapping = {
|
|
54
|
+
size: '12px',
|
|
55
|
+
fontWeight: 'Medium',
|
|
56
|
+
color: '#000000',
|
|
57
|
+
fontStyle: 'Medium',
|
|
58
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
62
|
+
export namespace FabricTheme {
|
|
63
|
+
/** @private */
|
|
64
|
+
export const mapsTitleFont: IFontMapping = {
|
|
65
|
+
size: '14px',
|
|
66
|
+
fontWeight: 'Semibold',
|
|
67
|
+
color: '#424242',
|
|
68
|
+
fontStyle: 'Semibold',
|
|
69
|
+
fontFamily: 'SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
70
|
+
};
|
|
71
|
+
/** @private */
|
|
72
|
+
export const mapsSubTitleFont: IFontMapping = {
|
|
73
|
+
size: '13px',
|
|
74
|
+
fontWeight: 'Regular',
|
|
75
|
+
color: '#424242',
|
|
76
|
+
fontStyle: 'Regular',
|
|
77
|
+
fontFamily: 'SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
78
|
+
};
|
|
79
|
+
/** @private */
|
|
80
|
+
export const tooltipLabelFont: IFontMapping = {
|
|
81
|
+
size: '12px',
|
|
82
|
+
fontWeight: 'Regular',
|
|
83
|
+
color: '#FFFFFF',
|
|
84
|
+
fontStyle: 'Regular',
|
|
85
|
+
fontFamily: 'Roboto'
|
|
86
|
+
};
|
|
87
|
+
/** @private */
|
|
88
|
+
export const legendTitleFont: IFontMapping = {
|
|
89
|
+
size: '14px',
|
|
90
|
+
fontWeight: 'Regular',
|
|
91
|
+
color: '#757575',
|
|
92
|
+
fontStyle: 'Regular',
|
|
93
|
+
fontFamily: 'SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
94
|
+
};
|
|
95
|
+
/** @private */
|
|
96
|
+
export const legendLabelFont: IFontMapping = {
|
|
97
|
+
size: '13px',
|
|
98
|
+
fontWeight: 'Medium',
|
|
99
|
+
color: '#757575',
|
|
100
|
+
fontStyle: 'Medium',
|
|
101
|
+
fontFamily: 'SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
102
|
+
};
|
|
103
|
+
/** @private */
|
|
104
|
+
export const dataLabelFont: IFontMapping = {
|
|
105
|
+
size: '12px',
|
|
106
|
+
fontWeight: 'Medium',
|
|
107
|
+
color: '#000000',
|
|
108
|
+
fontStyle: 'Medium',
|
|
109
|
+
fontFamily: 'SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
114
|
+
export namespace BootstrapTheme {
|
|
115
|
+
/** @private */
|
|
116
|
+
export const mapsTitleFont: IFontMapping = {
|
|
117
|
+
size: '14px',
|
|
118
|
+
fontWeight: 'Semibold',
|
|
119
|
+
color: '#424242',
|
|
120
|
+
fontStyle: 'Semibold',
|
|
121
|
+
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
122
|
+
};
|
|
123
|
+
/** @private */
|
|
124
|
+
export const mapsSubTitleFont: IFontMapping = {
|
|
125
|
+
size: '13px',
|
|
126
|
+
fontWeight: 'Regular',
|
|
127
|
+
color: '#424242',
|
|
128
|
+
fontStyle: 'Regular',
|
|
129
|
+
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
130
|
+
};
|
|
131
|
+
/** @private */
|
|
132
|
+
export const tooltipLabelFont: IFontMapping = {
|
|
133
|
+
size: '12px',
|
|
134
|
+
fontWeight: 'Regular',
|
|
135
|
+
color: '#FFFFFF',
|
|
136
|
+
fontStyle: 'Regular',
|
|
137
|
+
fontFamily: 'Roboto'
|
|
138
|
+
};
|
|
139
|
+
/** @private */
|
|
140
|
+
export const legendTitleFont: IFontMapping = {
|
|
141
|
+
size: '14px',
|
|
142
|
+
fontWeight: 'Regular',
|
|
143
|
+
color: '#757575',
|
|
144
|
+
fontStyle: 'Regular',
|
|
145
|
+
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
146
|
+
};
|
|
147
|
+
/** @private */
|
|
148
|
+
export const legendLabelFont: IFontMapping = {
|
|
149
|
+
size: '13px',
|
|
150
|
+
fontWeight: 'Medium',
|
|
151
|
+
color: '#757575',
|
|
152
|
+
fontStyle: 'Medium',
|
|
153
|
+
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
154
|
+
};
|
|
155
|
+
/** @private */
|
|
156
|
+
export const dataLabelFont: IFontMapping = {
|
|
157
|
+
size: '12px',
|
|
158
|
+
fontWeight: 'Medium',
|
|
159
|
+
color: '#000000',
|
|
160
|
+
fontStyle: 'Medium',
|
|
161
|
+
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif'
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Internal use of Method to getting colors based on themes.
|
|
166
|
+
*
|
|
167
|
+
* @private
|
|
168
|
+
* @param {MapsTheme} theme Specifies the theme of the maps
|
|
169
|
+
* @returns {string[]} Returns the shape color
|
|
170
|
+
*/
|
|
171
|
+
export function getShapeColor(theme: MapsTheme): string[] {
|
|
172
|
+
let themePalette: string[];
|
|
173
|
+
switch (theme.toLowerCase()) {
|
|
174
|
+
case 'tailwind':
|
|
175
|
+
themePalette = ['#0369A1', '#14B8A6', '#15803D', '#334155', '#5A61F6',
|
|
176
|
+
'#65A30D', '#8B5CF6', '#9333EA', '#F59E0B', '#F97316'];
|
|
177
|
+
break;
|
|
178
|
+
case 'tailwinddark':
|
|
179
|
+
themePalette = ['#10B981', '#22D3EE', '#2DD4BF', '#4ADE80', '#8B5CF6',
|
|
180
|
+
'#E879F9', '#F472B6', '#F87171', '#F97316', '#FCD34D'];
|
|
181
|
+
break;
|
|
182
|
+
case 'bootstrap5':
|
|
183
|
+
themePalette = ['#262E0B', '#668E1F', '#AF6E10', '#862C0B', '#1F2D50',
|
|
184
|
+
'#64680B', '#311508', '#4C4C81', '#0C7DA0', '#862C0B'];
|
|
185
|
+
break;
|
|
186
|
+
case 'bootstrap5dark':
|
|
187
|
+
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
188
|
+
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
189
|
+
break;
|
|
190
|
+
case 'fluent':
|
|
191
|
+
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
192
|
+
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
193
|
+
break;
|
|
194
|
+
case 'fluentdark':
|
|
195
|
+
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
196
|
+
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
197
|
+
break;
|
|
198
|
+
default:
|
|
199
|
+
themePalette = ['#B5E485', '#7BC1E8', '#DF819C', '#EC9B79', '#78D0D3',
|
|
200
|
+
'#D6D572', '#9178E3', '#A1E5B4', '#87A4B4', '#E4C16C'];
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
return themePalette;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* HighContrast Theme configuration
|
|
207
|
+
*/
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
209
|
+
export namespace HighContrastTheme {
|
|
210
|
+
/** @private */
|
|
211
|
+
export const mapsTitleFont: IFontMapping = {
|
|
212
|
+
size: '14px',
|
|
213
|
+
fontWeight: 'Medium',
|
|
214
|
+
color: '#FFFFFF',
|
|
215
|
+
fontStyle: 'Medium',
|
|
216
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
217
|
+
};
|
|
218
|
+
/** @private */
|
|
219
|
+
export const mapsSubTitleFont: IFontMapping = {
|
|
220
|
+
size: '13px',
|
|
221
|
+
fontWeight: 'Medium',
|
|
222
|
+
color: '#FFFFFF',
|
|
223
|
+
fontStyle: 'Medium',
|
|
224
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
225
|
+
};
|
|
226
|
+
/** @private */
|
|
227
|
+
export const tooltipLabelFont: IFontMapping = {
|
|
228
|
+
size: '12px',
|
|
229
|
+
fontWeight: 'Regular',
|
|
230
|
+
color: '#000000',
|
|
231
|
+
fontStyle: 'Regular',
|
|
232
|
+
fontFamily: 'Roboto'
|
|
233
|
+
};
|
|
234
|
+
/** @private */
|
|
235
|
+
export const legendTitleFont: IFontMapping = {
|
|
236
|
+
size: '14px',
|
|
237
|
+
fontWeight: 'Regular',
|
|
238
|
+
color: '#FFFFFF',
|
|
239
|
+
fontStyle: 'Regular',
|
|
240
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
241
|
+
};
|
|
242
|
+
/** @private */
|
|
243
|
+
export const legendLabelFont: IFontMapping = {
|
|
244
|
+
size: '13px',
|
|
245
|
+
fontWeight: 'Medium',
|
|
246
|
+
color: '#FFFFFF',
|
|
247
|
+
fontStyle: 'Medium',
|
|
248
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
249
|
+
};
|
|
250
|
+
/** @private */
|
|
251
|
+
export const dataLabelFont: IFontMapping = {
|
|
252
|
+
size: '12px',
|
|
253
|
+
fontWeight: 'Medium',
|
|
254
|
+
color: '#000000',
|
|
255
|
+
fontStyle: 'Medium',
|
|
256
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Dark Theme configuration
|
|
262
|
+
*/
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
264
|
+
export namespace DarkTheme {
|
|
265
|
+
/** @private */
|
|
266
|
+
export const mapsTitleFont: IFontMapping = {
|
|
267
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
268
|
+
fontWeight: 'Medium',
|
|
269
|
+
size: '14px',
|
|
270
|
+
fontStyle: 'Medium',
|
|
271
|
+
color: '#FFFFFF'
|
|
272
|
+
};
|
|
273
|
+
/** @private */
|
|
274
|
+
export const mapsSubTitleFont: IFontMapping = {
|
|
275
|
+
size: '13px',
|
|
276
|
+
color: '#FFFFFF',
|
|
277
|
+
fontWeight: 'Medium',
|
|
278
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
279
|
+
fontStyle: 'Medium'
|
|
280
|
+
};
|
|
281
|
+
/** @private */
|
|
282
|
+
export const tooltipLabelFont: IFontMapping = {
|
|
283
|
+
size: '12px',
|
|
284
|
+
color: '#282727',
|
|
285
|
+
fontWeight: 'Regular',
|
|
286
|
+
fontFamily: 'Roboto',
|
|
287
|
+
fontStyle: 'Regular'
|
|
288
|
+
};
|
|
289
|
+
/** @private */
|
|
290
|
+
export const legendTitleFont: IFontMapping = {
|
|
291
|
+
size: '14px',
|
|
292
|
+
fontWeight: 'Regular',
|
|
293
|
+
color: '#FFFFFF',
|
|
294
|
+
fontStyle: 'Regular',
|
|
295
|
+
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
296
|
+
};
|
|
297
|
+
/** @private */
|
|
298
|
+
export const legendLabelFont: IFontMapping = {
|
|
299
|
+
size: '13px',
|
|
300
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
301
|
+
fontWeight: 'Medium',
|
|
302
|
+
color: '#DADADA',
|
|
303
|
+
fontStyle: 'Medium'
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Method to get the theme style
|
|
310
|
+
*
|
|
311
|
+
* @param {MapsTheme} theme - Specifies the theme.
|
|
312
|
+
* @returns {IThemeStyle} - Returns the theme style.
|
|
313
|
+
*/
|
|
314
|
+
export function getThemeStyle(theme: MapsTheme): IThemeStyle {
|
|
315
|
+
let style: IThemeStyle; let color: string;
|
|
316
|
+
switch (theme.toLowerCase()) {
|
|
317
|
+
case 'materialdark':
|
|
318
|
+
color = '#303030';
|
|
319
|
+
break;
|
|
320
|
+
case 'fabricdark':
|
|
321
|
+
color = '#201F1F';
|
|
322
|
+
break;
|
|
323
|
+
case 'bootstrapdark':
|
|
324
|
+
color = '#1A1A1A';
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
switch (theme.toLowerCase()) {
|
|
328
|
+
case 'materialdark':
|
|
329
|
+
case 'fabricdark':
|
|
330
|
+
case 'bootstrapdark':
|
|
331
|
+
style = {
|
|
332
|
+
backgroundColor: color,
|
|
333
|
+
areaBackgroundColor: color,
|
|
334
|
+
titleFontColor: '#FFFFFF',
|
|
335
|
+
titleFontSize: '14px',
|
|
336
|
+
subTitleFontColor: '#FFFFFF',
|
|
337
|
+
legendTitleFontColor: '#DADADA',
|
|
338
|
+
legendTextColor: '#DADADA',
|
|
339
|
+
dataLabelFontColor: '#DADADA',
|
|
340
|
+
tooltipFontColor: '#FFFFFF',
|
|
341
|
+
tooltipFillColor: '#363F4C',
|
|
342
|
+
zoomFillColor: '#FFFFFF',
|
|
343
|
+
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
344
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
345
|
+
titleFontWeight: 'Medium',
|
|
346
|
+
zoomSelectionColor: '#e61576',
|
|
347
|
+
shapeFill: '#A6A6A6'
|
|
348
|
+
};
|
|
349
|
+
break;
|
|
350
|
+
case 'highcontrast':
|
|
351
|
+
style = {
|
|
352
|
+
backgroundColor: '#000000',
|
|
353
|
+
areaBackgroundColor: '#000000',
|
|
354
|
+
titleFontColor: '#FFFFFF',
|
|
355
|
+
titleFontSize: '14px',
|
|
356
|
+
subTitleFontColor: '#FFFFFF',
|
|
357
|
+
legendTitleFontColor: '#FFFFFF',
|
|
358
|
+
legendTextColor: '#FFFFFF',
|
|
359
|
+
dataLabelFontColor: '#000000',
|
|
360
|
+
tooltipFontColor: '#000000',
|
|
361
|
+
tooltipFillColor: '#ffffff',
|
|
362
|
+
zoomFillColor: '#FFFFFF',
|
|
363
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
364
|
+
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
365
|
+
titleFontWeight: 'Medium',
|
|
366
|
+
zoomSelectionColor: '#e61576',
|
|
367
|
+
shapeFill: '#A6A6A6'
|
|
368
|
+
};
|
|
369
|
+
break;
|
|
370
|
+
case 'bootstrap4':
|
|
371
|
+
style = {
|
|
372
|
+
backgroundColor: '#FFFFFF',
|
|
373
|
+
areaBackgroundColor: '#FFFFFF',
|
|
374
|
+
titleFontColor: '#212529',
|
|
375
|
+
subTitleFontColor: '#212529',
|
|
376
|
+
legendTitleFontColor: '#212529',
|
|
377
|
+
legendTextColor: '#212529',
|
|
378
|
+
dataLabelFontColor: '#212529',
|
|
379
|
+
tooltipFontColor: '#FFFFFF',
|
|
380
|
+
tooltipFillColor: '#000000',
|
|
381
|
+
zoomFillColor: '#5B6269',
|
|
382
|
+
fontFamily: 'HelveticaNeue-Medium',
|
|
383
|
+
titleFontSize: '16px',
|
|
384
|
+
legendFontSize: '14px',
|
|
385
|
+
tooltipFillOpacity: 1,
|
|
386
|
+
tooltipTextOpacity: 0.9,
|
|
387
|
+
labelFontFamily: 'HelveticaNeue-Medium',
|
|
388
|
+
titleFontWeight: 'Medium',
|
|
389
|
+
zoomSelectionColor: '#e61576',
|
|
390
|
+
shapeFill: '#A6A6A6'
|
|
391
|
+
};
|
|
392
|
+
break;
|
|
393
|
+
case 'tailwind':
|
|
394
|
+
style = {
|
|
395
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
396
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
397
|
+
titleFontColor: '#374151',
|
|
398
|
+
subTitleFontColor: '#374151',
|
|
399
|
+
legendTitleFontColor: '#374151',
|
|
400
|
+
legendTextColor: '#6B7280',
|
|
401
|
+
dataLabelFontColor: '#505967',
|
|
402
|
+
tooltipFontColor: '#F9FAFB',
|
|
403
|
+
tooltipFillColor: '#111827',
|
|
404
|
+
zoomFillColor: '#6b7280',
|
|
405
|
+
fontFamily: 'Inter',
|
|
406
|
+
titleFontSize: '14px',
|
|
407
|
+
legendFontSize: '12px',
|
|
408
|
+
tooltipFillOpacity: 1,
|
|
409
|
+
tooltipTextOpacity: 0.9,
|
|
410
|
+
labelFontFamily: 'Inter',
|
|
411
|
+
titleFontWeight: '500',
|
|
412
|
+
zoomSelectionColor: '#374151',
|
|
413
|
+
shapeFill: '#E5E7EB'
|
|
414
|
+
};
|
|
415
|
+
break;
|
|
416
|
+
case 'tailwinddark':
|
|
417
|
+
style = {
|
|
418
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
419
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
420
|
+
titleFontColor: '#D1D5DB',
|
|
421
|
+
subTitleFontColor: '#D1D5DB',
|
|
422
|
+
legendTitleFontColor: '#D1D5DB',
|
|
423
|
+
legendTextColor: '#D1D5DB',
|
|
424
|
+
dataLabelFontColor: '#D1D5DB',
|
|
425
|
+
tooltipFontColor: '#1F2937',
|
|
426
|
+
tooltipFillColor: '#F9FAFB',
|
|
427
|
+
zoomFillColor: '#D1D5DB',
|
|
428
|
+
fontFamily: 'Inter',
|
|
429
|
+
titleFontSize: '14px',
|
|
430
|
+
legendFontSize: '12px',
|
|
431
|
+
tooltipFillOpacity: 1,
|
|
432
|
+
tooltipTextOpacity: 0.9,
|
|
433
|
+
labelFontFamily: 'Inter',
|
|
434
|
+
titleFontWeight: '500',
|
|
435
|
+
zoomSelectionColor: '#F3F4F6',
|
|
436
|
+
shapeFill: '#374151'
|
|
437
|
+
};
|
|
438
|
+
break;
|
|
439
|
+
case 'bootstrap5':
|
|
440
|
+
style = {
|
|
441
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
442
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
443
|
+
titleFontColor: '#212529',
|
|
444
|
+
subTitleFontColor: '#212529',
|
|
445
|
+
legendTitleFontColor: '#212529',
|
|
446
|
+
legendTextColor: '#212529',
|
|
447
|
+
dataLabelFontColor: '#212529',
|
|
448
|
+
tooltipFontColor: '#F9FAFB',
|
|
449
|
+
tooltipFillColor: '#212529',
|
|
450
|
+
zoomFillColor: '#6C757D',
|
|
451
|
+
fontFamily: 'Helvetica Neue',
|
|
452
|
+
titleFontSize: '14px',
|
|
453
|
+
legendFontSize: '12px',
|
|
454
|
+
tooltipFillOpacity: 1,
|
|
455
|
+
tooltipTextOpacity: 1,
|
|
456
|
+
labelFontFamily: 'Helvetica Neue',
|
|
457
|
+
titleFontWeight: 'normal',
|
|
458
|
+
zoomSelectionColor: '#343A40',
|
|
459
|
+
shapeFill: '#E9ECEF'
|
|
460
|
+
};
|
|
461
|
+
break;
|
|
462
|
+
case 'bootstrap5dark':
|
|
463
|
+
style = {
|
|
464
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
465
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
466
|
+
titleFontColor: '#FFFFFF',
|
|
467
|
+
subTitleFontColor: '#FFFFFF',
|
|
468
|
+
legendTitleFontColor: '#FFFFFF',
|
|
469
|
+
legendTextColor: '#FFFFFF',
|
|
470
|
+
dataLabelFontColor: '#FFFFFF',
|
|
471
|
+
tooltipFontColor: '#212529',
|
|
472
|
+
tooltipFillColor: '#E9ECEF',
|
|
473
|
+
zoomFillColor: '#B5BABE',
|
|
474
|
+
fontFamily: 'Helvetica Neue',
|
|
475
|
+
titleFontSize: '14px',
|
|
476
|
+
legendFontSize: '12px',
|
|
477
|
+
tooltipFillOpacity: 1,
|
|
478
|
+
tooltipTextOpacity: 1,
|
|
479
|
+
labelFontFamily: 'Helvetica Neue',
|
|
480
|
+
titleFontWeight: 'normal',
|
|
481
|
+
zoomSelectionColor: '#DEE2E6',
|
|
482
|
+
shapeFill: '#495057'
|
|
483
|
+
};
|
|
484
|
+
break;
|
|
485
|
+
case 'fluent':
|
|
486
|
+
style = {
|
|
487
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
488
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
489
|
+
titleFontColor: '#201F1E',
|
|
490
|
+
subTitleFontColor: '#201F1E',
|
|
491
|
+
legendTitleFontColor: '#201F1E',
|
|
492
|
+
legendTextColor: '#201F1E',
|
|
493
|
+
dataLabelFontColor: '#201F1E',
|
|
494
|
+
tooltipFontColor: '#323130',
|
|
495
|
+
tooltipFillColor: '#FFFFFF',
|
|
496
|
+
zoomFillColor: '#A19F9D',
|
|
497
|
+
fontFamily: 'Segoe UI',
|
|
498
|
+
titleFontSize: '14px',
|
|
499
|
+
legendFontSize: '12px',
|
|
500
|
+
tooltipFillOpacity: 1,
|
|
501
|
+
tooltipTextOpacity: 1,
|
|
502
|
+
labelFontFamily: 'Segoe UI',
|
|
503
|
+
titleFontWeight: '600',
|
|
504
|
+
zoomSelectionColor: '#323130',
|
|
505
|
+
shapeFill: '#F3F2F1'
|
|
506
|
+
};
|
|
507
|
+
break;
|
|
508
|
+
case 'fluentdark':
|
|
509
|
+
style = {
|
|
510
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
511
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
512
|
+
titleFontColor: '#F3F2F1',
|
|
513
|
+
subTitleFontColor: '#F3F2F1',
|
|
514
|
+
legendTitleFontColor: '#F3F2F1',
|
|
515
|
+
legendTextColor: '#F3F2F1',
|
|
516
|
+
dataLabelFontColor: '#F3F2F1',
|
|
517
|
+
tooltipFontColor: '#F3F2F1',
|
|
518
|
+
tooltipFillColor: '#252423',
|
|
519
|
+
zoomFillColor: '#484644',
|
|
520
|
+
fontFamily: 'Segoe UI',
|
|
521
|
+
titleFontSize: '14px',
|
|
522
|
+
legendFontSize: '12px',
|
|
523
|
+
tooltipFillOpacity: 1,
|
|
524
|
+
tooltipTextOpacity: 1,
|
|
525
|
+
labelFontFamily: 'Segoe UI',
|
|
526
|
+
titleFontWeight: '600',
|
|
527
|
+
zoomSelectionColor: '#F3F2F1',
|
|
528
|
+
shapeFill: '#252423'
|
|
529
|
+
};
|
|
530
|
+
break;
|
|
531
|
+
default:
|
|
532
|
+
style = {
|
|
533
|
+
backgroundColor: '#FFFFFF',
|
|
534
|
+
areaBackgroundColor: '#FFFFFF',
|
|
535
|
+
titleFontColor: '#424242',
|
|
536
|
+
titleFontSize: '14px',
|
|
537
|
+
subTitleFontColor: '#424242',
|
|
538
|
+
legendTitleFontColor: '#757575',
|
|
539
|
+
legendTextColor: '#757575',
|
|
540
|
+
dataLabelFontColor: '#000000',
|
|
541
|
+
tooltipFontColor: '#FFFFFF',
|
|
542
|
+
tooltipFillColor: '#000000',
|
|
543
|
+
zoomFillColor: '#737373',
|
|
544
|
+
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
545
|
+
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
546
|
+
titleFontWeight: 'Medium',
|
|
547
|
+
zoomSelectionColor: '#e61576',
|
|
548
|
+
shapeFill: '#A6A6A6'
|
|
549
|
+
};
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
return style;
|
|
553
|
+
}
|
|
554
|
+
|