UNPKG

20.3 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.antvLight = exports.createLightStyleSheet = void 0;
4var tslib_1 = require("tslib");
5var BLACK_COLORS = {
6 100: '#000',
7 95: '#0D0D0D',
8 85: '#262626',
9 65: '#595959',
10 45: '#8C8C8C',
11 25: '#BFBFBF',
12 15: '#D9D9D9',
13 6: '#F0F0F0',
14};
15var WHITE_COLORS = {
16 100: '#FFFFFF',
17 95: '#F2F2F2',
18 85: '#D9D9D9',
19 65: '#A6A6A6',
20 45: '#737373',
21 25: '#404040',
22 15: '#262626',
23 6: '#0F0F0F',
24};
25var QUALITATIVE_10 = [
26 '#5B8FF9',
27 '#5AD8A6',
28 '#5D7092',
29 '#F6BD16',
30 '#6F5EF9',
31 '#6DC8EC',
32 '#945FB9',
33 '#FF9845',
34 '#1E9493',
35 '#FF99C3',
36];
37var QUALITATIVE_20 = [
38 '#5B8FF9',
39 '#CDDDFD',
40 '#5AD8A6',
41 '#CDF3E4',
42 '#5D7092',
43 '#CED4DE',
44 '#F6BD16',
45 '#FCEBB9',
46 '#6F5EF9',
47 '#D3CEFD',
48 '#6DC8EC',
49 '#D3EEF9',
50 '#945FB9',
51 '#DECFEA',
52 '#FF9845',
53 '#FFE0C7',
54 '#1E9493',
55 '#BBDEDE',
56 '#FF99C3',
57 '#FFE0ED',
58];
59/** 单色顺序色板 */
60var SINGLE_SEQUENCE = [
61 '#B8E1FF',
62 '#9AC5FF',
63 '#7DAAFF',
64 '#5B8FF9',
65 '#3D76DD',
66 '#085EC0',
67 '#0047A5',
68 '#00318A',
69 '#001D70',
70];
71var createLightStyleSheet = function (cfg) {
72 if (cfg === void 0) { cfg = {}; }
73 var _a = cfg.paletteQualitative10, paletteQualitative10 = _a === void 0 ? QUALITATIVE_10 : _a, _b = cfg.paletteQualitative20, paletteQualitative20 = _b === void 0 ? QUALITATIVE_20 : _b;
74 var _c = cfg.brandColor, brandColor = _c === void 0 ? paletteQualitative10[0] : _c;
75 var token = {
76 /** 图表背景色 */
77 backgroundColor: 'transparent',
78 /** 主题色 */
79 brandColor: brandColor,
80 /** 图表辅助色 */
81 subColor: 'rgba(0,0,0,0.05)',
82 /** 分类色板 1,在数据量小于等于 10 时使用 */
83 paletteQualitative10: paletteQualitative10,
84 /** 分类色板 2,在数据量大于 10 时使用 */
85 paletteQualitative20: paletteQualitative20,
86 /** 语义色 */
87 paletteSemanticRed: '#F4664A',
88 /** 语义色 */
89 paletteSemanticGreen: '#30BF78',
90 /** 语义色 */
91 paletteSemanticYellow: '#FAAD14',
92 /** (单色)顺序色板 */
93 paletteSequence: SINGLE_SEQUENCE,
94 /** 字体 */
95 fontFamily: "\"Segoe UI\", Roboto, \"Helvetica Neue\", Arial,\n \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\",\n \"Noto Color Emoji\"",
96 // -------------------- 坐标轴 --------------------
97 /** 坐标轴线颜色 */
98 axisLineBorderColor: BLACK_COLORS[25],
99 /** 坐标轴线粗细 */
100 axisLineBorder: 1,
101 /** 坐标轴线 lineDash 设置 */
102 axisLineDash: null,
103 /** 坐标轴标题颜色 */
104 axisTitleTextFillColor: BLACK_COLORS[65],
105 /** 坐标轴标题文本字体大小 */
106 axisTitleTextFontSize: 12,
107 /** 坐标轴标题文本行高 */
108 axisTitleTextLineHeight: 12,
109 /** 坐标轴标题文本字体粗细 */
110 axisTitleTextFontWeight: 'normal',
111 /** 坐标轴标题距离坐标轴文本的间距 */
112 axisTitleSpacing: 12,
113 /** 坐标轴标题详细说明icon颜色 */
114 axisDescriptionIconFillColor: WHITE_COLORS[85],
115 /** 坐标轴刻度线颜色 */
116 axisTickLineBorderColor: BLACK_COLORS[25],
117 /** 坐标轴刻度线长度 */
118 axisTickLineLength: 4,
119 /** 坐标轴刻度线粗细 */
120 axisTickLineBorder: 1,
121 /** 坐标轴次刻度线颜色 */
122 axisSubTickLineBorderColor: BLACK_COLORS[15],
123 /** 坐标轴次刻度线长度 */
124 axisSubTickLineLength: 2,
125 /** 坐标轴次刻度线粗细 */
126 axisSubTickLineBorder: 1,
127 /** 坐标轴刻度文本颜色 */
128 axisLabelFillColor: BLACK_COLORS[45],
129 /** 坐标轴刻度文本字体大小 */
130 axisLabelFontSize: 12,
131 /** 坐标轴刻度文本行高 */
132 axisLabelLineHeight: 12,
133 /** 坐标轴刻度文本字体粗细 */
134 axisLabelFontWeight: 'normal',
135 /** 坐标轴刻度文本距离坐标轴线的间距 */
136 axisLabelOffset: 8,
137 /** 坐标轴网格线颜色 */
138 axisGridBorderColor: BLACK_COLORS[15],
139 /** 坐标轴网格线粗细 */
140 axisGridBorder: 1,
141 /** 坐标轴网格线虚线设置 */
142 axisGridLineDash: null,
143 // -------------------- 图例 --------------------
144 /** 图例标题颜色 */
145 legendTitleTextFillColor: BLACK_COLORS[45],
146 /** 图例标题文本字体大小 */
147 legendTitleTextFontSize: 12,
148 /** 图例标题文本行高 */
149 legendTitleTextLineHeight: 21,
150 /** 图例标题文本字体粗细 */
151 legendTitleTextFontWeight: 'normal',
152 /** 图例 marker 颜色 */
153 legendMarkerColor: brandColor,
154 /** 图例 marker 距离图例文本的间距 */
155 legendMarkerSpacing: 8,
156 /** 图例 marker 默认半径大小 */
157 legendMarkerSize: 4,
158 /** 图例 'circle' marker 半径 */
159 legendCircleMarkerSize: 4,
160 /** 图例 'square' marker 半径 */
161 legendSquareMarkerSize: 4,
162 /** 图例 'line' marker 半径 */
163 legendLineMarkerSize: 5,
164 /** 图例项文本颜色 */
165 legendItemNameFillColor: BLACK_COLORS[65],
166 /** 图例项文本字体大小 */
167 legendItemNameFontSize: 12,
168 /** 图例项文本行高 */
169 legendItemNameLineHeight: 12,
170 /** 图例项粗细 */
171 legendItemNameFontWeight: 'normal',
172 /** 图例项之间的水平间距 */
173 legendItemSpacing: 24,
174 /** 图例项垂直方向的间隔 */
175 legendItemMarginBottom: 12,
176 /** 图例与图表绘图区域的偏移距离 */
177 legendPadding: [8, 8, 8, 8],
178 /** 水平布局的图例与绘图区域偏移距离 */
179 legendHorizontalPadding: [8, 0, 8, 0],
180 /** 垂直布局的图例与绘图区域偏移距离 */
181 legendVerticalPadding: [0, 8, 0, 8],
182 // 图例分页器
183 /** 图例分页器 marker 大小 */
184 legendPageNavigatorMarkerSize: 12,
185 /** 图例分页器 marker 非激活状态填充色 */
186 legendPageNavigatorMarkerInactiveFillColor: BLACK_COLORS[100],
187 /** 图例分页器 marker 非激活状态填充色透明度 */
188 legendPageNavigatorMarkerInactiveFillOpacity: 0.45,
189 /** 图例分页器 marker 填充色 */
190 legendPageNavigatorMarkerFillColor: BLACK_COLORS[100],
191 /** 图例分页器 marker 填充色透明度 */
192 legendPageNavigatorMarkerFillOpacity: 1,
193 /** 图例分页器文本颜色 */
194 legendPageNavigatorTextFillColor: BLACK_COLORS[45],
195 /** 图例分页器文本字体大小 */
196 legendPageNavigatorTextFontSize: 12,
197 /** 连续图例滑块填充色 */
198 sliderRailFillColor: BLACK_COLORS[15],
199 /** 连续图例滑块边框粗细 */
200 sliderRailBorder: 0,
201 /** 连续图例滑块边框颜色 */
202 sliderRailBorderColor: null,
203 /** 连续图例滑块宽度 */
204 sliderRailWidth: 100,
205 /** 连续图例滑块高度 */
206 sliderRailHeight: 12,
207 /** 连续图例文本颜色 */
208 sliderLabelTextFillColor: BLACK_COLORS[45],
209 /** 连续图例文本字体大小 */
210 sliderLabelTextFontSize: 12,
211 /** 连续图例文本行高 */
212 sliderLabelTextLineHeight: 12,
213 /** 连续图例文本字体粗细 */
214 sliderLabelTextFontWeight: 'normal',
215 /** 连续图例滑块颜色 */
216 sliderHandlerFillColor: BLACK_COLORS[6],
217 /** 连续图例滑块宽度 */
218 sliderHandlerWidth: 10,
219 /** 连续图例滑块高度 */
220 sliderHandlerHeight: 14,
221 /** 连续图例滑块边框粗细 */
222 sliderHandlerBorder: 1,
223 /** 连续图例滑块边框颜色 */
224 sliderHandlerBorderColor: BLACK_COLORS[25],
225 // -------------------- Annotation,图形标注 --------------------
226 /** arc 图形标注描边颜色 */
227 annotationArcBorderColor: BLACK_COLORS[15],
228 /** arc 图形标注粗细 */
229 annotationArcBorder: 1,
230 /** line 图形标注颜色 */
231 annotationLineBorderColor: BLACK_COLORS[25],
232 /** line 图形标注粗细 */
233 annotationLineBorder: 1,
234 /** lube 图形标注的虚线间隔 */
235 annotationLineDash: null,
236 /** text 图形标注文本颜色 */
237 annotationTextFillColor: BLACK_COLORS[65],
238 /** text 图形标注文本字体大小 */
239 annotationTextFontSize: 12,
240 /** text 图形标注文本行高 */
241 annotationTextLineHeight: 12,
242 /** text 图形标注文本字体粗细 */
243 annotationTextFontWeight: 'normal',
244 /** text 图形标注文本边框颜色 */
245 annotationTextBorderColor: null,
246 /** text 图形标注文本边框粗细 */
247 annotationTextBorder: 0,
248 /** region 图形标注填充颜色 */
249 annotationRegionFillColor: BLACK_COLORS[100],
250 /** region 图形标注填充颜色透明色 */
251 annotationRegionFillOpacity: 0.06,
252 /** region 图形标注描边粗细 */
253 annotationRegionBorder: 0,
254 /** region 图形标注描边颜色 */
255 annotationRegionBorderColor: null,
256 /** dataMarker 图形标注线的长度 */
257 annotationDataMarkerLineLength: 16,
258 // -------------------- Tooltip --------------------
259 /** tooltip crosshairs 辅助线颜色 */
260 tooltipCrosshairsBorderColor: BLACK_COLORS[25],
261 /** tooltip crosshairs 辅助线粗细 */
262 tooltipCrosshairsBorder: 1,
263 /** tooltip crosshairs 辅助线虚线间隔 */
264 tooltipCrosshairsLineDash: null,
265 /** tooltip 内容框背景色 */
266 tooltipContainerFillColor: 'rgb(255, 255, 255)',
267 tooltipContainerFillOpacity: 0.95,
268 /** tooltip 内容框阴影 */
269 tooltipContainerShadow: '0px 0px 10px #aeaeae',
270 /** tooltip 内容框圆角 */
271 tooltipContainerBorderRadius: 3,
272 /** tooltip 文本颜色 */
273 tooltipTextFillColor: BLACK_COLORS[65],
274 /** tooltip 文本字体大小 */
275 tooltipTextFontSize: 12,
276 /** tooltip 文本行高 */
277 tooltipTextLineHeight: 12,
278 /** tooltip 文本字体粗细 */
279 tooltipTextFontWeight: 'bold',
280 // -------------------- Geometry labels --------------------
281 /** Geometry label 文本颜色 */
282 labelFillColor: BLACK_COLORS[65],
283 labelFillColorDark: '#2c3542',
284 labelFillColorLight: '#ffffff',
285 /** Geometry label 文本字体大小 */
286 labelFontSize: 12,
287 /** Geometry label 文本行高 */
288 labelLineHeight: 12,
289 /** Geometry label 文本字体粗细 */
290 labelFontWeight: 'normal',
291 /** Geometry label 文本描边颜色 */
292 labelBorderColor: null,
293 /** Geometry label 文本描边粗细 */
294 labelBorder: 0,
295 /** Geometry innerLabel 文本颜色 */
296 innerLabelFillColor: WHITE_COLORS[100],
297 /** Geometry innerLabel 文本字体大小 */
298 innerLabelFontSize: 12,
299 /** Geometry innerLabel 文本行高 */
300 innerLabelLineHeight: 12,
301 /** Geometry innerLabel 文本字体粗细 */
302 innerLabelFontWeight: 'normal',
303 /** Geometry innerLabel 文本描边颜色 */
304 innerLabelBorderColor: null,
305 /** Geometry innerLabel 文本描边粗细 */
306 innerLabelBorder: 0,
307 /** Geometry overflowLabel 文本颜色 */
308 overflowLabelFillColor: BLACK_COLORS[65],
309 /** Geometry overflowLabel 文本字体大小 */
310 overflowLabelFontSize: 12,
311 /** Geometry overflowLabel 文本行高 */
312 overflowLabelLineHeight: 12,
313 /** Geometry overflowLabel 文本字体粗细 */
314 overflowLabelFontWeight: 'normal',
315 /** Geometry overflowLabel 文本描边颜色 */
316 overflowLabelBorderColor: WHITE_COLORS[100],
317 /** Geometry overflowLabel 文本描边粗细 */
318 overflowLabelBorder: 1,
319 /** Geometry label 文本连接线粗细 */
320 labelLineBorder: 1,
321 /** Geometry label 文本连接线颜色 */
322 labelLineBorderColor: BLACK_COLORS[25],
323 // -------------------- Slider 组件样式--------------------
324 /** slider 滑道高度 */
325 cSliderRailHieght: 16,
326 /** slider 滑道背景色 */
327 cSliderBackgroundFillColor: '#416180',
328 /** slider 滑道背景色透明度 */
329 cSliderBackgroundFillOpacity: 0.05,
330 /** slider 滑道前景色 */
331 cSliderForegroundFillColor: '#5B8FF9',
332 /** slider 滑道前景色透明度 */
333 cSliderForegroundFillOpacity: 0.15,
334 // slider handlerStyle 手柄样式
335 /** slider 手柄高度 */
336 cSliderHandlerHeight: 24,
337 /** Slider 手柄宽度 */
338 cSliderHandlerWidth: 10,
339 /** Slider 手柄背景色 */
340 cSliderHandlerFillColor: '#F7F7F7',
341 /** Slider 手柄背景色透明度 */
342 cSliderHandlerFillOpacity: 1,
343 /** Slider 手柄高亮背景色 */
344 cSliderHandlerHighlightFillColor: '#FFF',
345 /** Slider 手柄边框色 */
346 cSliderHandlerBorderColor: '#BFBFBF',
347 /** Slider 手柄边框粗细 */
348 cSliderHandlerBorder: 1,
349 /** Slider 手柄边框圆角 */
350 cSliderHandlerBorderRadius: 2,
351 // slider textStyle 字体标签样式
352 /** Slider 字体标签颜色 */
353 cSliderTextFillColor: '#000',
354 /** Slider 字体标签透明度 */
355 cSliderTextFillOpacity: 0.45,
356 /** Slider 字体标签大小 */
357 cSliderTextFontSize: 12,
358 /** Slider 字体标签行高 */
359 cSliderTextLineHeight: 12,
360 /** Slider 字体标签字重 */
361 cSliderTextFontWeight: 'normal',
362 /** Slider 字体标签描边色 */
363 cSliderTextBorderColor: null,
364 /** Slider 字体标签描边粗细 */
365 cSliderTextBorder: 0,
366 // -------------------- Scrollbar 组件样式--------------------
367 /** 滚动条 滚道填充色 */
368 scrollbarTrackFillColor: 'rgba(0,0,0,0)',
369 /** 滚动条 滑块填充色 */
370 scrollbarThumbFillColor: 'rgba(0,0,0,0.15)',
371 /** 滚动条 滑块高亮填充色 */
372 scrollbarThumbHighlightFillColor: 'rgba(0,0,0,0.2)',
373 // -------------------- Geometry 图形样式--------------------
374 /** 点图填充颜色 */
375 pointFillColor: brandColor,
376 /** 点图填充颜色透明度 */
377 pointFillOpacity: 0.95,
378 /** 点图大小 */
379 pointSize: 4,
380 /** 点图描边粗细 */
381 pointBorder: 1,
382 /** 点图描边颜色 */
383 pointBorderColor: WHITE_COLORS[100],
384 /** 点图描边透明度 */
385 pointBorderOpacity: 1,
386 /** 点图 active 状态下描边颜色 */
387 pointActiveBorderColor: BLACK_COLORS[100],
388 /** 点图 selected 状态下描边粗细 */
389 pointSelectedBorder: 2,
390 /** 点图 selected 状态下描边颜色 */
391 pointSelectedBorderColor: BLACK_COLORS[100],
392 /** 点图 inactive 状态下填充颜色透明度 */
393 pointInactiveFillOpacity: 0.3,
394 /** 点图 inactive 状态下描边透明度 */
395 pointInactiveBorderOpacity: 0.3,
396 /** 空心点图大小 */
397 hollowPointSize: 4,
398 /** 空心点图描边粗细 */
399 hollowPointBorder: 1,
400 /** 空心点图描边颜色 */
401 hollowPointBorderColor: brandColor,
402 /** 空心点图描边透明度 */
403 hollowPointBorderOpacity: 0.95,
404 hollowPointFillColor: WHITE_COLORS[100],
405 /** 空心点图 active 状态下描边粗细 */
406 hollowPointActiveBorder: 1,
407 /** 空心点图 active 状态下描边颜色 */
408 hollowPointActiveBorderColor: BLACK_COLORS[100],
409 /** 空心点图 active 状态下描边透明度 */
410 hollowPointActiveBorderOpacity: 1,
411 /** 空心点图 selected 状态下描边粗细 */
412 hollowPointSelectedBorder: 2,
413 /** 空心点图 selected 状态下描边颜色 */
414 hollowPointSelectedBorderColor: BLACK_COLORS[100],
415 /** 空心点图 selected 状态下描边透明度 */
416 hollowPointSelectedBorderOpacity: 1,
417 /** 空心点图 inactive 状态下描边透明度 */
418 hollowPointInactiveBorderOpacity: 0.3,
419 /** 线图粗细 */
420 lineBorder: 2,
421 /** 线图颜色 */
422 lineBorderColor: brandColor,
423 /** 线图透明度 */
424 lineBorderOpacity: 1,
425 /** 线图 Active 状态下粗细 */
426 lineActiveBorder: 3,
427 /** 线图 selected 状态下粗细 */
428 lineSelectedBorder: 3,
429 /** 线图 inactive 状态下透明度 */
430 lineInactiveBorderOpacity: 0.3,
431 /** area 填充颜色 */
432 areaFillColor: brandColor,
433 /** area 填充透明度 */
434 areaFillOpacity: 0.25,
435 /** area 在 active 状态下的填充透明度 */
436 areaActiveFillColor: brandColor,
437 areaActiveFillOpacity: 0.5,
438 /** area 在 selected 状态下的填充透明度 */
439 areaSelectedFillColor: brandColor,
440 areaSelectedFillOpacity: 0.5,
441 /** area inactive 状态下填充透明度 */
442 areaInactiveFillOpacity: 0.3,
443 /** hollowArea 颜色 */
444 hollowAreaBorderColor: brandColor,
445 /** hollowArea 边框粗细 */
446 hollowAreaBorder: 2,
447 /** hollowArea 边框透明度 */
448 hollowAreaBorderOpacity: 1,
449 /** hollowArea active 状态下的边框粗细 */
450 hollowAreaActiveBorder: 3,
451 hollowAreaActiveBorderColor: BLACK_COLORS[100],
452 /** hollowArea selected 状态下的边框粗细 */
453 hollowAreaSelectedBorder: 3,
454 hollowAreaSelectedBorderColor: BLACK_COLORS[100],
455 /** hollowArea inactive 状态下的边框透明度 */
456 hollowAreaInactiveBorderOpacity: 0.3,
457 /** interval 填充颜色 */
458 intervalFillColor: brandColor,
459 /** interval 填充透明度 */
460 intervalFillOpacity: 0.95,
461 /** interval active 状态下边框粗细 */
462 intervalActiveBorder: 1,
463 /** interval active 状态下边框颜色 */
464 intervalActiveBorderColor: BLACK_COLORS[100],
465 intervalActiveBorderOpacity: 1,
466 /** interval selected 状态下边框粗细 */
467 intervalSelectedBorder: 2,
468 /** interval selected 状态下边框颜色 */
469 intervalSelectedBorderColor: BLACK_COLORS[100],
470 /** interval selected 状态下边框透明度 */
471 intervalSelectedBorderOpacity: 1,
472 /** interval inactive 状态下边框透明度 */
473 intervalInactiveBorderOpacity: 0.3,
474 /** interval inactive 状态下填充透明度 */
475 intervalInactiveFillOpacity: 0.3,
476 /** interval 边框粗细 */
477 hollowIntervalBorder: 2,
478 /** hollowInterval 边框颜色 */
479 hollowIntervalBorderColor: brandColor,
480 /** hollowInterval 边框透明度 */
481 hollowIntervalBorderOpacity: 1,
482 hollowIntervalFillColor: WHITE_COLORS[100],
483 /** hollowInterval active 状态下边框粗细 */
484 hollowIntervalActiveBorder: 2,
485 /** hollowInterval active 状态下边框颜色 */
486 hollowIntervalActiveBorderColor: BLACK_COLORS[100],
487 /** hollowInterval selected 状态下边框粗细 */
488 hollowIntervalSelectedBorder: 3,
489 /** hollowInterval selected 状态下边框颜色 */
490 hollowIntervalSelectedBorderColor: BLACK_COLORS[100],
491 /** hollowInterval selected 状态下边框透明度 */
492 hollowIntervalSelectedBorderOpacity: 1,
493 /** hollowInterval inactive 状态下边框透明度 */
494 hollowIntervalInactiveBorderOpacity: 0.3,
495 };
496 return tslib_1.__assign(tslib_1.__assign({}, token), cfg);
497};
498exports.createLightStyleSheet = createLightStyleSheet;
499exports.antvLight = (0, exports.createLightStyleSheet)();
500//# sourceMappingURL=light.js.map
\No newline at end of file