@visactor/vchart 1.5.1-alpha.2 → 1.5.1-alpha.3
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/build/es5/index.js +2 -2
- package/build/index.js +73145 -47075
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/util.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +2 -4
- package/cjs/component/tooltip/handler/base.js +15 -38
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.d.ts +1 -2
- package/cjs/component/tooltip/handler/dom/util.js +14 -13
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/interface/style.d.ts +4 -23
- package/cjs/component/tooltip/handler/interface/style.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.d.ts +9 -11
- package/cjs/component/tooltip/handler/utils/attribute.js +136 -126
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/common.d.ts +8 -0
- package/cjs/component/tooltip/handler/utils/common.js +42 -2
- package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/index.d.ts +0 -1
- package/cjs/component/tooltip/handler/utils/index.js +1 -2
- package/cjs/component/tooltip/handler/utils/index.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +5 -3
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/env/env.d.ts +7 -0
- package/cjs/env/env.js +48 -0
- package/cjs/env/env.js.map +1 -0
- package/cjs/env/index.d.ts +1 -0
- package/cjs/env/index.js +21 -0
- package/cjs/env/index.js.map +1 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interaction/interaction.js +1 -2
- package/cjs/interaction/trigger.js +2 -1
- package/cjs/mark/arc.js +1 -1
- package/cjs/mark/area.js +1 -1
- package/cjs/vchart-all.js +3 -2
- package/cjs/vchart-all.js.map +1 -1
- package/cjs/vchart-simple.js +3 -2
- package/cjs/vchart-simple.js.map +1 -1
- package/esm/compile/util.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +2 -4
- package/esm/component/tooltip/handler/base.js +14 -39
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.d.ts +1 -2
- package/esm/component/tooltip/handler/dom/util.js +14 -14
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/interface/style.d.ts +4 -23
- package/esm/component/tooltip/handler/interface/style.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.d.ts +9 -11
- package/esm/component/tooltip/handler/utils/attribute.js +131 -123
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/common.d.ts +8 -0
- package/esm/component/tooltip/handler/utils/common.js +41 -1
- package/esm/component/tooltip/handler/utils/common.js.map +1 -1
- package/esm/component/tooltip/handler/utils/index.d.ts +0 -1
- package/esm/component/tooltip/handler/utils/index.js +0 -2
- package/esm/component/tooltip/handler/utils/index.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +5 -3
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +3 -3
- package/esm/core/vchart.js.map +1 -1
- package/esm/env/env.d.ts +7 -0
- package/esm/env/env.js +32 -0
- package/esm/env/env.js.map +1 -0
- package/esm/env/index.d.ts +1 -0
- package/esm/env/index.js +2 -0
- package/esm/env/index.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/interaction/interaction.js +1 -2
- package/esm/interaction/trigger.js +2 -1
- package/esm/mark/arc.js +1 -1
- package/esm/mark/area.js +1 -1
- package/esm/vchart-all.js +4 -1
- package/esm/vchart-all.js.map +1 -1
- package/esm/vchart-simple.js +4 -1
- package/esm/vchart-simple.js.map +1 -1
- package/package.json +8 -8
- package/cjs/component/tooltip/handler/utils/style.d.ts +0 -4
- package/cjs/component/tooltip/handler/utils/style.js +0 -32
- package/cjs/component/tooltip/handler/utils/style.js.map +0 -1
- package/esm/component/tooltip/handler/utils/style.d.ts +0 -4
- package/esm/component/tooltip/handler/utils/style.js +0 -26
- package/esm/component/tooltip/handler/utils/style.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { isFunction, isObject, isString, isNil, isArray, isValid } from "../../../../util";
|
|
1
|
+
import { isFunction, isObject, isString, isNil, isArray, isValid, initTextMeasure } from "../../../../util";
|
|
2
|
+
|
|
3
|
+
import { getRichTextBounds } from "@visactor/vrender";
|
|
2
4
|
|
|
3
5
|
export function escapeHTML(value) {
|
|
4
6
|
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\(/g, "(").replace(/ /g, " ");
|
|
@@ -39,4 +41,42 @@ export function convertToColorString(color, defaultColor = "#000") {
|
|
|
39
41
|
|
|
40
42
|
export const getScale = (element, boundingClientRect) => element ? (boundingClientRect || (boundingClientRect = element.getBoundingClientRect()),
|
|
41
43
|
element.offsetWidth > 0 ? boundingClientRect.width / element.offsetWidth : boundingClientRect.height / element.offsetHeight) : 1;
|
|
44
|
+
|
|
45
|
+
export const measureTooltipText = (text, style) => {
|
|
46
|
+
var _a;
|
|
47
|
+
text = (null != text ? text : "").toString();
|
|
48
|
+
const measure = initTextMeasure(style);
|
|
49
|
+
if (!style.multiLine) {
|
|
50
|
+
const {width: width, height: height} = measure.fullMeasure(text);
|
|
51
|
+
return {
|
|
52
|
+
width: width,
|
|
53
|
+
height: height,
|
|
54
|
+
text: text
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
let textLines = text.split("\n");
|
|
58
|
+
textLines = textLines.map(((line, i) => i < textLines.length - 1 ? line + "\n" : line));
|
|
59
|
+
const {width: width, height: height} = measure.fullMeasure(textLines);
|
|
60
|
+
if (style.maxWidth && style.maxWidth <= width) {
|
|
61
|
+
const bound = getRichTextBounds({
|
|
62
|
+
wordBreak: null !== (_a = style.wordBreak) && void 0 !== _a ? _a : "break-word",
|
|
63
|
+
maxWidth: style.maxWidth,
|
|
64
|
+
width: 0,
|
|
65
|
+
height: 0,
|
|
66
|
+
textConfig: textLines.map(((line, i) => Object.assign(Object.assign({}, style), {
|
|
67
|
+
text: line
|
|
68
|
+
})))
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
width: bound.width(),
|
|
72
|
+
height: bound.height(),
|
|
73
|
+
text: textLines
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
width: width,
|
|
78
|
+
height: height,
|
|
79
|
+
text: textLines
|
|
80
|
+
};
|
|
81
|
+
};
|
|
42
82
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/tooltip/handler/utils/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,K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SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAEzD,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE;QAE7C,MAAM,KAAK,GAAG,iBAAiB,CAAC;YAC9B,SAAS,EAAE,MAAA,KAAK,CAAC,SAAS,mCAAI,YAAY;YAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,SAAS,CAAC,GAAG,CACvB,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CACV,CAAC,gCACI,KAAK,KACR,IAAI,EAAE,IAAI,GACgC,CAAA,CAC/C;SACF,CAAC,CAAC;QACH,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE;YACpB,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,SAAS;SAChB,CAAC;KACH;IAED,OAAO;QACL,KAAK;QACL,MAAM;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC,CAAC","file":"common.js","sourcesContent":["import type { Datum } from '@visactor/vgrammar-core';\nimport type { MaybeArray, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../../typings';\nimport { isFunction, isObject, isString, isNil, isArray, isValid, initTextMeasure } from '../../../../util';\nimport type { TooltipHandlerParams } from '../../interface';\nimport type { IDimensionData, IDimensionInfo } from '../../../../event/events/dimension';\nimport type { IRichTextParagraphCharacter } from '@visactor/vrender';\nimport { getRichTextBounds } from '@visactor/vrender';\nimport type { ITooltipTextStyle } from '../interface/style';\n\ninterface IGradientColor {\n [key: string]: any;\n stops: {\n offset: number;\n color: string;\n }[];\n}\n\n/**\n * Escape special HTML characters.\n *\n * @param value A value to convert to string and HTML-escape.\n */\nexport function escapeHTML(value: any): string {\n return String(value)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\\(/g, '(')\n .replace(/ /g, ' '); // 转义符和真空格夹杂,在转义和正常换行之间取得平衡\n}\n\nexport const getTooltipContentValue = <T>(\n field?: TooltipContentProperty<T>,\n datum?: any,\n params?: TooltipHandlerParams\n): T | undefined => {\n if (isNil(field)) {\n return field;\n }\n if (isFunction(field)) {\n return field(datum, params);\n }\n return field;\n};\n\nexport const getTooltipPatternValue = <T>(\n field?: MaybeArray<TooltipPatternProperty<T>>,\n data?: TooltipData,\n params?: TooltipHandlerParams\n): (typeof field extends Array<TooltipPatternProperty<T>> ? MaybeArray<T> : T) | undefined => {\n if (isNil(field)) {\n return field;\n }\n if (isArray(field)) {\n const result: T[] = [];\n field.forEach(item => {\n if (isFunction(item)) {\n const value = item(data, params);\n if (isValid(value)) {\n result.push(value);\n }\n } else {\n result.push(item);\n }\n });\n return result as any;\n }\n if (isFunction(field)) {\n return field(data, params);\n }\n return field;\n};\n\nexport function getFirstDatumFromTooltipData(data: TooltipData): Datum {\n // 找到第一个可用的datum\n const dimInfoList: IDimensionInfo[] = (data as IDimensionData[])[0]?.series\n ? [{ data: data as IDimensionData[], value: '' }]\n : (data as IDimensionInfo[]);\n for (const { data: dataList } of dimInfoList) {\n for (const { datum: datumList } of dataList) {\n for (const datumItem of datumList ?? []) {\n if (datumItem) {\n return datumItem;\n }\n }\n }\n }\n}\n\nexport function pickFirstValidValue<T>(isValid: (element?: T) => any, ...elements: T[]): T | undefined {\n for (const ele of elements) {\n if (isValid(ele)) {\n return ele;\n }\n }\n return undefined;\n}\n\n// 针对渐变色,受底层渲染引擎影响,不一定都能绘制正确,所以这里取 colorStop 的第一个颜色作为 color\nexport function convertToColorString(color: any, defaultColor: string = '#000') {\n if (!color) {\n return defaultColor;\n }\n if (isString(color)) {\n return color;\n }\n\n if (isObject(color) && (color as IGradientColor).stops && (color as IGradientColor).stops[0]) {\n return (color as IGradientColor).stops[0].color || defaultColor;\n }\n\n return defaultColor;\n}\n\n/** 获取元素的绝对缩放因数(支持外部传入 boundingClientRect 提升性能) */\nexport const getScale = (element: HTMLElement, boundingClientRect?: DOMRect) => {\n if (!element) {\n return 1;\n }\n if (!boundingClientRect) {\n boundingClientRect = element.getBoundingClientRect();\n }\n if (element.offsetWidth > 0) {\n return boundingClientRect.width / element.offsetWidth;\n }\n return boundingClientRect.height / element.offsetHeight;\n};\n\ninterface ITooltipTextInfo {\n width: number;\n height: number;\n text: MaybeArray<number> | MaybeArray<string>;\n}\n\n/** 测量 tooltip 标签文本 */\nexport const measureTooltipText = (text: string, style: ITooltipTextStyle): ITooltipTextInfo => {\n text = (text ?? '').toString();\n const measure = initTextMeasure(style as any);\n if (!style.multiLine) {\n // 单行文本\n const { width, height } = measure.fullMeasure(text);\n return {\n width,\n height,\n text\n };\n }\n // 多行文本\n let textLines = text.split('\\n');\n textLines = textLines.map((line, i) => (i < textLines.length - 1 ? line + '\\n' : line));\n const { width, height } = measure.fullMeasure(textLines);\n\n if (style.maxWidth && style.maxWidth <= width) {\n // 允许自动换行的情况,改用 richText 测量\n const bound = getRichTextBounds({\n wordBreak: style.wordBreak ?? 'break-word',\n maxWidth: style.maxWidth,\n width: 0,\n height: 0,\n textConfig: textLines.map(\n (line, i) =>\n ({\n ...style,\n text: line\n } as unknown as IRichTextParagraphCharacter)\n )\n });\n return {\n width: bound.width(),\n height: bound.height(),\n text: textLines\n };\n }\n\n return {\n width,\n height,\n text: textLines\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/tooltip/handler/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC
|
|
1
|
+
{"version":3,"sources":["../src/component/tooltip/handler/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["export * from './common';\nexport * from './compose';\nexport * from './pattern';\nexport * from './get-spec';\nexport * from './position';\nexport * from './attribute';\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RichTextWordBreak } from '@visactor/vrender-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
|
|
3
3
|
import type { IColorKey } from '../../../theme/color-scheme/interface';
|
|
4
|
+
import type { Padding } from '@visactor/vrender-components/es/core/type';
|
|
4
5
|
export interface ITooltipTextTheme {
|
|
5
6
|
fontFamily?: string;
|
|
6
7
|
fontSize?: number;
|
|
@@ -14,10 +15,11 @@ export interface ITooltipTextTheme {
|
|
|
14
15
|
multiLine?: boolean;
|
|
15
16
|
maxWidth?: number;
|
|
16
17
|
wordBreak?: RichTextWordBreak;
|
|
18
|
+
autoWidth?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export interface ITooltipTheme {
|
|
19
21
|
panel?: {
|
|
20
|
-
padding?:
|
|
22
|
+
padding?: Padding;
|
|
21
23
|
backgroundColor?: string | IColorKey;
|
|
22
24
|
border?: {
|
|
23
25
|
color?: string | IColorKey;
|
|
@@ -37,7 +39,7 @@ export interface ITooltipTheme {
|
|
|
37
39
|
spacing?: number;
|
|
38
40
|
};
|
|
39
41
|
titleLabel?: ITooltipTextTheme;
|
|
40
|
-
keyLabel?: ITooltipTextTheme
|
|
42
|
+
keyLabel?: Omit<ITooltipTextTheme, 'autoWidth'>;
|
|
41
43
|
valueLabel?: ITooltipTextTheme;
|
|
42
44
|
spaceRow?: number;
|
|
43
45
|
offset?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/tooltip/interface/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { RichTextWordBreak } from '@visactor/vrender-core';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/component/tooltip/interface/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { RichTextWordBreak } from '@visactor/vrender-core';\nimport type { StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';\nimport type { IColorKey } from '../../../theme/color-scheme/interface';\nimport type { Padding } from '@visactor/vrender-components/es/core/type';\n\nexport interface ITooltipTextTheme {\n /** 字体 */\n fontFamily?: string;\n /** 字体大小 */\n fontSize?: number;\n /** 字体颜色 */\n fill?: string | IColorKey;\n /** @deprecated 字体颜色(兼容旧版本) */\n fontColor?: string | IColorKey;\n /** 字重 */\n fontWeight?: StringOrNumber;\n /** 对齐方式 */\n textAlign?: TextAlign;\n /** 字体基线 */\n textBaseline?: TextBaseLine;\n /** 行高 */\n lineHeight?: number | string;\n /** 与相邻元素的水平间距 */\n spacing?: number;\n /** 是否支持换行 */\n multiLine?: boolean;\n /** 最大宽度 */\n maxWidth?: number;\n /** 换行模式,默认为'break-word' */\n wordBreak?: RichTextWordBreak;\n /**\n * 是否开启自动宽度。效果分为以下几种情况:\n * - tooltip 标题:`autoWidth` 默认为 `false`。如果配置为 `true`,则 tooltip 标题会保持和 tooltip 内容一致的宽度\n * - tooltip key 标签:`autoWidth` 不适用\n * - tooltip value 标签:`autoWidth` 默认为 `true`。如果配置为 `true`,则 tooltip value 标签会自动占满 tooltip 整体宽度的剩余部分\n * @since 1.4.2\n */\n autoWidth?: boolean;\n}\n\nexport interface ITooltipTheme {\n /** 容器样式配置 */\n panel?: {\n /** tooltip 容器内边距 */\n padding?: Padding;\n /** 背景色 */\n backgroundColor?: string | IColorKey;\n /** tooltip边框 */\n border?: {\n color?: string | IColorKey;\n width?: number;\n /** 圆角 */\n radius?: number;\n };\n /** tooltip阴影 */\n shadow?: {\n x: number;\n y: number;\n blur: number;\n spread: number;\n color: string | IColorKey;\n };\n };\n shape?: {\n /** 标记大小 */\n size?: number;\n /** shape 与相邻元素的水平间距 */\n spacing?: number;\n };\n /** tooltip标题 */\n titleLabel?: ITooltipTextTheme;\n /** tooltip内容,key字段 */\n keyLabel?: Omit<ITooltipTextTheme, 'autoWidth'>;\n /** tooltip内容,value字段 */\n valueLabel?: ITooltipTextTheme;\n /** 内容项行间距 */\n spaceRow?: number;\n /** 偏移量 */\n offset?: {\n x?: number;\n y?: number;\n };\n}\n"]}
|
package/esm/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VChart } from './vchart';
|
|
2
2
|
import { Factory } from './factory';
|
|
3
3
|
export { VChart, Factory };
|
|
4
|
-
export declare const version = "1.5.1-alpha.
|
|
4
|
+
export declare const version = "1.5.1-alpha.3";
|
|
5
5
|
export type { IVChart } from './interface';
|
|
6
6
|
export * from '../event/interface';
|
|
7
7
|
export * from '../typings/spec/common';
|
package/esm/core/index.js
CHANGED
package/esm/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAMvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.5.1-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAMvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.5.1-alpha.3\";\n\n// export necessary types\nexport type { IVChart } from './interface';\n\n// the event types\nexport * from '../event/interface';\nexport * from '../typings/spec/common';\nexport * from '../theme/interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\n"]}
|
package/esm/core/vchart.js
CHANGED
|
@@ -84,7 +84,7 @@ import { GroupMark } from "../mark";
|
|
|
84
84
|
|
|
85
85
|
import { registerVGrammarAnimation } from "../animation/config";
|
|
86
86
|
|
|
87
|
-
import { View,
|
|
87
|
+
import { View, registerFilterTransform, registerMapTransform } from "@visactor/vgrammar-core";
|
|
88
88
|
|
|
89
89
|
import { VCHART_UTILS } from "./util";
|
|
90
90
|
|
|
@@ -761,10 +761,10 @@ VChart.InstanceManager = InstanceManager, VChart.ThemeManager = ThemeManager, VC
|
|
|
761
761
|
export const registerVChartCore = () => {
|
|
762
762
|
Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
|
|
763
763
|
Factory.registerMark(GroupMark.type, GroupMark), View.useRegisters([ registerFilterTransform, registerMapTransform ]),
|
|
764
|
-
registerVGrammarAnimation(),
|
|
764
|
+
registerVGrammarAnimation(), Logger.getInstance(LoggerLevel.Error);
|
|
765
765
|
};
|
|
766
766
|
|
|
767
767
|
Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
|
|
768
768
|
Factory.registerMark(GroupMark.type, GroupMark), View.useRegisters([ registerFilterTransform, registerMapTransform ]),
|
|
769
|
-
registerVGrammarAnimation(),
|
|
769
|
+
registerVGrammarAnimation(), Logger.getInstance(LoggerLevel.Error);
|
|
770
770
|
//# sourceMappingURL=vchart.js.map
|