@visactor/vchart 2.0.15 → 2.0.16
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 +1 -1
- package/build/index.es.js +147 -58
- package/build/index.js +147 -58
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.js +1 -2
- package/cjs/animation/index.js +2 -1
- package/cjs/compile/util.js +1 -2
- package/cjs/component/marker/mark-point/base-mark-point.js +21 -21
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/component/util.js +2 -1
- package/cjs/constant/gradient.js +1 -2
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -1
- package/cjs/constant/word-cloud.js +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/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/series/word-cloud/base.d.ts +2 -0
- package/cjs/series/word-cloud/base.js +13 -4
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/measure-cache.d.ts +19 -0
- package/cjs/series/word-cloud/measure-cache.js +33 -0
- package/cjs/series/word-cloud/measure-cache.js.map +1 -0
- package/cjs/typings/visual.d.ts +13 -0
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/esm/animation/callback-disappear.js +1 -2
- package/esm/animation/index.js +2 -1
- package/esm/compile/util.js +1 -2
- package/esm/component/marker/mark-point/base-mark-point.js +21 -21
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/component/util.js +2 -1
- package/esm/constant/gradient.js +1 -2
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -1
- package/esm/constant/word-cloud.js +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/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- package/esm/series/word-cloud/base.d.ts +2 -0
- package/esm/series/word-cloud/base.js +14 -3
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/measure-cache.d.ts +19 -0
- package/esm/series/word-cloud/measure-cache.js +25 -0
- package/esm/series/word-cloud/measure-cache.js.map +1 -0
- package/esm/typings/visual.d.ts +13 -0
- package/esm/typings/visual.js.map +1 -1
- package/esm/vchart-all.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/series/word-cloud/measure-cache.ts"],"names":[],"mappings":";;;AAMA,MAAa,gBAAgB;IAI3B,YAAY,UAAkB,IAAI;QAH1B,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;QAIlD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAEtB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAwB;QACvC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC1B,OAAO;SACR;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAA2B,CAAC;YACnE,IAAI,MAAM,KAAK,SAAS,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aAC1B;SACF;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;CACF;AA3CD,4CA2CC","file":"measure-cache.js","sourcesContent":["export type CachedWordMeasure = {\n sprite: number[];\n bounds: { dTop: number; dBottom: number; dLeft: number; dRight: number };\n wordSize: [number, number];\n};\n\nexport class WordMeasureCache {\n private _map = new Map<string, CachedWordMeasure>();\n private _maxSize: number;\n\n constructor(maxSize: number = 1000) {\n this._maxSize = maxSize;\n }\n\n get(key: string) {\n const v = this._map.get(key);\n if (!v) {\n return undefined;\n }\n\n this._map.delete(key);\n this._map.set(key, v);\n\n return v;\n }\n\n set(key: string, value: CachedWordMeasure) {\n if (this._map.has(key)) {\n this._map.set(key, value);\n return;\n }\n\n if (this._map.size >= this._maxSize) {\n const oldest = this._map.keys().next().value as string | undefined;\n if (oldest !== undefined) {\n this._map.delete(oldest);\n }\n }\n\n this._map.set(key, value);\n }\n\n clear() {\n this._map.clear();\n }\n\n size() {\n return this._map.size;\n }\n}\n"]}
|
package/cjs/typings/visual.d.ts
CHANGED
|
@@ -87,8 +87,21 @@ export interface ICommonSpec {
|
|
|
87
87
|
}
|
|
88
88
|
export interface IFillMarkSpec extends ICommonSpec {
|
|
89
89
|
fill?: VisualType<string> | IGradient | false | IColorKey;
|
|
90
|
+
shadowBlur?: number;
|
|
91
|
+
shadowColor?: string;
|
|
92
|
+
shadowOffsetX?: number;
|
|
93
|
+
shadowOffsetY?: number;
|
|
90
94
|
fillOpacity?: number;
|
|
91
95
|
background?: IColor | HTMLImageElement | HTMLCanvasElement | null;
|
|
96
|
+
backgroundMode?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
|
97
|
+
backgroundFit?: boolean;
|
|
98
|
+
backgroundKeepAspectRatio?: boolean;
|
|
99
|
+
backgroundScale?: number;
|
|
100
|
+
backgroundOffsetX?: number;
|
|
101
|
+
backgroundOffsetY?: number;
|
|
102
|
+
backgroundClip?: boolean;
|
|
103
|
+
backgroundCornerRadius?: number | number[];
|
|
104
|
+
backgroundOpacity?: number;
|
|
92
105
|
}
|
|
93
106
|
export type IMarkHtmlSpec = Partial<IGraphicStyle['html']>;
|
|
94
107
|
export interface ISymbolMarkSpec extends IFillMarkSpec {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { PopTipAttributes } from '@visactor/vrender-components';\nimport type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IModelMarkAttributeContext } from '../compile/mark/interface';\nimport type { Datum } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { ITokenKey } from '../theme/token/interface';\nimport type {\n IRepeatType,\n TextAlignType,\n TextBaselineType,\n IRichTextAttribute,\n IGraphicStyle,\n IColor\n} from '@visactor/vrender-core';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n /**\n * type of scale\n */\n type: ScaleType;\n /**\n * will set to scale.domain, it means input of scale\n */\n domain: D[];\n /**\n * will set to scale.range, it means output of scale\n */\n range: T[];\n /**\n * will set to scale.specified if scale support, as a key-value pair matching capability\n * @since 1.1.0\n */\n specified?: { [key: string]: unknown };\n /**\n * enable clamp in linear scale\n * If clamp is enabled, the return value of the scale is always within the scale’s range.\n * @since 1.13.6\n * @default false\n */\n clamp?: boolean;\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n /**\n * 指定映射对应的数据字段\n */\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n /**\n * 数据的id\n */\n dataId: string;\n /**\n * 数据字段\n */\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n /**\n * scale 的id\n */\n id: string;\n /**\n * 定义域范围\n */\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, source?: DataView) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\n/**\n * border\n */\nexport interface IBorder {\n /**\n * 边框离图形边缘的距离\n */\n distance: number | string;\n /**\n * 边框的颜色\n */\n stroke?: string | IGradient;\n /**\n * 边框的透明度\n */\n strokeOpacity?: number;\n /**\n * 边框线的宽度\n */\n lineWidth?: number;\n /**\n * 给边框配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置边框的虚线偏移量\n */\n lineDashOffset?: number;\n}\n\nexport interface ICommonSpec {\n /**\n * 图形是否可见\n */\n visible?: boolean;\n /**\n * 图形的x坐标\n */\n x?: number;\n /**\n * 图形的y坐标\n */\n y?: number;\n /**\n * 图形的z坐标,仅适用于3D图表\n */\n z?: number;\n /**\n * 图形的描边颜色。\n * 支持使用 'rgb(255,255,255)','rgba(255,255,255,1)','#fff' 等方式设置为纯色,也支持设置为渐变色描边\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n stroke?: string | IGradient | false | (number | boolean)[] | IColorKey | null;\n /**\n * 描边透明度\n */\n strokeOpacity?: number;\n /**\n * 图形的透明度,既影响描边也影响填充\n */\n opacity?: number;\n /**\n * 图形的描边宽度\n */\n lineWidth?: number;\n /**\n * 给描边配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置虚线偏移量的属性\n */\n lineDashOffset?: number;\n /**\n * 设置图形的鼠标样式\n */\n cursor?: Cursor;\n /**\n * 设置图形的层级,主意这个是相对层级,图形引擎绘制的时候,会对相同group下的所有图形根据zIndex进行排序,然后从小到大进行渲染\n */\n zIndex?: number;\n /**\n * 图形的旋转角度\n */\n angle?: number;\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path的位置\n */\n anchor?: [number, number];\n\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n /**\n * 图形缩放中心\n * @since 1.4.0\n * 可以配置固定坐标,例如 [100, 100];或者百分比坐标,例如 ['50%', '50%'],代表以图元中心为缩放中心\n * */\n scaleCenter?: [number | string, number | string];\n\n // 3d旋转的属性\n /**\n * x方向的旋转角度\n */\n alpha?: number;\n /**\n * y方向的旋转角度\n */\n beta?: number;\n /**\n * 3d的锚点位置\n */\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n /**\n * bounds的计算模式\n */\n boundsMode?: 'accurate' | 'imprecise';\n\n /**\n * 用于扩展描边的拾取范围,为 0 就是默认线宽,正数就加宽,负数就减宽\n * @default 0\n * @since 1.7.3\n */\n pickStrokeBuffer?: number;\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框,外描边,描边位于图形外侧\n */\n outerBorder?: IBorder;\n /**\n * 内边框,内描边,描边位于图形内侧\n */\n innerBorder?: IBorder;\n /**\n * html 浮层,会将配置的html相关内容,绝对定位到图元的位置\n * @experimental\n * @since 1.10.0\n */\n html?: IMarkHtmlSpec;\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n /**\n * 图形的填充颜色\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n fill?: VisualType<string> | IGradient | false | IColorKey;\n /**\n * 填充的透明度\n */\n fillOpacity?: number;\n\n /**\n * 图形的背景色,支持纯色、image元素、canvas元素\n */\n background?: IColor | HTMLImageElement | HTMLCanvasElement | null;\n}\n\nexport type IMarkHtmlSpec = Partial<IGraphicStyle['html']>;\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n /**\n * x方向的偏移量\n */\n dx?: number;\n /**\n * y方向的偏移量\n */\n dy?: number;\n /**\n * 大小,相当于外接圆的半径\n */\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /**\n * 标记的类型\n * FIXME: vrender Symbol接收的图形属性,暂时都申明一下\n * */\n symbolType?: ShapeType | string;\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n /**\n * 取消的差值类型,默认为线性插值,也就是普通的折线\n */\n curveType?: InterpolateType;\n /**\n * 设置点是否有效,也就是是否合法\n */\n defined?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n /**\n * 面积的x1值\n */\n x1?: number;\n /**\n * 面积的y1值\n */\n y1?: number;\n /**\n * 面积图元的方向,\n * horizontal - 水平方向\n * vertical - 垂直方向\n */\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n /**\n * 指定如何绘制每一条线段末端的属性。有 3 个可能的值,分别是:'butt', 'round' and 'square'。默认值是 butt。\n */\n lineCap?: LineStrokeCap;\n /**\n * 用来设置 2 个长度不为 0 的相连部分(线段、圆弧、曲线)如何连接在一起的属性(长度为 0 的变形部分,其指定的末端和控制点在同一位置,会被忽略)。此属性有 3 个值: 'round', 'bevel' and 'miter'。默认值是 'miter'\n */\n lineJoin?: LineStrokeJoin;\n /**\n * 设置斜接面限制比例的属性。当获取属性值时,会返回当前的值(默认值是 10.0 )。当给属性赋值时,0、负数、 Infinity 和 NaN 都会被忽略;除此之外都会被赋予一个新值。\n */\n miterLimit?: number;\n /**\n * stroke 的有界缓冲区\n */\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n /**\n * 终点x坐标\n */\n x1?: number;\n /**\n * 终点y坐标\n */\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: string | number | string[] | number[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number | ITokenKey;\n /**\n * 文字水平方向的对齐方式\n */\n textAlign?: TextAlign;\n /**\n * 文字竖直方向的对齐方式\n */\n textBaseline?: TextBaseLine;\n /**\n * 字体\n */\n fontFamily?: string;\n /**\n * 字重\n */\n fontWeight?: FontWeight;\n /**\n * 字体样式,是否为斜体等\n */\n fontStyle?: FontStyle;\n /**\n * 文字的最大长度\n */\n maxLineWidth?: number;\n /**\n * 文字超出 maxLineWidth 后的省略符\n */\n ellipsis?: string;\n /**\n * 文本省略的位置,默认尾部省略\n * 1. 'start' 文字首部省略\n * 2. 'middle' 文本中间省略\n * 3. 'end' 文本尾部省略\n * @default 'end'\n * @since 1.7.3\n */\n suffixPosition?: 'start' | 'end' | 'middle';\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 下划线的虚线样式\n */\n underlineDash?: number[];\n /**\n * 下划线的虚线偏移量\n */\n underlineOffset?: number;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高(1.3.1 版本新增字符串类型表示比例值,如\"150%\")\n * @since 1.3.1\n */\n lineHeight?: number | string | ITokenKey;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n /**\n * 文本的排布方向,如果需要文本纵向排布,可以配置为 'vertical'\n * @default 'horizontal'\n */\n direction?: 'horizontal' | 'vertical';\n /*\n * 单词断行\n */\n wordBreak?: 'break-word' | 'break-all' | 'keep-all';\n /**\n * 高度限制控制显示内容及省略号\n */\n heightLimit?: number;\n /**\n * 按照行数限制显示内容及省略号\n */\n lineClamp?: number;\n /**\n * 设置如何处理空白字符\n */\n whiteSpace?: 'normal' | 'no-wrap';\n}\n\nexport type IRichTextMarkSpec = IRichTextAttribute &\n IFillMarkSpec & { type: 'rich'; text: IRichTextAttribute['textConfig'] };\n\nexport type IComposedTextMarkSpec = ITextMarkSpec | IRichTextMarkSpec;\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * x方向终点坐标\n */\n x1?: number;\n /**\n * y方向终点坐标\n */\n\n y1?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n // ============ 数据统计值配置 ============\n /**\n * 最小值(箱线图的下限)\n * 用于计算箱线图的下端须线位置\n */\n min?: (datum: Datum) => number;\n /**\n * 第一四分位数(Q1,25%分位数)\n * 用于确定箱体的下边界\n */\n q1?: (datum: Datum) => number;\n /**\n * 中位数(Q2,50%分位数)\n * 在箱体中绘制中位数线\n */\n median?: (datum: Datum) => number;\n /**\n * 第三四分位数(Q3,75%分位数)\n * 用于确定箱体的上边界\n */\n q3?: (datum: Datum) => number;\n /**\n * 最大值(箱线图的上限)\n * 用于计算箱线图的上端须线位置\n */\n max?: (datum: Datum) => number;\n\n // ============ 样式形态配置 ============\n /**\n * 中轴线(须线)的绘制形状\n * - 'line': 标准线条形式,绘制 shaft(连接线)、box(箱体)、max/min/median(线条)五个子图元\n * - 'bar': 柱状形式,绘制 minMaxBox(最小-最大值矩形)、q1q3Box(Q1-Q3矩形)、median(中位数线)三个子图元\n * - 'filled-line': 填充线条形式\n * @default 'line'\n */\n shaftShape?: BoxPlotShaftShape;\n\n // ============ 尺寸配置(shaftShape = 'line' / 'filled-line' 模式)============\n /**\n * 箱体的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的尺寸\n * 支持像素值或百分比字符串(相对于分组宽度)\n * @default 30\n */\n boxWidth?: number | string;\n /**\n * 箱体的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n boxHeight?: number | string;\n /**\n * 最大/最小值须线的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 max/min 子图元的线条长度\n * 支持像素值或百分比字符串\n * @default 20\n */\n shaftWidth?: number | string;\n /**\n * 最大/最小值须线端点的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n ruleWidth?: number | string;\n /**\n * 最大/最小值须线端点的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n ruleHeight?: number | string;\n\n // ============ 尺寸配置(shaftShape = 'bar' 模式)============\n /**\n * 最小-最大值矩形的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下,控制 minMaxBox 子图元的尺寸\n */\n minMaxWidth?: number | string;\n /**\n * 最小-最大值矩形的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下使用\n */\n minMaxHeight?: number | string;\n /**\n * Q1-Q3 四分位数矩形的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下,控制 q1q3Box 子图元的尺寸\n */\n q1q3Width?: number | string;\n /**\n * Q1-Q3 四分位数矩形的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下使用\n */\n q1q3Height?: number | string;\n\n // ============ 样式配置 ============\n /**\n * 箱线图的描边宽度\n * 在 shaftShape = 'line' / 'filled-line' 模式下影响所有线条的宽度\n * 在 shaftShape = 'bar' 模式下,minMaxBox 和 q1q3Box 的 lineWidth 会被强制设为 0\n * @default 2\n */\n lineWidth?: number;\n /**\n * 最小-最大值矩形的填充透明度\n * 仅在 shaftShape = 'bar' 模式下生效,控制 minMaxBox 子图元的 fillOpacity\n */\n minMaxFillOpacity?: number;\n /**\n * 箱体的描边颜色\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的 stroke 属性\n * @since 2.0.11\n */\n boxStroke?: string;\n /**\n * 中位数线的描边颜色\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 median 子图元的 stroke 属性\n * @since 2.0.11\n */\n medianStroke?: string;\n /**\n * 箱体的圆角半径\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的 cornerRadius 属性\n * @since 2.0.11\n */\n boxCornerRadius?: number;\n}\n\nexport interface IRippleMarkSpec extends ICommonSpec {\n /**\n * 波纹密度ripple\n * ripple 取值范为[0,1]\n */\n ripple?: number;\n /**\n * 水波纹最大半径\n */\n size?: number;\n}\n\nexport interface ILiquidMarkSpec extends ICommonSpec {\n /**\n * 波浪的变化状态,范围为 [0, 1]\n */\n wave?: number;\n}\n\nexport interface ILiquidOutlineSpec extends ISymbolMarkSpec {\n /**\n * 描边的宽度\n */\n lineWidth: number;\n}\n\nexport interface IOutlierMarkSpec {\n /**\n * 异常点填充颜色\n */\n fill?: string;\n /**\n * 异常点大小\n */\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n // TODO: 该属性后续可能会删除,未定\n /**\n * 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n */\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n /**\n * 连边起点的x坐标\n */\n x0?: number;\n /**\n * 连边起点的y坐标\n */\n y0?: number;\n /**\n * 连边终点的x坐标\n */\n x1?: number;\n /**\n * 连边终点的y坐标\n */\n y1?: number;\n /**\n * 连边的厚度,也可以理解为宽度\n */\n thickness?: number;\n /**\n * 连边的曲度,决定了连边的弯曲程度,取值范围为0-1,\n * 0表示不弯曲,也就是直线\n * 1表示最大的弯曲度,\n * 默认值为0.5\n */\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n /**\n * 对齐方式\n */\n align?: 'start' | 'end' | 'center';\n /**\n * 连边的类型\n *\n */\n pathType?: 'line' | 'smooth' | 'polyline';\n /**\n * 是否展示终点的箭头\n */\n endArrow?: boolean;\n /**\n * 是否展示起点的箭头\n */\n startArrow?: boolean;\n /**\n * 背景线的样式,主要用于部分高亮的场景\n */\n backgroundStyle?: any;\n /**\n * 连边的方向\n */\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\n/**\n * arc图元的视觉通道配置\n */\nexport interface IArcMarkSpec extends IFillMarkSpec {\n /**\n * 圆弧的开始角度\n */\n startAngle?: number;\n /**\n * 圆弧的结束角度\n */\n endAngle?: number;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle?: number;\n\n /**\n * 外径,既外半径\n */\n outerRadius?: number;\n /**\n * 内径,既内半径\n */\n innerRadius?: number;\n /**\n * 圆角\n */\n cornerRadius?: number;\n /**\n * 内边距\n */\n innerPadding?: number;\n /**\n * 外边距\n */\n outerPadding?: number;\n /**\n * arc的中心点偏移距离,一般是通过在交互状态下设置这个属性来实现将扇区移出中心的一个效果\n */\n centerOffset?: number;\n /**\n * arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外\n */\n cap?: boolean | [boolean, boolean];\n /**\n * arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效\n */\n autoCapConical?: boolean;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n /**\n * 内边距\n */\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends IFillMarkSpec {\n /**\n * 是否开启裁剪\n */\n clip?: boolean;\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n /**\n * 顶点坐标\n */\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n /**\n * 渐变色的偏移量,0-1的值\n */\n offset: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n color?: GradientPropValue<string>;\n /**\n * 渐变色的透明度\n */\n opacity?: number;\n};\nexport interface IGradientLinear {\n /**\n * 渐变色的起点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x0?: GradientPropValue<number>;\n /**\n * 渐变色的起点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y0?: GradientPropValue<number>;\n /**\n * 渐变色的终点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x1?: GradientPropValue<number>;\n /**\n * 渐变色的终点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'linear',即线形渐变\n */\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n /**\n * 径向渐变的起点的半径\n */\n r0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的x坐标\n */\n x0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的y坐标\n */\n y0?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的x坐标\n */\n x1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的y坐标\n */\n y1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的半径\n */\n r1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'radial',即径向渐变\n */\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n /**\n * 锥形渐变的中心点x坐标\n */\n x?: GradientPropValue<number>;\n /**\n * 锥形渐变的中心点y坐标\n */\n y?: GradientPropValue<number>;\n /**\n * 锥形渐变的开始角度\n */\n startAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的结束角度\n */\n endAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'conical',即锥形渐变\n */\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar' | 'filled-line';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\nexport interface IImageMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 图片的宽度\n */\n width?: number;\n /**\n * 图片的高度\n */\n height?: number;\n /**\n * 当图片的宽度小于 width 时,图片的重复方式\n */\n repeatX?: IRepeatType;\n /**\n * 当图片的高度小于 height 时,图片的重复方式\n */\n repeatY?: IRepeatType;\n /**\n * 设置图片的内容,支持三种类型:\n * 1. string类型,可以是图片资源的路径或者是svg 标签字符串\n * 2. image 元素\n * 3. canvas 元素\n */\n image?: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = TextAlignType;\nexport type TextBaseLine = TextBaselineType;\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { PopTipAttributes } from '@visactor/vrender-components';\nimport type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IModelMarkAttributeContext } from '../compile/mark/interface';\nimport type { Datum } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { ITokenKey } from '../theme/token/interface';\nimport type {\n IRepeatType,\n TextAlignType,\n TextBaselineType,\n IRichTextAttribute,\n IGraphicStyle,\n IColor\n} from '@visactor/vrender-core';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n /**\n * type of scale\n */\n type: ScaleType;\n /**\n * will set to scale.domain, it means input of scale\n */\n domain: D[];\n /**\n * will set to scale.range, it means output of scale\n */\n range: T[];\n /**\n * will set to scale.specified if scale support, as a key-value pair matching capability\n * @since 1.1.0\n */\n specified?: { [key: string]: unknown };\n /**\n * enable clamp in linear scale\n * If clamp is enabled, the return value of the scale is always within the scale’s range.\n * @since 1.13.6\n * @default false\n */\n clamp?: boolean;\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n /**\n * 指定映射对应的数据字段\n */\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n /**\n * 数据的id\n */\n dataId: string;\n /**\n * 数据字段\n */\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n /**\n * scale 的id\n */\n id: string;\n /**\n * 定义域范围\n */\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, source?: DataView) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\n/**\n * border\n */\nexport interface IBorder {\n /**\n * 边框离图形边缘的距离\n */\n distance: number | string;\n /**\n * 边框的颜色\n */\n stroke?: string | IGradient;\n /**\n * 边框的透明度\n */\n strokeOpacity?: number;\n /**\n * 边框线的宽度\n */\n lineWidth?: number;\n /**\n * 给边框配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置边框的虚线偏移量\n */\n lineDashOffset?: number;\n}\n\nexport interface ICommonSpec {\n /**\n * 图形是否可见\n */\n visible?: boolean;\n /**\n * 图形的x坐标\n */\n x?: number;\n /**\n * 图形的y坐标\n */\n y?: number;\n /**\n * 图形的z坐标,仅适用于3D图表\n */\n z?: number;\n /**\n * 图形的描边颜色。\n * 支持使用 'rgb(255,255,255)','rgba(255,255,255,1)','#fff' 等方式设置为纯色,也支持设置为渐变色描边\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n stroke?: string | IGradient | false | (number | boolean)[] | IColorKey | null;\n /**\n * 描边透明度\n */\n strokeOpacity?: number;\n /**\n * 图形的透明度,既影响描边也影响填充\n */\n opacity?: number;\n /**\n * 图形的描边宽度\n */\n lineWidth?: number;\n /**\n * 给描边配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置虚线偏移量的属性\n */\n lineDashOffset?: number;\n /**\n * 设置图形的鼠标样式\n */\n cursor?: Cursor;\n /**\n * 设置图形的层级,主意这个是相对层级,图形引擎绘制的时候,会对相同group下的所有图形根据zIndex进行排序,然后从小到大进行渲染\n */\n zIndex?: number;\n /**\n * 图形的旋转角度\n */\n angle?: number;\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path的位置\n */\n anchor?: [number, number];\n\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n /**\n * 图形缩放中心\n * @since 1.4.0\n * 可以配置固定坐标,例如 [100, 100];或者百分比坐标,例如 ['50%', '50%'],代表以图元中心为缩放中心\n * */\n scaleCenter?: [number | string, number | string];\n\n // 3d旋转的属性\n /**\n * x方向的旋转角度\n */\n alpha?: number;\n /**\n * y方向的旋转角度\n */\n beta?: number;\n /**\n * 3d的锚点位置\n */\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n /**\n * bounds的计算模式\n */\n boundsMode?: 'accurate' | 'imprecise';\n\n /**\n * 用于扩展描边的拾取范围,为 0 就是默认线宽,正数就加宽,负数就减宽\n * @default 0\n * @since 1.7.3\n */\n pickStrokeBuffer?: number;\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框,外描边,描边位于图形外侧\n */\n outerBorder?: IBorder;\n /**\n * 内边框,内描边,描边位于图形内侧\n */\n innerBorder?: IBorder;\n /**\n * html 浮层,会将配置的html相关内容,绝对定位到图元的位置\n * @experimental\n * @since 1.10.0\n */\n html?: IMarkHtmlSpec;\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n /**\n * 图形的填充颜色\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n fill?: VisualType<string> | IGradient | false | IColorKey;\n /**\n * 图形模糊效果程度\n */\n shadowBlur?: number;\n /**\n * 图形的阴影颜色\n */\n shadowColor?: string;\n /**\n * 阴影水平偏移距离\n */\n shadowOffsetX?: number;\n /**\n * 阴影垂直偏移距离\n */\n shadowOffsetY?: number;\n /**\n * 填充的透明度\n */\n fillOpacity?: number;\n\n /**\n * 图形的背景色,支持纯色、image元素、canvas元素\n */\n background?: IColor | HTMLImageElement | HTMLCanvasElement | null;\n /**\n * 背景填充模式(与具体图元有关)\n */\n backgroundMode?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';\n /**\n * 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n */\n backgroundFit?: boolean;\n /**\n * 是否保持背景图的宽高比\n */\n backgroundKeepAspectRatio?: boolean;\n /**\n * 背景图缩放,只在no-repeat的时候生效\n */\n backgroundScale?: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetX?: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetY?: number;\n /**\n * 背景图是否裁切,是否调用clip避免绘制到图元外部\n */\n backgroundClip?: boolean;\n /**\n * 背景圆角半径\n */\n backgroundCornerRadius?: number | number[];\n /**\n * 背景透明度\n */\n backgroundOpacity?: number;\n}\n\nexport type IMarkHtmlSpec = Partial<IGraphicStyle['html']>;\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n /**\n * x方向的偏移量\n */\n dx?: number;\n /**\n * y方向的偏移量\n */\n dy?: number;\n /**\n * 大小,相当于外接圆的半径\n */\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /**\n * 标记的类型\n * FIXME: vrender Symbol接收的图形属性,暂时都申明一下\n * */\n symbolType?: ShapeType | string;\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n /**\n * 取消的差值类型,默认为线性插值,也就是普通的折线\n */\n curveType?: InterpolateType;\n /**\n * 设置点是否有效,也就是是否合法\n */\n defined?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n /**\n * 面积的x1值\n */\n x1?: number;\n /**\n * 面积的y1值\n */\n y1?: number;\n /**\n * 面积图元的方向,\n * horizontal - 水平方向\n * vertical - 垂直方向\n */\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n /**\n * 指定如何绘制每一条线段末端的属性。有 3 个可能的值,分别是:'butt', 'round' and 'square'。默认值是 butt。\n */\n lineCap?: LineStrokeCap;\n /**\n * 用来设置 2 个长度不为 0 的相连部分(线段、圆弧、曲线)如何连接在一起的属性(长度为 0 的变形部分,其指定的末端和控制点在同一位置,会被忽略)。此属性有 3 个值: 'round', 'bevel' and 'miter'。默认值是 'miter'\n */\n lineJoin?: LineStrokeJoin;\n /**\n * 设置斜接面限制比例的属性。当获取属性值时,会返回当前的值(默认值是 10.0 )。当给属性赋值时,0、负数、 Infinity 和 NaN 都会被忽略;除此之外都会被赋予一个新值。\n */\n miterLimit?: number;\n /**\n * stroke 的有界缓冲区\n */\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n /**\n * 终点x坐标\n */\n x1?: number;\n /**\n * 终点y坐标\n */\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: string | number | string[] | number[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number | ITokenKey;\n /**\n * 文字水平方向的对齐方式\n */\n textAlign?: TextAlign;\n /**\n * 文字竖直方向的对齐方式\n */\n textBaseline?: TextBaseLine;\n /**\n * 字体\n */\n fontFamily?: string;\n /**\n * 字重\n */\n fontWeight?: FontWeight;\n /**\n * 字体样式,是否为斜体等\n */\n fontStyle?: FontStyle;\n /**\n * 文字的最大长度\n */\n maxLineWidth?: number;\n /**\n * 文字超出 maxLineWidth 后的省略符\n */\n ellipsis?: string;\n /**\n * 文本省略的位置,默认尾部省略\n * 1. 'start' 文字首部省略\n * 2. 'middle' 文本中间省略\n * 3. 'end' 文本尾部省略\n * @default 'end'\n * @since 1.7.3\n */\n suffixPosition?: 'start' | 'end' | 'middle';\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 下划线的虚线样式\n */\n underlineDash?: number[];\n /**\n * 下划线的虚线偏移量\n */\n underlineOffset?: number;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高(1.3.1 版本新增字符串类型表示比例值,如\"150%\")\n * @since 1.3.1\n */\n lineHeight?: number | string | ITokenKey;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n /**\n * 文本的排布方向,如果需要文本纵向排布,可以配置为 'vertical'\n * @default 'horizontal'\n */\n direction?: 'horizontal' | 'vertical';\n /*\n * 单词断行\n */\n wordBreak?: 'break-word' | 'break-all' | 'keep-all';\n /**\n * 高度限制控制显示内容及省略号\n */\n heightLimit?: number;\n /**\n * 按照行数限制显示内容及省略号\n */\n lineClamp?: number;\n /**\n * 设置如何处理空白字符\n */\n whiteSpace?: 'normal' | 'no-wrap';\n}\n\nexport type IRichTextMarkSpec = IRichTextAttribute &\n IFillMarkSpec & { type: 'rich'; text: IRichTextAttribute['textConfig'] };\n\nexport type IComposedTextMarkSpec = ITextMarkSpec | IRichTextMarkSpec;\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * x方向终点坐标\n */\n x1?: number;\n /**\n * y方向终点坐标\n */\n\n y1?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n // ============ 数据统计值配置 ============\n /**\n * 最小值(箱线图的下限)\n * 用于计算箱线图的下端须线位置\n */\n min?: (datum: Datum) => number;\n /**\n * 第一四分位数(Q1,25%分位数)\n * 用于确定箱体的下边界\n */\n q1?: (datum: Datum) => number;\n /**\n * 中位数(Q2,50%分位数)\n * 在箱体中绘制中位数线\n */\n median?: (datum: Datum) => number;\n /**\n * 第三四分位数(Q3,75%分位数)\n * 用于确定箱体的上边界\n */\n q3?: (datum: Datum) => number;\n /**\n * 最大值(箱线图的上限)\n * 用于计算箱线图的上端须线位置\n */\n max?: (datum: Datum) => number;\n\n // ============ 样式形态配置 ============\n /**\n * 中轴线(须线)的绘制形状\n * - 'line': 标准线条形式,绘制 shaft(连接线)、box(箱体)、max/min/median(线条)五个子图元\n * - 'bar': 柱状形式,绘制 minMaxBox(最小-最大值矩形)、q1q3Box(Q1-Q3矩形)、median(中位数线)三个子图元\n * - 'filled-line': 填充线条形式\n * @default 'line'\n */\n shaftShape?: BoxPlotShaftShape;\n\n // ============ 尺寸配置(shaftShape = 'line' / 'filled-line' 模式)============\n /**\n * 箱体的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的尺寸\n * 支持像素值或百分比字符串(相对于分组宽度)\n * @default 30\n */\n boxWidth?: number | string;\n /**\n * 箱体的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n boxHeight?: number | string;\n /**\n * 最大/最小值须线的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 max/min 子图元的线条长度\n * 支持像素值或百分比字符串\n * @default 20\n */\n shaftWidth?: number | string;\n /**\n * 最大/最小值须线端点的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n ruleWidth?: number | string;\n /**\n * 最大/最小值须线端点的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'line' / 'filled-line' 模式下使用\n */\n ruleHeight?: number | string;\n\n // ============ 尺寸配置(shaftShape = 'bar' 模式)============\n /**\n * 最小-最大值矩形的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下,控制 minMaxBox 子图元的尺寸\n */\n minMaxWidth?: number | string;\n /**\n * 最小-最大值矩形的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下使用\n */\n minMaxHeight?: number | string;\n /**\n * Q1-Q3 四分位数矩形的宽度(垂直箱线图)或高度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下,控制 q1q3Box 子图元的尺寸\n */\n q1q3Width?: number | string;\n /**\n * Q1-Q3 四分位数矩形的高度(垂直箱线图)或宽度(水平箱线图)\n * 在 shaftShape = 'bar' 模式下使用\n */\n q1q3Height?: number | string;\n\n // ============ 样式配置 ============\n /**\n * 箱线图的描边宽度\n * 在 shaftShape = 'line' / 'filled-line' 模式下影响所有线条的宽度\n * 在 shaftShape = 'bar' 模式下,minMaxBox 和 q1q3Box 的 lineWidth 会被强制设为 0\n * @default 2\n */\n lineWidth?: number;\n /**\n * 最小-最大值矩形的填充透明度\n * 仅在 shaftShape = 'bar' 模式下生效,控制 minMaxBox 子图元的 fillOpacity\n */\n minMaxFillOpacity?: number;\n /**\n * 箱体的描边颜色\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的 stroke 属性\n * @since 2.0.11\n */\n boxStroke?: string;\n /**\n * 中位数线的描边颜色\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 median 子图元的 stroke 属性\n * @since 2.0.11\n */\n medianStroke?: string;\n /**\n * 箱体的圆角半径\n * 在 shaftShape = 'line' / 'filled-line' 模式下,控制 box 子图元的 cornerRadius 属性\n * @since 2.0.11\n */\n boxCornerRadius?: number;\n}\n\nexport interface IRippleMarkSpec extends ICommonSpec {\n /**\n * 波纹密度ripple\n * ripple 取值范为[0,1]\n */\n ripple?: number;\n /**\n * 水波纹最大半径\n */\n size?: number;\n}\n\nexport interface ILiquidMarkSpec extends ICommonSpec {\n /**\n * 波浪的变化状态,范围为 [0, 1]\n */\n wave?: number;\n}\n\nexport interface ILiquidOutlineSpec extends ISymbolMarkSpec {\n /**\n * 描边的宽度\n */\n lineWidth: number;\n}\n\nexport interface IOutlierMarkSpec {\n /**\n * 异常点填充颜色\n */\n fill?: string;\n /**\n * 异常点大小\n */\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n // TODO: 该属性后续可能会删除,未定\n /**\n * 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n */\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n /**\n * 连边起点的x坐标\n */\n x0?: number;\n /**\n * 连边起点的y坐标\n */\n y0?: number;\n /**\n * 连边终点的x坐标\n */\n x1?: number;\n /**\n * 连边终点的y坐标\n */\n y1?: number;\n /**\n * 连边的厚度,也可以理解为宽度\n */\n thickness?: number;\n /**\n * 连边的曲度,决定了连边的弯曲程度,取值范围为0-1,\n * 0表示不弯曲,也就是直线\n * 1表示最大的弯曲度,\n * 默认值为0.5\n */\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n /**\n * 对齐方式\n */\n align?: 'start' | 'end' | 'center';\n /**\n * 连边的类型\n *\n */\n pathType?: 'line' | 'smooth' | 'polyline';\n /**\n * 是否展示终点的箭头\n */\n endArrow?: boolean;\n /**\n * 是否展示起点的箭头\n */\n startArrow?: boolean;\n /**\n * 背景线的样式,主要用于部分高亮的场景\n */\n backgroundStyle?: any;\n /**\n * 连边的方向\n */\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\n/**\n * arc图元的视觉通道配置\n */\nexport interface IArcMarkSpec extends IFillMarkSpec {\n /**\n * 圆弧的开始角度\n */\n startAngle?: number;\n /**\n * 圆弧的结束角度\n */\n endAngle?: number;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle?: number;\n\n /**\n * 外径,既外半径\n */\n outerRadius?: number;\n /**\n * 内径,既内半径\n */\n innerRadius?: number;\n /**\n * 圆角\n */\n cornerRadius?: number;\n /**\n * 内边距\n */\n innerPadding?: number;\n /**\n * 外边距\n */\n outerPadding?: number;\n /**\n * arc的中心点偏移距离,一般是通过在交互状态下设置这个属性来实现将扇区移出中心的一个效果\n */\n centerOffset?: number;\n /**\n * arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外\n */\n cap?: boolean | [boolean, boolean];\n /**\n * arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效\n */\n autoCapConical?: boolean;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n /**\n * 内边距\n */\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends IFillMarkSpec {\n /**\n * 是否开启裁剪\n */\n clip?: boolean;\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n /**\n * 顶点坐标\n */\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n /**\n * 渐变色的偏移量,0-1的值\n */\n offset: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n color?: GradientPropValue<string>;\n /**\n * 渐变色的透明度\n */\n opacity?: number;\n};\nexport interface IGradientLinear {\n /**\n * 渐变色的起点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x0?: GradientPropValue<number>;\n /**\n * 渐变色的起点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y0?: GradientPropValue<number>;\n /**\n * 渐变色的终点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x1?: GradientPropValue<number>;\n /**\n * 渐变色的终点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'linear',即线形渐变\n */\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n /**\n * 径向渐变的起点的半径\n */\n r0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的x坐标\n */\n x0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的y坐标\n */\n y0?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的x坐标\n */\n x1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的y坐标\n */\n y1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的半径\n */\n r1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'radial',即径向渐变\n */\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n /**\n * 锥形渐变的中心点x坐标\n */\n x?: GradientPropValue<number>;\n /**\n * 锥形渐变的中心点y坐标\n */\n y?: GradientPropValue<number>;\n /**\n * 锥形渐变的开始角度\n */\n startAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的结束角度\n */\n endAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'conical',即锥形渐变\n */\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar' | 'filled-line';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\nexport interface IImageMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 图片的宽度\n */\n width?: number;\n /**\n * 图片的高度\n */\n height?: number;\n /**\n * 当图片的宽度小于 width 时,图片的重复方式\n */\n repeatX?: IRepeatType;\n /**\n * 当图片的高度小于 height 时,图片的重复方式\n */\n repeatY?: IRepeatType;\n /**\n * 设置图片的内容,支持三种类型:\n * 1. string类型,可以是图片资源的路径或者是svg 标签字符串\n * 2. image 元素\n * 3. canvas 元素\n */\n image?: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = TextAlignType;\nexport type TextBaseLine = TextBaselineType;\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
|
package/cjs/vchart-all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;
|
|
1
|
+
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAoKvB,uFApKA,aAAM,OAoKA;AAlKf,uCAAiD;AACjD,uCAAiD;AACjD,qCAA+C;AAC/C,6CAAuD;AACvD,qCAA+C;AAC/C,qCAA+C;AAC/C,uCAAiD;AACjD,yCAAmD;AACnD,2CAAqD;AACrD,+CAAyD;AACzD,iDAA2D;AAC3D,wDAA0E;AAC1E,yCAAmD;AACnD,mDAAyF;AACzF,2CAAqD;AACrD,oDAAsE;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AAqB;IACrB,mCAAsB;IACtB,iCAAoB;IAEpB,qBAAa;IACb,uBAAc;IACd,qBAAa;IACb,gCAAkB;IAClB,qBAAa;IACb,gCAAkB;IAClB,uBAAc;IAGd,gCAAkB;IAGlB,uBAAgB;IAGhB,2CAAyB;IACzB,8CAA4B;IAC5B,gCAAoB;IAGpB,mCAAqB;IAErB,2CAA6B;IAC7B,8CAAgC;IAEhC,4CAA8B;IAC9B,6CAA+B;IAC/B,2CAA6B;IAE7B,uBAAe;IACf,oCAA4B;IAC5B,mCAA2B;CAC5B,CAAC,CAAC","file":"vchart-all.js","sourcesContent":["import { VChart } from './core';\n\nimport { registerLineChart } from './chart/line';\nimport { registerAreaChart } from './chart/area';\nimport { registerBarChart } from './chart/bar';\nimport { registerScatterChart } from './chart/scatter';\nimport { registerMapChart } from './chart/map';\nimport { registerPieChart } from './chart/pie';\nimport { registerRoseChart } from './chart/rose';\nimport { registerRadarChart } from './chart/radar';\nimport { registerCommonChart } from './chart/common';\nimport { registerSequenceChart } from './chart/sequence';\nimport { registerHistogramChart } from './chart/histogram';\nimport { registerCircularProgressChart } from './chart/progress/circular';\nimport { registerGaugeChart } from './chart/gauge';\nimport { registerWordCloudChart, registerWordCloudShapeChart } from './chart/word-cloud';\nimport { registerFunnelChart } from './chart/funnel';\nimport { registerLinearProgressChart } from './chart/progress/linear';\nimport { registerRangeColumnChart } from './chart/range-column';\nimport { registerSunburstChart } from './chart/sunburst';\nimport { registerCirclePackingChart } from './chart/circle-packing';\nimport { registerTreemapChart } from './chart/treemap';\nimport { registerWaterfallChart } from './chart/waterfall';\nimport { registerBoxplotChart } from './chart/box-plot';\nimport { registerSankeyChart } from './chart/sankey';\nimport { registerRangeAreaChart } from './chart/range-area';\nimport { registerHeatmapChart } from './chart/heatmap';\nimport { registerCorrelationChart } from './chart/correlation';\nimport {\n registerCartesianBandAxis,\n registerCartesianLinearAxis,\n registerCartesianLogAxis,\n registerCartesianSymlogAxis,\n registerCartesianTimeAxis\n} from './component/axis/cartesian';\nimport { registerPolarBandAxis, registerPolarLinearAxis } from './component/axis/polar';\nimport { registerContinuousLegend, registerDiscreteLegend } from './component/legend';\nimport { registerTooltip } from './component/tooltip';\nimport { registerCartesianCrossHair, registerPolarCrossHair } from './component/crosshair';\nimport { registerDataZoom, registerScrollBar } from './component/data-zoom';\nimport { registerIndicator } from './component/indicator';\nimport { registerGeoCoordinate } from './component/geo';\nimport { registerMarkLine, registerPolarMarkLine } from './component/marker/mark-line';\nimport { registerTitle } from './component/title';\nimport { registerMarkArea, registerPolarMarkArea } from './component/marker/mark-area';\nimport { registerPlayer } from './component/player';\nimport { registerLabel } from './component/label';\nimport { registerTotalLabel } from './component/label/total-label';\nimport { registerMarkPoint, registerPolarMarkPoint, registerGeoMarkPoint } from './component/marker/mark-point';\nimport { registerBrush } from './component/brush';\nimport { registerCustomMark } from './component/custom-mark';\nimport { registerGridLayout } from './layout/grid-layout/grid-layout';\nimport { registerPoptip } from './component/poptip';\nimport { registerCanvasTooltipHandler, registerDomTooltipHandler } from './plugin/components/tooltip-handler';\nimport { registerFormatPlugin } from './plugin/chart/formatter';\n\nimport {\n registerElementActive,\n registerElementActiveByLegend,\n registerElementHighlightByLegend,\n registerElementHighlightByName,\n registerElementHighlightByGroup,\n registerElementHighlightByKey\n} from './interaction';\nimport { registerAllMarks } from './mark';\nimport { registerAnimate, registerHtmlAttributePlugin, registerReactAttributePlugin } from './plugin/other';\n\nVChart.useRegisters([\n // charts\n registerLineChart,\n registerAreaChart,\n registerBarChart,\n registerScatterChart,\n registerPieChart,\n registerRoseChart,\n registerRadarChart,\n registerHistogramChart,\n registerMapChart,\n registerGaugeChart,\n registerWordCloudChart,\n registerWordCloudShapeChart,\n registerFunnelChart,\n registerWaterfallChart,\n registerBoxplotChart,\n registerCircularProgressChart,\n registerLinearProgressChart,\n registerRangeColumnChart,\n registerRangeAreaChart,\n registerSunburstChart,\n registerCirclePackingChart,\n registerTreemapChart,\n registerSankeyChart,\n registerHeatmapChart,\n registerSequenceChart,\n registerCorrelationChart,\n // 优化vchart-all体积, 默认不注册\n // registerTimelineChart,\n // registerLiquidChart,\n // registerVennChart,\n registerCommonChart,\n\n // components\n registerCartesianLinearAxis,\n registerCartesianBandAxis,\n registerCartesianTimeAxis,\n registerCartesianLogAxis,\n registerCartesianSymlogAxis,\n registerPolarBandAxis,\n registerPolarLinearAxis,\n\n registerDiscreteLegend,\n registerContinuousLegend,\n\n registerTooltip,\n registerCartesianCrossHair,\n registerPolarCrossHair,\n\n registerDataZoom,\n registerScrollBar,\n registerIndicator,\n registerGeoCoordinate,\n\n registerMarkLine,\n registerMarkArea,\n registerMarkPoint,\n registerPolarMarkLine,\n registerPolarMarkArea,\n registerPolarMarkPoint,\n registerGeoMarkPoint,\n\n registerTitle,\n registerPlayer,\n registerLabel,\n registerTotalLabel,\n registerBrush,\n registerCustomMark,\n registerPoptip,\n\n // layout\n registerGridLayout,\n\n // mark\n registerAllMarks,\n\n // plugin\n registerDomTooltipHandler,\n registerCanvasTooltipHandler,\n registerFormatPlugin,\n\n // interactions,\n registerElementActive,\n\n registerElementActiveByLegend,\n registerElementHighlightByLegend,\n\n registerElementHighlightByName,\n registerElementHighlightByGroup,\n registerElementHighlightByKey,\n\n registerAnimate,\n registerReactAttributePlugin,\n registerHtmlAttributePlugin\n]);\n\nexport { VChart };\n"]}
|
|
@@ -14,5 +14,4 @@ export class CallbackDisappearAnimate extends AStageAnimate {
|
|
|
14
14
|
var _a, _b;
|
|
15
15
|
return null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.callBack) || void 0 === _b ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
|
|
16
16
|
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=callback-disappear.js.map
|
|
17
|
+
}
|
package/esm/animation/index.js
CHANGED
|
@@ -6,4 +6,5 @@ export { registerSequentialAnimate } from "./sequential-animate";
|
|
|
6
6
|
|
|
7
7
|
export { registerPolygonAnimation, registerRectAnimation, registerArcAnimation, registerScaleInOutAnimation, DEFAULT_ANIMATION_CONFIG } from "./config";
|
|
8
8
|
|
|
9
|
-
export { animationConfig, userAnimationConfig, shouldMarkDoMorph } from "./utils";
|
|
9
|
+
export { animationConfig, userAnimationConfig, shouldMarkDoMorph } from "./utils";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
package/esm/compile/util.js
CHANGED
|
@@ -29,41 +29,41 @@ export class BaseMarkPoint extends BaseMarker {
|
|
|
29
29
|
return "polar" === markerSpec.coordinateType || doPolarProcess ? "polar" : "geo" === markerSpec.coordinateType || doGeoProcess ? "geo" : "cartesian";
|
|
30
30
|
}
|
|
31
31
|
_createMarkerComponent() {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
33
|
-
const {itemContent: itemContent = {}, itemLine: itemLine = {}, targetSymbol: targetSymbol = {}} = this._spec,
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
33
|
+
const {itemContent: itemContent = {}, itemLine: itemLine = {}, targetSymbol: targetSymbol = {}} = this._spec, _10 = itemContent, {type: type = "text", text: label, symbol: symbol, image: image, richText: richText, customMark: customMark, textStyle: textStyle, symbolStyle: symbolStyle, imageStyle: imageStyle, richTextStyle: richTextStyle, customMarkStyle: customMarkStyle, style: style = {}, state: state = {}} = _10, restItemContent = __rest(_10, [ "type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state" ]);
|
|
34
34
|
let itemContentState = null, itemContentStyle = null, defaultStyle = {};
|
|
35
35
|
"text" === type ? (itemContentState = null !== (_a = null == label ? void 0 : label.state) && void 0 !== _a ? _a : state,
|
|
36
36
|
defaultStyle = {
|
|
37
37
|
dx: 0,
|
|
38
38
|
dy: 0
|
|
39
39
|
}, itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), {
|
|
40
|
-
style: merge(defaultStyle, null !== (_c = null !== (_b = null == label ? void 0 : label.
|
|
41
|
-
}), this._markerData, this._markAttributeContext)) : "richText" === type ? (itemContentState = null !== (
|
|
40
|
+
style: merge(defaultStyle, null !== (_d = null !== (_c = null !== (_b = null == label ? void 0 : label.style) && void 0 !== _b ? _b : null == label ? void 0 : label.textStyle) && void 0 !== _c ? _c : textStyle) && void 0 !== _d ? _d : style)
|
|
41
|
+
}), this._markerData, this._markAttributeContext)) : "richText" === type ? (itemContentState = null !== (_e = null == richText ? void 0 : richText.state) && void 0 !== _e ? _e : state,
|
|
42
42
|
defaultStyle = {
|
|
43
43
|
width: 100,
|
|
44
44
|
height: 100
|
|
45
|
-
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (
|
|
45
|
+
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (_g = null !== (_f = null == richText ? void 0 : richText.style) && void 0 !== _f ? _f : richTextStyle) && void 0 !== _g ? _g : style), this._markerData, this._markAttributeContext)) : "symbol" === type ? (itemContentState = null !== (_h = null == symbol ? void 0 : symbol.state) && void 0 !== _h ? _h : state,
|
|
46
46
|
defaultStyle = {
|
|
47
47
|
symbolType: "star",
|
|
48
48
|
fill: "rgb(48, 115, 242)",
|
|
49
49
|
fillOpacity: .8,
|
|
50
50
|
size: 20
|
|
51
|
-
}, itemContentStyle = transformToGraphic(transformStyle(merge(defaultStyle, null !== (
|
|
51
|
+
}, itemContentStyle = transformToGraphic(transformStyle(merge(defaultStyle, null !== (_k = null !== (_j = null == symbol ? void 0 : symbol.style) && void 0 !== _j ? _j : symbolStyle) && void 0 !== _k ? _k : style), this._markerData, this._markAttributeContext))) : "image" === type ? (itemContentState = null !== (_l = null == image ? void 0 : image.state) && void 0 !== _l ? _l : state,
|
|
52
52
|
defaultStyle = {
|
|
53
53
|
width: 80,
|
|
54
54
|
height: 80
|
|
55
|
-
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (
|
|
56
|
-
itemContentStyle = transformStyle(null !== (
|
|
55
|
+
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (_o = null !== (_m = null == image ? void 0 : image.style) && void 0 !== _m ? _m : imageStyle) && void 0 !== _o ? _o : style), this._markerData, this._markAttributeContext)) : "custom" === type && (itemContentState = null !== (_p = null == customMark ? void 0 : customMark.state) && void 0 !== _p ? _p : state,
|
|
56
|
+
itemContentStyle = transformStyle(null !== (_r = null !== (_q = null == customMark ? void 0 : customMark.style) && void 0 !== _q ? _q : customMarkStyle) && void 0 !== _r ? _r : style, this._markerData, this._markAttributeContext));
|
|
57
57
|
const markPointAttrs = {
|
|
58
58
|
zIndex: this.layoutZIndex,
|
|
59
|
-
interactive: null === (
|
|
60
|
-
hover: null === (
|
|
61
|
-
select: null === (
|
|
59
|
+
interactive: null === (_s = this._spec.interactive) || void 0 === _s || _s,
|
|
60
|
+
hover: null === (_t = this._spec.interactive) || void 0 === _t || _t,
|
|
61
|
+
select: null === (_u = this._spec.interactive) || void 0 === _u || _u,
|
|
62
62
|
position: {
|
|
63
63
|
x: 0,
|
|
64
64
|
y: 0
|
|
65
65
|
},
|
|
66
|
-
clipInRange: null !== (
|
|
66
|
+
clipInRange: null !== (_v = this._spec.clip) && void 0 !== _v && _v,
|
|
67
67
|
itemContent: Object.assign(Object.assign({
|
|
68
68
|
type: type,
|
|
69
69
|
offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),
|
|
@@ -72,20 +72,20 @@ export class BaseMarkPoint extends BaseMarker {
|
|
|
72
72
|
style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)
|
|
73
73
|
}),
|
|
74
74
|
targetSymbol: {
|
|
75
|
-
offset: null !== (
|
|
76
|
-
visible: null !== (
|
|
77
|
-
size: null !== (
|
|
75
|
+
offset: null !== (_w = targetSymbol.offset) && void 0 !== _w ? _w : 0,
|
|
76
|
+
visible: null !== (_x = targetSymbol.visible) && void 0 !== _x && _x,
|
|
77
|
+
size: null !== (_y = targetSymbol.size) && void 0 !== _y ? _y : 20,
|
|
78
78
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
79
79
|
},
|
|
80
80
|
state: {
|
|
81
|
-
line: transformState(null !== (
|
|
82
|
-
lineStartSymbol: transformState(null !== (
|
|
83
|
-
lineEndSymbol: transformState(null !== (
|
|
81
|
+
line: transformState(null !== (_0 = null === (_z = this._spec.itemLine.line) || void 0 === _z ? void 0 : _z.state) && void 0 !== _0 ? _0 : {}, this._markerData, this._markAttributeContext),
|
|
82
|
+
lineStartSymbol: transformState(null !== (_2 = null === (_1 = this._spec.itemLine.startSymbol) || void 0 === _1 ? void 0 : _1.state) && void 0 !== _2 ? _2 : {}, this._markerData, this._markAttributeContext),
|
|
83
|
+
lineEndSymbol: transformState(null !== (_4 = null === (_3 = this._spec.itemLine.endSymbol) || void 0 === _3 ? void 0 : _3.state) && void 0 !== _4 ? _4 : {}, this._markerData, this._markAttributeContext),
|
|
84
84
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
85
|
-
textBackground: transformState(null === (
|
|
86
|
-
targetItem: transformState(null !== (
|
|
85
|
+
textBackground: transformState(null === (_6 = null === (_5 = this._spec.itemContent.text) || void 0 === _5 ? void 0 : _5.labelBackground) || void 0 === _6 ? void 0 : _6.state, this._markerData, this._markAttributeContext),
|
|
86
|
+
targetItem: transformState(null !== (_8 = null === (_7 = this._spec.targetSymbol) || void 0 === _7 ? void 0 : _7.state) && void 0 !== _8 ? _8 : {}, this._markerData, this._markAttributeContext)
|
|
87
87
|
},
|
|
88
|
-
animation: null !== (
|
|
88
|
+
animation: null !== (_9 = this._spec.animation) && void 0 !== _9 && _9,
|
|
89
89
|
animationEnter: this._spec.animationEnter,
|
|
90
90
|
animationExit: this._spec.animationExit,
|
|
91
91
|
animationUpd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cAAc,IAAI,CAAC,YAAY,EAAE;YAC5E,OAAO;SACR;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;;AAjOM,qBAAO,GAAG,WAAW,CAAC","file":"base-mark-point.js","sourcesContent":["import type { IMarkPoint, IMarkPointSpec } from './interface';\nimport {\n computeClipRange,\n computeOffsetFromRegion,\n getMarkPointProcessInfo,\n transformLabelAttributes,\n transformOffset,\n transformState,\n transformStyle\n} from '../utils';\nimport type { MarkPointAttrs } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';\nimport { isValid, merge } from '@visactor/vutils';\nimport { transformToGraphic } from '../../../util/style';\nimport { BaseMarker } from '../base-marker';\nimport { LayoutZIndex } from '../../../constant/layout';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { IMarkerLabelSpec, IMarkerLabelWithoutRefSpec } from '../interface';\n\nexport abstract class BaseMarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {\n static specKey = 'markPoint';\n specKey = 'markPoint';\n\n layoutZIndex: number = LayoutZIndex.MarkPoint;\n declare protected _markerComponent: MarkPointComponent;\n\n protected abstract _computePointsAttr(): any;\n\n static _getMarkerCoordinateType(markerSpec: any): string {\n const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);\n if (markerSpec.coordinateType === 'polar' || doPolarProcess) {\n return 'polar';\n } else if (markerSpec.coordinateType === 'geo' || doGeoProcess) {\n return 'geo';\n }\n return 'cartesian';\n }\n\n protected _createMarkerComponent() {\n const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;\n const {\n type = 'text',\n\n // 老写法\n text: label,\n symbol,\n image,\n richText,\n customMark,\n textStyle,\n symbolStyle,\n imageStyle,\n richTextStyle,\n customMarkStyle,\n\n // 新写法\n style = {},\n state = {},\n\n ...restItemContent\n } = itemContent as any;\n\n let itemContentState = null;\n let itemContentStyle = null;\n let defaultStyle = {};\n\n if (type === 'text') {\n itemContentState = label?.state ?? state;\n defaultStyle = {\n dx: 0,\n dy: 0\n };\n itemContentStyle = transformLabelAttributes(\n {\n ...label,\n style: merge(defaultStyle, label?.textStyle ?? textStyle ?? (style as Pick<IMarkerLabelSpec, 'style'>))\n },\n this._markerData,\n this._markAttributeContext\n );\n } else if ((type as any) === 'richText') {\n itemContentState = richText?.state ?? state;\n defaultStyle = {\n width: 100,\n height: 100\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, richText?.style ?? richTextStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'symbol') {\n itemContentState = symbol?.state ?? state;\n defaultStyle = {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n };\n itemContentStyle = transformToGraphic(\n transformStyle(\n merge(defaultStyle, symbol?.style ?? symbolStyle ?? style),\n this._markerData,\n this._markAttributeContext\n )\n );\n } else if (type === 'image') {\n itemContentState = image?.state ?? state;\n defaultStyle = {\n width: 80,\n height: 80\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, image?.style ?? imageStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'custom') {\n itemContentState = customMark?.state ?? state;\n itemContentStyle = transformStyle(\n customMark?.style ?? customMarkStyle ?? style,\n this._markerData,\n this._markAttributeContext\n );\n }\n const markPointAttrs: MarkPointAttrs = {\n zIndex: this.layoutZIndex,\n interactive: this._spec.interactive ?? true,\n hover: this._spec.interactive ?? true,\n select: this._spec.interactive ?? true,\n position: { x: 0, y: 0 },\n clipInRange: this._spec.clip ?? false,\n itemContent: {\n type,\n offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n ...restItemContent, // Tips: 因为网站 demo 上已经透出了 imageStyle richTextStyle 的写法,为了兼容所以这个需要在后面覆盖\n style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)\n },\n targetSymbol: {\n offset: targetSymbol.offset ?? 0,\n visible: targetSymbol.visible ?? false,\n size: targetSymbol.size ?? 20,\n style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)\n },\n state: {\n line: transformState(this._spec.itemLine.line?.state ?? {}, this._markerData, this._markAttributeContext),\n lineStartSymbol: transformState(\n this._spec.itemLine.startSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n lineEndSymbol: transformState(\n this._spec.itemLine.endSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),\n textBackground: transformState(\n this._spec.itemContent.text?.labelBackground?.state,\n this._markerData,\n this._markAttributeContext\n ),\n targetItem: transformState(this._spec.targetSymbol?.state ?? {}, this._markerData, this._markAttributeContext)\n },\n animation: this._spec.animation ?? false,\n animationEnter: this._spec.animationEnter,\n animationExit: this._spec.animationExit,\n animationUpdate: this._spec.animationUpdate\n };\n\n const { visible, line = {}, ...restItemLine } = itemLine;\n if (visible !== false) {\n markPointAttrs.itemLine = {\n ...restItemLine,\n visible: true,\n lineStyle: transformToGraphic(line.style)\n } as any;\n } else {\n markPointAttrs.itemLine = {\n visible: false\n };\n }\n\n const markPoint = new MarkPointComponent(markPointAttrs);\n return markPoint as unknown as IGroup;\n }\n\n protected _markerLayout() {\n const spec = this._spec;\n const data = this._markerData;\n const relativeSeries = this._relativeSeries;\n\n const { point } = this._computePointsAttr();\n\n const seriesData = this._getRelativeDataView().latestData;\n const dataPoints = data\n ? data.latestData[0] && data.latestData[0].latestData\n ? data.latestData[0].latestData\n : data.latestData\n : seriesData;\n\n let limitRect;\n if (spec.clip || spec.itemContent?.confine) {\n const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);\n limitRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }\n if (this._markerComponent) {\n const attribute = this._markerComponent.attribute ?? {};\n const textStyle = (attribute.itemContent as any)?.textStyle ?? {};\n this._markerComponent.setAttributes({\n position: point === undefined ? { x: null, y: null } : point, // setAttrs时merge时undefined会被忽略, 所以这里做转换\n itemContent: {\n ...attribute.itemContent,\n textStyle: {\n ...textStyle,\n text: this._spec.itemContent.text?.formatMethod\n ? // type error here will be fixed in components\n (this._spec.itemContent.text.formatMethod(dataPoints, seriesData) as any)\n : textStyle.text\n },\n offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())\n } as any,\n limitRect,\n dx: this._layoutOffsetX,\n dy: this._layoutOffsetY\n });\n }\n }\n\n protected _initDataView(): void {\n const spec = this._spec as any;\n const { doXYProcess, doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(spec);\n const isCoordinateProcess = isValid(spec.coordinate);\n if (!isCoordinateProcess && !doXYProcess && !doPolarProcess && !doGeoProcess) {\n return;\n }\n\n this._initCommonDataView();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/component/marker/mark-point/base-mark-point.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,MAAM,OAAgB,aAAc,SAAQ,UAA0B;IAAtE;;QAEE,YAAO,GAAG,WAAW,CAAC;QAEtB,iBAAY,GAAW,YAAY,CAAC,SAAS,CAAC;IAkOhD,C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uB,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,EACxG,OAAO,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,GAClG;gBACR,SAAS;gBACT,EAAE,EAAE,IAAI,CAAC,cAAc;gBACvB,EAAE,EAAE,IAAI,CAAC,cAAc;aACxB,CAAC,CAAC;SACJ;IACH,CAAC;IAES,aAAa;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QAC/B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACpF,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,mBAAmB,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,EAAE;YAC5E,OAAO;SACR;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;;AApOM,qBAAO,GAAG,WAAW,CAAC","file":"base-mark-point.js","sourcesContent":["import type { IMarkPoint, IMarkPointSpec } from './interface';\nimport {\n computeClipRange,\n computeOffsetFromRegion,\n getMarkPointProcessInfo,\n transformLabelAttributes,\n transformOffset,\n transformState,\n transformStyle\n} from '../utils';\nimport type { MarkPointAttrs } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';\nimport { isValid, merge } from '@visactor/vutils';\nimport { transformToGraphic } from '../../../util/style';\nimport { BaseMarker } from '../base-marker';\nimport { LayoutZIndex } from '../../../constant/layout';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { IMarkerLabelSpec, IMarkerLabelWithoutRefSpec } from '../interface';\n\nexport abstract class BaseMarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {\n static specKey = 'markPoint';\n specKey = 'markPoint';\n\n layoutZIndex: number = LayoutZIndex.MarkPoint;\n protected declare _markerComponent: MarkPointComponent;\n\n protected abstract _computePointsAttr(): any;\n\n static _getMarkerCoordinateType(markerSpec: any): string {\n const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);\n if (markerSpec.coordinateType === 'polar' || doPolarProcess) {\n return 'polar';\n } else if (markerSpec.coordinateType === 'geo' || doGeoProcess) {\n return 'geo';\n }\n return 'cartesian';\n }\n\n protected _createMarkerComponent() {\n const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;\n const {\n type = 'text',\n\n // 老写法\n text: label,\n symbol,\n image,\n richText,\n customMark,\n textStyle,\n symbolStyle,\n imageStyle,\n richTextStyle,\n customMarkStyle,\n\n // 新写法\n style = {},\n state = {},\n\n ...restItemContent\n } = itemContent as any;\n\n let itemContentState = null;\n let itemContentStyle = null;\n let defaultStyle = {};\n\n if (type === 'text') {\n itemContentState = label?.state ?? state;\n defaultStyle = {\n dx: 0,\n dy: 0\n };\n itemContentStyle = transformLabelAttributes(\n {\n ...label,\n style: merge(\n defaultStyle,\n label?.style ?? label?.textStyle ?? textStyle ?? (style as Pick<IMarkerLabelSpec, 'style'>)\n )\n },\n this._markerData,\n this._markAttributeContext\n );\n } else if ((type as any) === 'richText') {\n itemContentState = richText?.state ?? state;\n defaultStyle = {\n width: 100,\n height: 100\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, richText?.style ?? richTextStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'symbol') {\n itemContentState = symbol?.state ?? state;\n defaultStyle = {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n };\n itemContentStyle = transformToGraphic(\n transformStyle(\n merge(defaultStyle, symbol?.style ?? symbolStyle ?? style),\n this._markerData,\n this._markAttributeContext\n )\n );\n } else if (type === 'image') {\n itemContentState = image?.state ?? state;\n defaultStyle = {\n width: 80,\n height: 80\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, image?.style ?? imageStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'custom') {\n itemContentState = customMark?.state ?? state;\n itemContentStyle = transformStyle(\n customMark?.style ?? customMarkStyle ?? style,\n this._markerData,\n this._markAttributeContext\n );\n }\n const markPointAttrs: MarkPointAttrs = {\n zIndex: this.layoutZIndex,\n interactive: this._spec.interactive ?? true,\n hover: this._spec.interactive ?? true,\n select: this._spec.interactive ?? true,\n position: { x: 0, y: 0 },\n clipInRange: this._spec.clip ?? false,\n itemContent: {\n type,\n offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n ...restItemContent, // Tips: 因为网站 demo 上已经透出了 imageStyle richTextStyle 的写法,为了兼容所以这个需要在后面覆盖\n style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)\n },\n targetSymbol: {\n offset: targetSymbol.offset ?? 0,\n visible: targetSymbol.visible ?? false,\n size: targetSymbol.size ?? 20,\n style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)\n },\n state: {\n line: transformState(this._spec.itemLine.line?.state ?? {}, this._markerData, this._markAttributeContext),\n lineStartSymbol: transformState(\n this._spec.itemLine.startSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n lineEndSymbol: transformState(\n this._spec.itemLine.endSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),\n textBackground: transformState(\n this._spec.itemContent.text?.labelBackground?.state,\n this._markerData,\n this._markAttributeContext\n ),\n targetItem: transformState(this._spec.targetSymbol?.state ?? {}, this._markerData, this._markAttributeContext)\n },\n animation: this._spec.animation ?? false,\n animationEnter: this._spec.animationEnter,\n animationExit: this._spec.animationExit,\n animationUpdate: this._spec.animationUpdate\n };\n\n const { visible, line = {}, ...restItemLine } = itemLine;\n if (visible !== false) {\n markPointAttrs.itemLine = {\n ...restItemLine,\n visible: true,\n lineStyle: transformToGraphic(line.style)\n } as any;\n } else {\n markPointAttrs.itemLine = {\n visible: false\n };\n }\n\n const markPoint = new MarkPointComponent(markPointAttrs);\n return markPoint as unknown as IGroup;\n }\n\n protected _markerLayout() {\n const spec = this._spec;\n const data = this._markerData;\n const relativeSeries = this._relativeSeries;\n\n const { point } = this._computePointsAttr();\n\n const seriesData = this._getRelativeDataView().latestData;\n const dataPoints = data\n ? data.latestData[0] && data.latestData[0].latestData\n ? data.latestData[0].latestData\n : data.latestData\n : seriesData;\n\n let limitRect;\n if (spec.clip || spec.itemContent?.confine) {\n const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);\n limitRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }\n if (this._markerComponent) {\n const attribute = this._markerComponent.attribute ?? {};\n const textStyle = (attribute.itemContent as any)?.textStyle ?? {};\n this._markerComponent.setAttributes({\n position: point === undefined ? { x: null, y: null } : point, // setAttrs时merge时undefined会被忽略, 所以这里做转换\n itemContent: {\n ...attribute.itemContent,\n textStyle: {\n ...textStyle,\n text: this._spec.itemContent.text?.formatMethod\n ? // type error here will be fixed in components\n (this._spec.itemContent.text.formatMethod(dataPoints, seriesData) as any)\n : textStyle.text\n },\n offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())\n } as any,\n limitRect,\n dx: this._layoutOffsetX,\n dy: this._layoutOffsetY\n });\n }\n }\n\n protected _initDataView(): void {\n const spec = this._spec as any;\n const { doXYProcess, doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(spec);\n const isCoordinateProcess = isValid(spec.coordinate);\n if (!isCoordinateProcess && !doXYProcess && !doPolarProcess && !doGeoProcess) {\n return;\n }\n\n this._initCommonDataView();\n }\n}\n"]}
|
package/esm/component/util.js
CHANGED
package/esm/constant/gradient.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export const SCROLL_BAR_DEFAULT_SIZE = 12;
|
|
1
|
+
export const SCROLL_BAR_DEFAULT_SIZE = 12;
|
|
2
|
+
//# sourceMappingURL=scroll-bar.js.map
|
package/esm/constant/sunburst.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const SUNBURST_AUTO_VISIBLE_DEFAULT_THRESHOLD = 10;
|
|
2
|
-
//# sourceMappingURL=sunburst.js.map
|
|
2
|
+
//# sourceMappingURL=sunburst.js.map
|
|
@@ -13,4 +13,4 @@ export const WORDCLOUD_DATA_TOTAL = `${PREFIX}_WORDCLOUD_DATA_TOTAL`;
|
|
|
13
13
|
export const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
14
14
|
|
|
15
15
|
export const WORDCLOUD_SHAPE_DATA_TOTAL = `${PREFIX}_WORDCLOUD_SHAPE_DATA_TOTAL`;
|
|
16
|
-
//# sourceMappingURL=word-cloud.js.map
|
|
16
|
+
//# sourceMappingURL=word-cloud.js.map
|
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 = "2.0.
|
|
4
|
+
export declare const version = "2.0.16";
|
|
5
5
|
export type { IVChart } from './interface';
|
|
6
6
|
export type { IStateSpec, StateValueType } from '../compile/mark';
|
|
7
7
|
export type { IRegion } from '../region/interface';
|
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,QAAQ,CAAC;AAOhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,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 = \"2.0.
|
|
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,QAAQ,CAAC;AAOhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,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 = \"2.0.16\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
|
package/esm/core/interface.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=interface.js.map
|
|
2
|
+
//# sourceMappingURL=interface.js.map
|
package/esm/core/util.js
CHANGED
package/esm/core/vchart.js
CHANGED
|
@@ -1019,4 +1019,4 @@ export const registerVChartCore = () => {
|
|
|
1019
1019
|
Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
|
|
1020
1020
|
registerGroupMark(), registerGesturePlugin(), registerElementHighlight(), registerElementSelect(),
|
|
1021
1021
|
registerTheme(darkTheme.name, darkTheme);
|
|
1022
|
-
//# sourceMappingURL=vchart.js.map
|
|
1022
|
+
//# sourceMappingURL=vchart.js.map
|
|
@@ -27,6 +27,7 @@ export declare class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IB
|
|
|
27
27
|
protected _isWordCloudShape: boolean;
|
|
28
28
|
protected _wordCloudConfig?: WordCloudConfigType;
|
|
29
29
|
protected _wordCloudShapeConfig?: WordCloudShapeConfigType;
|
|
30
|
+
private _wordMeasureCache?;
|
|
30
31
|
protected _padding?: IPadding;
|
|
31
32
|
protected _defaultFontFamily: string;
|
|
32
33
|
protected _keyWordColorCallback: (datum: Datum) => string;
|
|
@@ -64,4 +65,5 @@ export declare class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IB
|
|
|
64
65
|
onLayoutEnd(): void;
|
|
65
66
|
getActiveMarks(): IMark[];
|
|
66
67
|
reInit(): void;
|
|
68
|
+
release(): void;
|
|
67
69
|
}
|
|
@@ -10,6 +10,8 @@ import { isTrueBrowser } from "../../util/env";
|
|
|
10
10
|
|
|
11
11
|
import { DEFAULT_DRAW_OUT_OF_BOUND, DEFAULT_FONTSIZE_RANGE, DEFAULT_FONT_PADDING, DEFAULT_FONT_WEIGHT_RANGE, DEFAULT_MASK_SHAPE, DEFAULT_MIN_FONT_SIZE, DEFAULT_RANDOM, DEFAULT_ROTATE_ANGLES, DEFAULT_ZOOM_TO_FIT, SHAPE_TYPE } from "./config";
|
|
12
12
|
|
|
13
|
+
import { WordMeasureCache } from "./measure-cache";
|
|
14
|
+
|
|
13
15
|
import { animationConfig, userAnimationConfig } from "../../animation/utils";
|
|
14
16
|
|
|
15
17
|
import { WORD_CLOUD_TEXT } from "../../constant/word-cloud";
|
|
@@ -70,12 +72,14 @@ export class BaseWordCloudSeries extends BaseSeries {
|
|
|
70
72
|
fillingRotateAngles: DEFAULT_ROTATE_ANGLES,
|
|
71
73
|
layoutMode: "default"
|
|
72
74
|
}, this._spec.wordCloudShapeConfig), this._isWordCloudShape = !SHAPE_TYPE.includes(this._maskShape) && ![ "fast", "grid", "cloud" ].includes(this._wordCloudConfig.layoutMode),
|
|
73
|
-
this._defaultFontFamily = this._option.getTheme("fontFamily");
|
|
75
|
+
this._defaultFontFamily = this._option.getTheme("fontFamily"), this._wordMeasureCache || (this._wordMeasureCache = new WordMeasureCache(1e3));
|
|
74
76
|
}
|
|
75
77
|
initData() {
|
|
76
78
|
var _a, _b;
|
|
77
79
|
super.initData(), null === (_b = null === (_a = this.getViewData()) || void 0 === _a ? void 0 : _a.target) || void 0 === _b || _b.addListener("change", (() => {
|
|
78
|
-
|
|
80
|
+
var _a;
|
|
81
|
+
null === (_a = this._wordMeasureCache) || void 0 === _a || _a.clear(), this._dataChange = !0,
|
|
82
|
+
this.compile();
|
|
79
83
|
}));
|
|
80
84
|
}
|
|
81
85
|
initMark() {
|
|
@@ -232,6 +236,7 @@ export class BaseWordCloudSeries extends BaseSeries {
|
|
|
232
236
|
const fillingWordStyleSpec = null !== (_b = null === (_a = this._spec.fillingWord) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, wordCloudShapeConfig = null !== (_c = this._wordCloudShapeConfig) && void 0 !== _c ? _c : {};
|
|
233
237
|
return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), {
|
|
234
238
|
createImage: createImage,
|
|
239
|
+
measureCache: this._wordMeasureCache,
|
|
235
240
|
rotateList: this._rotateAngles,
|
|
236
241
|
fillingRotateList: wordCloudShapeConfig.fillingRotateAngles,
|
|
237
242
|
fillingFontFamily: isValid(wordCloudShapeConfig.fillingFontFamilyField) ? {
|
|
@@ -287,8 +292,14 @@ export class BaseWordCloudSeries extends BaseSeries {
|
|
|
287
292
|
return [ this._wordMark ];
|
|
288
293
|
}
|
|
289
294
|
reInit() {
|
|
295
|
+
var _a;
|
|
290
296
|
super.reInit(), this._keyWordColorCallback && (this._keyWordColorCallback = null),
|
|
291
|
-
this._fillingColorCallback && (this._fillingColorCallback = null);
|
|
297
|
+
this._fillingColorCallback && (this._fillingColorCallback = null), null === (_a = this._wordMeasureCache) || void 0 === _a || _a.clear();
|
|
298
|
+
}
|
|
299
|
+
release() {
|
|
300
|
+
var _a;
|
|
301
|
+
super.release(), null === (_a = this._wordMeasureCache) || void 0 === _a || _a.clear(),
|
|
302
|
+
this._wordMeasureCache = void 0;
|
|
292
303
|
}
|
|
293
304
|
}
|
|
294
305
|
|