@visactor/vrender-components 1.0.27-alpha.0 → 1.0.27

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/tick-data/discrete/polar-angle.ts"],"names":[],"mappings":";;;AACA,6CAA8F;AAE9F,kCAA8E;AAC9E,6CAA8C;AAC9C,6CAAqD;AACrD,qCAAwD;AAEjD,MAAM,wBAAwB,GAAG,CAAC,KAAiB,EAAE,MAAa,EAAE,EAAqB,EAAgB,EAAE;;IAChH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,EAAI,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAA,UAAU,CAAC,KAAK,mCAAI,CAAC,CAAC;IAEzC,MAAM,WAAW,GAAG,IAAA,sBAAe,EAAC,UAAU,CAAC,CAAC;IAChD,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;QAC5C,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAGxD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,mBAAY,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAY,CAAC,CAAC;QAGlD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE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I,IAAA,mBAAY,EAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE;YACxE,QAAQ,EAAE,CAAC;YACX,GAAG,IAAI,IAAI,CAAC;SACb;KACF;IAED,OAAO;QACL,IAAI;QACJ,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC","file":"polar-angle.js","sourcesContent":["import type { BandScale, IBaseScale } from '@visactor/vscale';\nimport { isFunction, isValid, maxInArray, minInArray, isNumberClose } from '@visactor/vutils';\nimport type { IPolarTickDataOpt, ITickCallbackOption, ITickData } from '../../type';\nimport { MIN_TICK_GAP, convertDomainToTickData, labelOverlap } from '../util';\nimport { AABBBounds } from '@visactor/vutils';\nimport { initTextMeasure } from '../../../util/text';\nimport { getPolarAngleLabelPosition } from '../../util';\n\nexport const getPolarAngleLabelBounds = (scale: IBaseScale, domain: any[], op: IPolarTickDataOpt): AABBBounds[] => {\n const { labelStyle, getRadius, labelOffset, labelFormatter, inside } = op;\n const radius = getRadius?.();\n const labelAngle = labelStyle.angle ?? 0;\n\n const textMeasure = initTextMeasure(labelStyle);\n const labelBoundsList = domain.map((v: any) => {\n const str = labelFormatter ? labelFormatter(v) : `${v}`;\n\n // 估算文本宽高\n const { width, height } = textMeasure.quickMeasure(str);\n const textWidth = Math.max(width, MIN_TICK_GAP);\n const textHeight = Math.max(height, MIN_TICK_GAP);\n\n // 估算文本位置\n const angle = scale.scale(v);\n const center = { x: 0, y: 0 };\n let textX = 0;\n let textY = 0;\n const orient = {\n align: labelStyle.textAlign,\n baseline: labelStyle.textBaseline\n };\n\n const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);\n\n if (!orient.align) {\n if (isNumberClose(x, center.x)) {\n if (!orient.baseline) {\n if (y > center.y) {\n orient.baseline = 'top';\n } else {\n orient.baseline = 'bottom';\n }\n }\n } else if (x > center.x) {\n orient.align = 'left';\n } else if (x < center.x) {\n orient.align = 'right';\n }\n }\n\n textX = x + (orient.align === 'right' ? -textWidth : orient.align === 'left' ? 0 : -textWidth / 2);\n textY = y + (orient.baseline === 'bottom' ? -textHeight : orient.baseline === 'top' ? 0 : -textHeight / 2);\n\n // 计算 label 包围盒\n const bounds = new AABBBounds()\n .set(textX, textY, textX + textWidth, textY + textHeight)\n .rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);\n return bounds;\n });\n\n return labelBoundsList;\n};\n/**\n * 对于离散轴:\n * - 如果spec配了tickCount、forceTickCount、tickStep,则直接输出BandScale的ticks()、forceTicks()、stepTicks()结果;\n * - 估算所有轴label的宽高并存为数组labelBoundsList;\n * - 通过循环来寻找最小的step,使:如果在这个step下采样,轴标签互不遮挡(此处用到labelBoundsList和scale.range());\n *\n * @param scale\n * @param op\n * @returns\n */\nexport const polarAngleAxisDiscreteTicks = (scale: BandScale, op: IPolarTickDataOpt): ITickData[] => {\n const { tickCount, forceTickCount, tickStep, getRadius, labelOffset, labelGap = 0, labelStyle } = op;\n const radius = getRadius?.();\n if (!radius) {\n return convertDomainToTickData(scale.domain());\n }\n\n let scaleTicks;\n if (isValid(tickStep)) {\n scaleTicks = scale.stepTicks(tickStep);\n } else if (isValid(forceTickCount)) {\n scaleTicks = scale.forceTicks(forceTickCount);\n } else if (isValid(tickCount)) {\n const range = scale.range();\n const rangeSize = Math.abs(range[range.length - 1] - range[0]);\n const count = isFunction(tickCount)\n ? (tickCount as (option: ITickCallbackOption) => number)({ axisLength: rangeSize, labelStyle })\n : tickCount;\n scaleTicks = scale.ticks(count);\n } else if (op.sampling) {\n const domain = scale.domain();\n const range = scale.range();\n\n const labelBoundsList = getPolarAngleLabelBounds(scale, domain, op);\n\n const rangeStart = minInArray(range);\n const rangeEnd = maxInArray(range);\n\n const axisLength = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset);\n const incrementUnit = axisLength / domain.length;\n const { step, delCount } = getStep(\n domain,\n labelBoundsList,\n labelGap,\n Math.floor(\n labelBoundsList.reduce((min, curBounds) => {\n return Math.min(min, curBounds.width(), curBounds.height());\n }, Number.MAX_VALUE) / incrementUnit\n ) // 给step赋上合适的初值,有效改善外层循环次数\n );\n\n scaleTicks = (scale as BandScale).stepTicks(step);\n scaleTicks = scaleTicks.slice(0, scaleTicks.length - delCount);\n } else {\n scaleTicks = scale.domain();\n }\n\n return convertDomainToTickData(scaleTicks);\n};\n\n/** 计算合适的step */\nconst getStep = (domain: any[], labelBoundsList: AABBBounds[], labelGap: number, defaultStep: number) => {\n let step = defaultStep;\n // 通过循环来寻找最小的step,使:如果在这个step下采样,轴标签互不遮挡\n do {\n let success = true;\n step++;\n let ptr = 0;\n do {\n if (ptr + step < domain.length && labelOverlap(labelBoundsList[ptr], labelBoundsList[ptr + step], labelGap)) {\n success = false;\n }\n ptr += step;\n } while (success && ptr < domain.length);\n if (success) {\n break;\n }\n } while (step <= domain.length);\n\n let delCount = 0;\n if (domain.length > 2) {\n let ptr = domain.length - (domain.length % step);\n if (ptr >= domain.length) {\n ptr -= step;\n }\n // 判断首尾是否互相覆盖\n while (ptr > 0 && labelOverlap(labelBoundsList[0], labelBoundsList[ptr])) {\n delCount++;\n ptr -= step;\n }\n }\n\n return {\n step,\n delCount\n };\n};\n"]}
1
+ {"version":3,"sources":["../src/axis/tick-data/discrete/polar-angle.ts"],"names":[],"mappings":";;;AACA,6CAA8F;AAE9F,kCAA8E;AAC9E,6CAA8C;AAC9C,6CAAqD;AACrD,qCAAwD;AAEjD,MAAM,wBAAwB,GAAG,CAAC,KAAiB,EAAE,MAAa,EAAE,EAAqB,EAAgB,EAAE;;IAChH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,EAAI,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAA,UAAU,CAAC,KAAK,mCAAI,CAAC,CAAC;IAEzC,MAAM,WAAW,GAAG,IAAA,sBAAe,EAA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IAAI,IAAA,mBAAY,EAAC,eAAe,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,QAAQ,CAAC,EAAE;gBAC3G,OAAO,GAAG,KAAK,CAAC;aACjB;YACD,GAAG,IAAI,IAAI,CAAC;SACb,QAAQ,OAAO,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE;QACzC,IAAI,OAAO,EAAE;YACX,MAAM;SACP;KACF,QAAQ,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE;IAEhC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;YACxB,GAAG,IAAI,IAAI,CAAC;SACb;QAED,OAAO,GAAG,GAAG,CAAC,IAAI,IAAA,mBAAY,EAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE;YACxE,QAAQ,EAAE,CAAC;YACX,GAAG,IAAI,IAAI,CAAC;SACb;KACF;IAED,OAAO;QACL,IAAI;QACJ,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC","file":"polar-angle.js","sourcesContent":["import type { BandScale, IBaseScale } from '@visactor/vscale';\nimport { isFunction, isValid, maxInArray, minInArray, isNumberClose } from '@visactor/vutils';\nimport type { IPolarTickDataOpt, ITickCallbackOption, ITickData } from '../../type';\nimport { MIN_TICK_GAP, convertDomainToTickData, labelOverlap } from '../util';\nimport { AABBBounds } from '@visactor/vutils';\nimport { initTextMeasure } from '../../../util/text';\nimport { getPolarAngleLabelPosition } from '../../util';\n\nexport const getPolarAngleLabelBounds = (scale: IBaseScale, domain: any[], op: IPolarTickDataOpt): AABBBounds[] => {\n const { labelStyle, getRadius, labelOffset, labelFormatter, inside } = op;\n const radius = getRadius?.();\n const labelAngle = labelStyle.angle ?? 0;\n\n const textMeasure = initTextMeasure(labelStyle);\n const labelBoundsList = domain.map((v: any) => {\n const str = labelFormatter ? labelFormatter(v) : `${v}`;\n\n // 估算文本宽高\n const { width, height } = textMeasure.quickMeasure(str);\n const textWidth = Math.max(width, MIN_TICK_GAP);\n const textHeight = Math.max(height, MIN_TICK_GAP);\n\n // 估算文本位置\n const angle = scale.scale(v);\n const center = { x: 0, y: 0 };\n let textX = 0;\n let textY = 0;\n const orient = {\n align: labelStyle.textAlign,\n baseline: labelStyle.textBaseline\n };\n\n const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);\n\n if (!orient.align) {\n if (isNumberClose(x, center.x)) {\n if (!orient.baseline) {\n if (y > center.y) {\n orient.baseline = 'top';\n } else {\n orient.baseline = 'bottom';\n }\n }\n } else if (x > center.x) {\n orient.align = 'left';\n } else if (x < center.x) {\n orient.align = 'right';\n }\n }\n\n textX = x + (orient.align === 'right' ? -textWidth : orient.align === 'left' ? 0 : -textWidth / 2);\n textY = y + (orient.baseline === 'bottom' ? -textHeight : orient.baseline === 'top' ? 0 : -textHeight / 2);\n\n // 计算 label 包围盒\n const bounds = new AABBBounds()\n .set(textX, textY, textX + textWidth, textY + textHeight)\n .rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);\n return bounds;\n });\n\n return labelBoundsList;\n};\n/**\n * 对于离散轴:\n * - 如果spec配了tickCount、forceTickCount、tickStep,则直接输出BandScale的ticks()、forceTicks()、stepTicks()结果;\n * - 估算所有轴label的宽高并存为数组labelBoundsList;\n * - 通过循环来寻找最小的step,使:如果在这个step下采样,轴标签互不遮挡(此处用到labelBoundsList和scale.range());\n *\n * @param scale\n * @param op\n * @returns\n */\nexport const polarAngleAxisDiscreteTicks = (scale: BandScale, op: IPolarTickDataOpt): ITickData[] => {\n const { tickCount, forceTickCount, tickStep, getRadius, labelOffset, labelGap = 0, labelStyle } = op;\n const radius = getRadius?.();\n if (!radius || radius <= 0) {\n return convertDomainToTickData(scale.domain());\n }\n\n let scaleTicks;\n if (isValid(tickStep)) {\n scaleTicks = scale.stepTicks(tickStep);\n } else if (isValid(forceTickCount)) {\n scaleTicks = scale.forceTicks(forceTickCount);\n } else if (isValid(tickCount)) {\n const range = scale.range();\n const rangeSize = Math.abs(range[range.length - 1] - range[0]);\n const count = isFunction(tickCount)\n ? (tickCount as (option: ITickCallbackOption) => number)({ axisLength: rangeSize, labelStyle })\n : tickCount;\n scaleTicks = scale.ticks(count);\n } else if (op.sampling) {\n const domain = scale.domain();\n const range = scale.range();\n\n const labelBoundsList = getPolarAngleLabelBounds(scale, domain, op);\n\n const rangeStart = minInArray(range);\n const rangeEnd = maxInArray(range);\n\n const axisLength = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset);\n const incrementUnit = axisLength / domain.length;\n const { step, delCount } = getStep(\n domain,\n labelBoundsList,\n labelGap,\n Math.floor(\n labelBoundsList.reduce((min, curBounds) => {\n return Math.min(min, curBounds.width(), curBounds.height());\n }, Number.MAX_VALUE) / incrementUnit\n ) // 给step赋上合适的初值,有效改善外层循环次数\n );\n\n scaleTicks = (scale as BandScale).stepTicks(step);\n scaleTicks = scaleTicks.slice(0, scaleTicks.length - delCount);\n } else {\n scaleTicks = scale.domain();\n }\n\n return convertDomainToTickData(scaleTicks);\n};\n\n/** 计算合适的step */\nconst getStep = (domain: any[], labelBoundsList: AABBBounds[], labelGap: number, defaultStep: number) => {\n let step = defaultStep;\n // 通过循环来寻找最小的step,使:如果在这个step下采样,轴标签互不遮挡\n do {\n let success = true;\n step++;\n let ptr = 0;\n do {\n if (ptr + step < domain.length && labelOverlap(labelBoundsList[ptr], labelBoundsList[ptr + step], labelGap)) {\n success = false;\n }\n ptr += step;\n } while (success && ptr < domain.length);\n if (success) {\n break;\n }\n } while (step <= domain.length);\n\n let delCount = 0;\n if (domain.length > 2) {\n let ptr = domain.length - (domain.length % step);\n if (ptr >= domain.length) {\n ptr -= step;\n }\n // 判断首尾是否互相覆盖\n while (ptr > 0 && labelOverlap(labelBoundsList[0], labelBoundsList[ptr])) {\n delCount++;\n ptr -= step;\n }\n }\n\n return {\n step,\n delCount\n };\n};\n"]}
@@ -42,7 +42,6 @@ export interface AxisBaseAttributes extends IGroupGraphicAttribute {
42
42
  items: AxisItem[][];
43
43
  title?: TitleAttributes;
44
44
  label?: LabelAttributes;
45
- labelHoverOnAxis?: LabelHoverOnAxisAttributes;
46
45
  tick?: TickAttributes;
47
46
  subTick?: SubTickAttributes;
48
47
  line?: LineAttributes;
@@ -164,17 +163,6 @@ export type LabelAttributes = Omit<AxisLabelOverlap, 'text'> & TextContent & {
164
163
  state?: AxisItemStateStyle<Partial<ITextGraphicAttribute> | callbackFunc<Partial<ITextGraphicAttribute> | undefined>>;
165
164
  dataFilter?: (data: AxisItem[], layer: number) => AxisItem[];
166
165
  };
167
- export type LabelHoverOnAxisAttributes = Omit<TagAttributes, 'shape' | 'space' | 'panel' | 'state'> & {
168
- visible?: boolean;
169
- space?: number;
170
- position?: number;
171
- autoRotate?: boolean;
172
- background?: {
173
- visible?: boolean;
174
- style?: Omit<Partial<IRectGraphicAttribute>, 'visible' | 'width' | 'height'>;
175
- };
176
- formatMethod?: (value: string) => string;
177
- };
178
166
  export type CoordinateType = 'cartesian' | 'polar' | 'geo' | 'none';
179
167
  export type IOrientType = 'left' | 'top' | 'right' | 'bottom' | 'z';
180
168
  export type IPolarOrientType = 'radius' | 'angle';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n ILineGraphicAttribute,\n ITextGraphicAttribute,\n ISymbolGraphicAttribute,\n IRectGraphicAttribute,\n IGroupGraphicAttribute,\n IText,\n IGroup,\n IGraphic\n} from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport type { ContinuousScale, CustomTicksFunc } from '@visactor/vscale';\nimport type { Point, TextContent } from '../core/type';\nimport type { SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\n\nexport type AxisItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n};\n\nexport type callbackFunc<T> = (datum: Dict<any>, index: number, data?: Dict<any>[], layer?: number) => T;\n\n// 处理过的用于绘制的 tickLine 数据\nexport type TickLineItem = {\n start: Point;\n end: Point;\n /** 归一化后的数据 */\n value: number;\n // 3d数据\n anchor?: [number, number];\n alpha?: number;\n beta?: number;\n [key: string]: any;\n};\n\n// 处理过的用于绘制的数据\nexport type TransformedAxisItem = AxisItem & {\n point: Point;\n};\n\nexport type AxisItem = {\n /** 标识符,用于动画以及图形查找 */\n id?: string | number;\n /** 显示文本 */\n label: string | number;\n /** 归一化后的数据 */\n value: number;\n /** 对应原始数据 */\n rawValue: any;\n [key: string]: any;\n};\n\nexport interface AxisBaseAttributes extends IGroupGraphicAttribute {\n /**\n * 是否开启动画\n * @default false\n */\n animation?: boolean;\n /**\n * 标签入场动画配置\n */\n animationEnter?: boolean;\n /**\n * 标签更新动画配置\n */\n animationUpdate?: boolean;\n /**\n * 标签离场动画配置\n */\n animationExit?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 垂直于坐标轴方向的因子,默认为 1\n */\n verticalFactor?: number;\n /**\n * 坐标轴的显示位置,用于文本的防重叠处理\n */\n orient?: string;\n /** 坐标轴数据 */\n items: AxisItem[][];\n /**\n * 轴标题配置\n */\n title?: TitleAttributes;\n /**\n * 轴标签配置\n */\n label?: LabelAttributes;\n /**\n * 轴上悬浮label标签配置\n */\n labelHoverOnAxis?: LabelHoverOnAxisAttributes;\n /**\n * 轴刻度线配置\n */\n tick?: TickAttributes;\n /**\n * 自刻度线配置\n */\n subTick?: SubTickAttributes;\n /**\n * 轴线配置\n */\n line?: LineAttributes;\n /**\n * 关闭交互效果\n * @default false\n */\n disableTriggerEvent?: boolean;\n}\n\nexport interface ILine3dType {\n alpha: number;\n anchor3d?: [number, number];\n}\n\nexport interface BreakSymbol {\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 截断图形旋转的弧度。\n */\n angle?: number;\n\n /**\n * 样式配置\n */\n style?: Partial<ISymbolGraphicAttribute>;\n}\nexport interface AxisBreakProps {\n /**\n * 轴截断的范围,值为归一化后的数据\n */\n range: [number, number];\n /**\n * 截断图形配置\n */\n breakSymbol?: BreakSymbol;\n /**\n * 轴截断原始的数据范围\n */\n rawRange?: [number, number];\n}\n\nexport interface TransformedAxisBreak extends AxisBreakProps {\n /**\n * 截断的起始点\n */\n startPoint: Point;\n /**\n * 截断的结束点\n */\n endPoint: Point;\n}\n\nexport interface LineAxisAttributes extends Omit<AxisBaseAttributes, 'label'> {\n /**\n * 起始点坐标\n */\n start: Point;\n /**\n * 结束点坐标\n */\n end: Point;\n /**\n * 坐标轴垂直方向的限制空间,该配置会影响文本的显示,\n * 即如果超出,文本则会进行自动旋转、自动隐藏等动作。\n */\n verticalLimitSize?: number;\n /**\n * 坐标轴垂直方向的最小空间,如果小于该值,则以该值占据显示空间。\n * 如果同时声明了 verticalLimitSize,请保证 verticalMinSize <= verticalLimitSize,否则会以 verticalLimitSize 为准。\n */\n verticalMinSize?: number;\n\n /**\n * 轴标签配置\n */\n label?: LabelAttributes & {\n /**\n * label 相对于容器整体的对齐方式\n * - `top`:整体向上对齐(垂直方向)\n * - `middle`:整体居中对齐(垂直方向)\n * - `bottom`:整体向下对齐(垂直方向)\n * - `left`:整体向左对齐(水平方向)\n * - `center`:整体居中对齐(水平方向)\n * - `right`:整体向右对齐(水平方向)\n */\n containerAlign?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n /**\n * 坐标轴首尾文字向内收缩\n * @default false\n */\n flush?: boolean;\n /**\n * 保证最后的label必须展示\n * @default false\n * @since 0.17.10\n */\n lastVisible?: boolean;\n /**\n * 保证第一个的label必须展示\n * @default false\n * @since 0.20.7\n */\n firstVisible?: boolean;\n };\n /**\n * 坐标轴背景配置\n */\n panel?: {\n /**\n * 是否绘制坐标轴背景\n */\n visible?: boolean;\n /**\n * 坐标轴背景配置\n */\n style?: Partial<IRectGraphicAttribute>;\n /**\n * 坐标轴背景交互状态样式配置\n */\n state?: AxisItemStateStyle<Partial<IRectGraphicAttribute>>;\n };\n\n /**\n * 轴截断配置\n * @since 0.20.3\n */\n breaks?: AxisBreakProps[];\n}\n\nexport interface CircleAxisAttributes extends AxisBaseAttributes {\n /**\n * 坐标轴可用布局区域的大小,之前是通过width,height传入,会影响组件的Bounds大小,影响拾取\n * @since 0.20.11\n */\n size?: { width: number; height: number };\n /**\n * 当配置了 innerRadius 时,可以通过设置 inside: true,将坐标轴战士在内圆半径上。\n * @default false\n */\n inside?: boolean;\n /**\n * 圆心坐标\n */\n center: Point;\n /**\n * **弧度值**,起始弧度,默认 -0.5 * Math.PI\n *\n */\n startAngle?: number;\n /**\n * **弧度值**,结束弧度,默认 1.5 * Math.PI\n */\n endAngle?: number;\n /**\n * 半径\n */\n radius: number;\n /** 内半径 */\n innerRadius?: number;\n /**\n * 边数\n * @since 0.19.24\n */\n sides?: number;\n}\n\n// 坐标轴标题配置\nexport type TitleAttributes = Omit<TagAttributes, 'shape' | 'space' | 'panel' | 'state'> & {\n /**\n * 是否展示标题\n */\n visible?: boolean;\n /**\n * 标题的显示位置,默认 'middle'\n */\n position?: 'start' | 'middle' | 'end';\n /**\n * 标题距离坐标轴(轴线、刻度、标签共同构成的包围盒)的距离\n */\n space?: number;\n /**\n * 标题是否自动旋转以和坐标轴平行\n */\n autoRotate?: boolean;\n shape?: {\n /**\n * 是否展示 shape\n */\n visible?: boolean;\n /**\n * shape 同 文本的间距\n */\n space?: number;\n style?: Omit<Partial<ISymbolGraphicAttribute>, 'visible'>;\n };\n /**\n * 背景设置\n */\n background?: {\n /**\n * 是否绘制背景层\n */\n visible?: boolean;\n /**\n * 背景层样式\n */\n style?: Omit<Partial<IRectGraphicAttribute>, 'visible' | 'width' | 'height'>;\n };\n\n /**\n * 交互状态样式配置\n */\n state?: {\n /**\n * text 文本的状态配置\n */\n text?: AxisItemStateStyle<Partial<ITextGraphicAttribute>>;\n /**\n * shape 标记的状态配置\n */\n shape?: AxisItemStateStyle<Partial<ISymbolGraphicAttribute>>;\n /**\n * panel 背景的状态配置\n */\n background?: AxisItemStateStyle<Partial<IRectGraphicAttribute>>;\n };\n};\n// 坐标轴线配置\nexport interface LineAttributes extends Pick<SegmentAttributes, 'startSymbol' | 'endSymbol'> {\n /**\n * 是否展示轴线\n */\n visible?: boolean;\n /**\n * 线的样式配置\n */\n style?: Partial<ILineGraphicAttribute>;\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute>>;\n}\n\n// 轴刻度线配置\nexport interface TickAttributes {\n /** 是否显示轴刻度线 */\n visible: boolean;\n /**\n * 刻度线朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /**\n * tick 是否与 label 对齐\n * @default true\n */\n alignWithLabel?: boolean;\n /**\n * 刻度线的长度\n */\n length?: number;\n /**\n * 刻度线样式配置\n */\n style?: Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>;\n /**\n * 刻度线状态样式配置\n */\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>>;\n /**\n * 用于 tick 的数据过滤\n * @param data\n * @returns\n */\n dataFilter?: (data: AxisItem[]) => AxisItem[];\n}\n\n// 子轴刻度线配置\nexport interface SubTickAttributes {\n /** 是否显示子轴刻度线 */\n visible: boolean;\n /**\n * TODO: 考虑下 log 轴,自刻度线之间的间距是不均匀的问题\n * 子刻度个数\n */\n count?: number;\n /**\n * 子刻度线朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /**\n * 子刻度线的长度\n */\n length?: number;\n /**\n * 子刻度线样式配置\n */\n style?: Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>;\n /**\n * 子刻度线状态样式配置\n */\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>>;\n}\n\nexport type CustomMethod = (items: IText[], separation: number) => IText[];\n\nexport interface AxisLabelOverlap {\n /**\n * 自动旋转配置\n * @default false\n */\n autoRotate?: boolean;\n /**\n * 仅当 `autoRotate` 为 true 时生效,可选的旋转范围,默认为 [0, 45, 90]\n * @default [0, 45, 90]\n */\n autoRotateAngle?: number[];\n /**\n * 自动隐藏配置\n * @default false\n */\n autoHide?: boolean;\n /**\n * 防重叠策略,默认为 'parity'。\n * - 'parity': 奇偶校验,使用删除所有其他标签的策略(这对于标准线性轴非常有效)。\n * - 'greedy': 将执行标签的线性扫描,并删除与最后一个可见标签重叠的所有标签。\n * - 也可以传入函数用于自定义策略\n * @default 'parity'\n */\n autoHideMethod?: 'parity' | 'greedy' | CustomMethod;\n /**\n * 仅当 `autoHide` 为 true 时生效,设置文本之间的间隔距离,单位 px\n * @default 0\n */\n autoHideSeparation?: number;\n /**\n * 自动隐藏配置\n * @default false\n */\n autoLimit?: boolean;\n /**\n * 仅当 `autoLimit` 为 true 时生效,省略占位符,默认为 '...'\n * @default '...'\n */\n limitEllipsis?: string;\n /**\n * 文字超出坐标轴范围时,两侧可以提供扩充的空间大小。\n * 例如,x 轴坐标 135 度旋转时,左侧第一个标签可能超出坐标轴范围,导致文本被缩略,此时可以通过配置 `overflowLimitLength` 优化效果。\n * 仅当 `autoLimit` 为 true 时生效。\n * @default 0\n * @since 0.20.3 支持 X 轴配置生效\n */\n overflowLimitLength?:\n | number\n | {\n /**\n * 左侧扩充空间的大小\n */\n left?: number;\n /**\n * 右侧扩充空间的大小\n */\n right?: number;\n // top?: number;\n // bottom?: number;\n };\n\n /**\n * 自定义布局配置,如果声明了 `layoutFunc`,则默认提供的防重叠相关的配置(`autoHide`, `autoRotate`, `autoLimit`)均不生效\n * @param labels 标签图形元素\n * @param labelData 标签数据\n * @param layer 当前轴的层级\n * @param axis 当前轴组件实例\n * @returns void\n */\n layoutFunc?: (labels: IText[], labelData: AxisItem[], layer: number, axis: IGroup) => void;\n\n /**\n * 标签自动换行。与 `autoRotate` 不能同时生效,若开启了 `autoRotate`,则优先使用自动旋转策略。\n * @since 0.20.3\n * @default false\n */\n autoWrap?: boolean;\n}\n\nexport type LabelAttributes = Omit<AxisLabelOverlap, 'text'> &\n TextContent & {\n /** 是否展示标签 */\n visible: boolean;\n /**\n * 标签朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /** 标签同 tick 之间的间距 */\n space?: number;\n /**\n * 格式化文本回调\n * @param text 文本原始值\n * @param item 对应的图形元素\n * @param index 文本索引顺序\n * @returns 格式化文本\n */\n formatMethod?: (value: string, datum: Dict<any>, index: number, data?: Dict<any>[], layer?: number) => string;\n /**\n * 文本样式\n */\n style?: Partial<ITextGraphicAttribute> | callbackFunc<Partial<ITextGraphicAttribute> | undefined>;\n /**\n * 文本状态样式配置\n */\n state?: AxisItemStateStyle<\n Partial<ITextGraphicAttribute> | callbackFunc<Partial<ITextGraphicAttribute> | undefined>\n >;\n\n /**\n * 用于 label 的数据过滤\n * @param data\n * @param layer\n * @returns\n */\n dataFilter?: (data: AxisItem[], layer: number) => AxisItem[];\n };\n\nexport type LabelHoverOnAxisAttributes = Omit<TagAttributes, 'shape' | 'space' | 'panel' | 'state'> & {\n /**\n * 是否展示悬浮标签\n */\n visible?: boolean;\n /** 标签同 tick 之间的间距 */\n space?: number;\n /**\n * 悬浮标签的位置 ,与轴的方位有关系,如果是水平轴,则position代表x的位置,如果是垂直轴,则position代表y的位置\n */\n position?: number;\n /**\n * 是否自动旋转以和坐标轴平行\n */\n autoRotate?: boolean;\n /**\n * 背景设置\n */\n background?: {\n /**\n * 是否绘制背景层\n */\n visible?: boolean;\n /**\n * 背景层样式\n */\n style?: Omit<Partial<IRectGraphicAttribute>, 'visible' | 'width' | 'height'>;\n };\n /**\n * 格式化文本回调\n * @param value 文本原始值\n * @returns 格式化文本\n */\n formatMethod?: (value: string) => string;\n};\nexport type CoordinateType = 'cartesian' | 'polar' | 'geo' | 'none';\nexport type IOrientType = 'left' | 'top' | 'right' | 'bottom' | 'z';\nexport type IPolarOrientType = 'radius' | 'angle';\n\ntype breakData = {\n /**\n * 截断后的值域范围\n */\n domain?: [number, number][];\n /**\n * 截断后的归一化范围\n */\n scope?: [number, number][];\n /**\n * 用户配置的截断范围\n */\n breakDomains: [number, number][];\n};\n\nexport interface ITickDataOpt {\n /**\n * 是否进行轴采样\n */\n sampling?: boolean;\n tickCount?: number | ((option: ITickCallbackOption) => number);\n forceTickCount?: number;\n tickStep?: number;\n tickMode?: 'average' | 'd3' | string | CustomTicksFunc<ContinuousScale>;\n noDecimals?: boolean;\n\n coordinateType: CoordinateType;\n axisOrientType: IOrientType | IPolarOrientType;\n startAngle?: number;\n\n labelFormatter?: (value: any) => string;\n labelStyle: ITextGraphicAttribute;\n labelGap?: number;\n labelFirstVisible?: boolean;\n labelLastVisible?: boolean;\n /**\n * 截断数据范围配置\n */\n breakData?: () => breakData;\n}\n\nexport interface ICartesianTickDataOpt extends ITickDataOpt {\n axisOrientType: IOrientType;\n labelFlush: boolean;\n /**\n * 截断数据范围配置\n */\n breakData?: () => breakData;\n}\n\nexport interface IPolarTickDataOpt extends ITickDataOpt {\n axisOrientType: IPolarOrientType;\n getRadius: () => number;\n labelOffset: number;\n inside: boolean;\n}\n\nexport interface ITickData {\n index: number;\n value: number | string;\n // label: string;\n}\n\nexport type ITickCallbackOption = {\n /**\n * 坐标轴占据的画布大小。\n * 直角坐标系中为轴的宽度或高度。\n * 极坐标系中半径轴的长度。\n */\n axisLength?: number;\n /**\n * 轴标签的样式\n */\n labelStyle?: ITextGraphicAttribute;\n};\n\nexport interface ILabelItem<T> extends Pick<IGraphic, 'AABBBounds'> {\n value?: T;\n}\n"]}
1
+ {"version":3,"sources":["../src/axis/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n ILineGraphicAttribute,\n ITextGraphicAttribute,\n ISymbolGraphicAttribute,\n IRectGraphicAttribute,\n IGroupGraphicAttribute,\n IText,\n IGroup,\n IGraphic\n} from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport type { ContinuousScale, CustomTicksFunc } from '@visactor/vscale';\nimport type { Point, TextContent } from '../core/type';\nimport type { SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\n\nexport type AxisItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n};\n\nexport type callbackFunc<T> = (datum: Dict<any>, index: number, data?: Dict<any>[], layer?: number) => T;\n\n// 处理过的用于绘制的 tickLine 数据\nexport type TickLineItem = {\n start: Point;\n end: Point;\n /** 归一化后的数据 */\n value: number;\n // 3d数据\n anchor?: [number, number];\n alpha?: number;\n beta?: number;\n [key: string]: any;\n};\n\n// 处理过的用于绘制的数据\nexport type TransformedAxisItem = AxisItem & {\n point: Point;\n};\n\nexport type AxisItem = {\n /** 标识符,用于动画以及图形查找 */\n id?: string | number;\n /** 显示文本 */\n label: string | number;\n /** 归一化后的数据 */\n value: number;\n /** 对应原始数据 */\n rawValue: any;\n [key: string]: any;\n};\n\nexport interface AxisBaseAttributes extends IGroupGraphicAttribute {\n /**\n * 是否开启动画\n * @default false\n */\n animation?: boolean;\n /**\n * 标签入场动画配置\n */\n animationEnter?: boolean;\n /**\n * 标签更新动画配置\n */\n animationUpdate?: boolean;\n /**\n * 标签离场动画配置\n */\n animationExit?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 垂直于坐标轴方向的因子,默认为 1\n */\n verticalFactor?: number;\n /**\n * 坐标轴的显示位置,用于文本的防重叠处理\n */\n orient?: string;\n /** 坐标轴数据 */\n items: AxisItem[][];\n /**\n * 轴标题配置\n */\n title?: TitleAttributes;\n /**\n * 轴标签配置\n */\n label?: LabelAttributes;\n /**\n * 轴刻度线配置\n */\n tick?: TickAttributes;\n /**\n * 自刻度线配置\n */\n subTick?: SubTickAttributes;\n /**\n * 轴线配置\n */\n line?: LineAttributes;\n /**\n * 关闭交互效果\n * @default false\n */\n disableTriggerEvent?: boolean;\n}\n\nexport interface ILine3dType {\n alpha: number;\n anchor3d?: [number, number];\n}\n\nexport interface BreakSymbol {\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 截断图形旋转的弧度。\n */\n angle?: number;\n\n /**\n * 样式配置\n */\n style?: Partial<ISymbolGraphicAttribute>;\n}\nexport interface AxisBreakProps {\n /**\n * 轴截断的范围,值为归一化后的数据\n */\n range: [number, number];\n /**\n * 截断图形配置\n */\n breakSymbol?: BreakSymbol;\n /**\n * 轴截断原始的数据范围\n */\n rawRange?: [number, number];\n}\n\nexport interface TransformedAxisBreak extends AxisBreakProps {\n /**\n * 截断的起始点\n */\n startPoint: Point;\n /**\n * 截断的结束点\n */\n endPoint: Point;\n}\n\nexport interface LineAxisAttributes extends Omit<AxisBaseAttributes, 'label'> {\n /**\n * 起始点坐标\n */\n start: Point;\n /**\n * 结束点坐标\n */\n end: Point;\n /**\n * 坐标轴垂直方向的限制空间,该配置会影响文本的显示,\n * 即如果超出,文本则会进行自动旋转、自动隐藏等动作。\n */\n verticalLimitSize?: number;\n /**\n * 坐标轴垂直方向的最小空间,如果小于该值,则以该值占据显示空间。\n * 如果同时声明了 verticalLimitSize,请保证 verticalMinSize <= verticalLimitSize,否则会以 verticalLimitSize 为准。\n */\n verticalMinSize?: number;\n\n /**\n * 轴标签配置\n */\n label?: LabelAttributes & {\n /**\n * label 相对于容器整体的对齐方式\n * - `top`:整体向上对齐(垂直方向)\n * - `middle`:整体居中对齐(垂直方向)\n * - `bottom`:整体向下对齐(垂直方向)\n * - `left`:整体向左对齐(水平方向)\n * - `center`:整体居中对齐(水平方向)\n * - `right`:整体向右对齐(水平方向)\n */\n containerAlign?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n /**\n * 坐标轴首尾文字向内收缩\n * @default false\n */\n flush?: boolean;\n /**\n * 保证最后的label必须展示\n * @default false\n * @since 0.17.10\n */\n lastVisible?: boolean;\n /**\n * 保证第一个的label必须展示\n * @default false\n * @since 0.20.7\n */\n firstVisible?: boolean;\n };\n /**\n * 坐标轴背景配置\n */\n panel?: {\n /**\n * 是否绘制坐标轴背景\n */\n visible?: boolean;\n /**\n * 坐标轴背景配置\n */\n style?: Partial<IRectGraphicAttribute>;\n /**\n * 坐标轴背景交互状态样式配置\n */\n state?: AxisItemStateStyle<Partial<IRectGraphicAttribute>>;\n };\n\n /**\n * 轴截断配置\n * @since 0.20.3\n */\n breaks?: AxisBreakProps[];\n}\n\nexport interface CircleAxisAttributes extends AxisBaseAttributes {\n /**\n * 坐标轴可用布局区域的大小,之前是通过width,height传入,会影响组件的Bounds大小,影响拾取\n * @since 0.20.11\n */\n size?: { width: number; height: number };\n /**\n * 当配置了 innerRadius 时,可以通过设置 inside: true,将坐标轴战士在内圆半径上。\n * @default false\n */\n inside?: boolean;\n /**\n * 圆心坐标\n */\n center: Point;\n /**\n * **弧度值**,起始弧度,默认 -0.5 * Math.PI\n *\n */\n startAngle?: number;\n /**\n * **弧度值**,结束弧度,默认 1.5 * Math.PI\n */\n endAngle?: number;\n /**\n * 半径\n */\n radius: number;\n /** 内半径 */\n innerRadius?: number;\n /**\n * 边数\n * @since 0.19.24\n */\n sides?: number;\n}\n\n// 坐标轴标题配置\nexport type TitleAttributes = Omit<TagAttributes, 'shape' | 'space' | 'panel' | 'state'> & {\n /**\n * 是否展示标题\n */\n visible?: boolean;\n /**\n * 标题的显示位置,默认 'middle'\n */\n position?: 'start' | 'middle' | 'end';\n /**\n * 标题距离坐标轴(轴线、刻度、标签共同构成的包围盒)的距离\n */\n space?: number;\n /**\n * 标题是否自动旋转以和坐标轴平行\n */\n autoRotate?: boolean;\n shape?: {\n /**\n * 是否展示 shape\n */\n visible?: boolean;\n /**\n * shape 同 文本的间距\n */\n space?: number;\n style?: Omit<Partial<ISymbolGraphicAttribute>, 'visible'>;\n };\n /**\n * 背景设置\n */\n background?: {\n /**\n * 是否绘制背景层\n */\n visible?: boolean;\n /**\n * 背景层样式\n */\n style?: Omit<Partial<IRectGraphicAttribute>, 'visible' | 'width' | 'height'>;\n };\n\n /**\n * 交互状态样式配置\n */\n state?: {\n /**\n * text 文本的状态配置\n */\n text?: AxisItemStateStyle<Partial<ITextGraphicAttribute>>;\n /**\n * shape 标记的状态配置\n */\n shape?: AxisItemStateStyle<Partial<ISymbolGraphicAttribute>>;\n /**\n * panel 背景的状态配置\n */\n background?: AxisItemStateStyle<Partial<IRectGraphicAttribute>>;\n };\n};\n// 坐标轴线配置\nexport interface LineAttributes extends Pick<SegmentAttributes, 'startSymbol' | 'endSymbol'> {\n /**\n * 是否展示轴线\n */\n visible?: boolean;\n /**\n * 线的样式配置\n */\n style?: Partial<ILineGraphicAttribute>;\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute>>;\n}\n\n// 轴刻度线配置\nexport interface TickAttributes {\n /** 是否显示轴刻度线 */\n visible: boolean;\n /**\n * 刻度线朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /**\n * tick 是否与 label 对齐\n * @default true\n */\n alignWithLabel?: boolean;\n /**\n * 刻度线的长度\n */\n length?: number;\n /**\n * 刻度线样式配置\n */\n style?: Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>;\n /**\n * 刻度线状态样式配置\n */\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>>;\n /**\n * 用于 tick 的数据过滤\n * @param data\n * @returns\n */\n dataFilter?: (data: AxisItem[]) => AxisItem[];\n}\n\n// 子轴刻度线配置\nexport interface SubTickAttributes {\n /** 是否显示子轴刻度线 */\n visible: boolean;\n /**\n * TODO: 考虑下 log 轴,自刻度线之间的间距是不均匀的问题\n * 子刻度个数\n */\n count?: number;\n /**\n * 子刻度线朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /**\n * 子刻度线的长度\n */\n length?: number;\n /**\n * 子刻度线样式配置\n */\n style?: Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>;\n /**\n * 子刻度线状态样式配置\n */\n state?: AxisItemStateStyle<Partial<ILineGraphicAttribute> | callbackFunc<Partial<ILineGraphicAttribute> | undefined>>;\n}\n\nexport type CustomMethod = (items: IText[], separation: number) => IText[];\n\nexport interface AxisLabelOverlap {\n /**\n * 自动旋转配置\n * @default false\n */\n autoRotate?: boolean;\n /**\n * 仅当 `autoRotate` 为 true 时生效,可选的旋转范围,默认为 [0, 45, 90]\n * @default [0, 45, 90]\n */\n autoRotateAngle?: number[];\n /**\n * 自动隐藏配置\n * @default false\n */\n autoHide?: boolean;\n /**\n * 防重叠策略,默认为 'parity'。\n * - 'parity': 奇偶校验,使用删除所有其他标签的策略(这对于标准线性轴非常有效)。\n * - 'greedy': 将执行标签的线性扫描,并删除与最后一个可见标签重叠的所有标签。\n * - 也可以传入函数用于自定义策略\n * @default 'parity'\n */\n autoHideMethod?: 'parity' | 'greedy' | CustomMethod;\n /**\n * 仅当 `autoHide` 为 true 时生效,设置文本之间的间隔距离,单位 px\n * @default 0\n */\n autoHideSeparation?: number;\n /**\n * 自动隐藏配置\n * @default false\n */\n autoLimit?: boolean;\n /**\n * 仅当 `autoLimit` 为 true 时生效,省略占位符,默认为 '...'\n * @default '...'\n */\n limitEllipsis?: string;\n /**\n * 文字超出坐标轴范围时,两侧可以提供扩充的空间大小。\n * 例如,x 轴坐标 135 度旋转时,左侧第一个标签可能超出坐标轴范围,导致文本被缩略,此时可以通过配置 `overflowLimitLength` 优化效果。\n * 仅当 `autoLimit` 为 true 时生效。\n * @default 0\n * @since 0.20.3 支持 X 轴配置生效\n */\n overflowLimitLength?:\n | number\n | {\n /**\n * 左侧扩充空间的大小\n */\n left?: number;\n /**\n * 右侧扩充空间的大小\n */\n right?: number;\n // top?: number;\n // bottom?: number;\n };\n\n /**\n * 自定义布局配置,如果声明了 `layoutFunc`,则默认提供的防重叠相关的配置(`autoHide`, `autoRotate`, `autoLimit`)均不生效\n * @param labels 标签图形元素\n * @param labelData 标签数据\n * @param layer 当前轴的层级\n * @param axis 当前轴组件实例\n * @returns void\n */\n layoutFunc?: (labels: IText[], labelData: AxisItem[], layer: number, axis: IGroup) => void;\n\n /**\n * 标签自动换行。与 `autoRotate` 不能同时生效,若开启了 `autoRotate`,则优先使用自动旋转策略。\n * @since 0.20.3\n * @default false\n */\n autoWrap?: boolean;\n}\n\nexport type LabelAttributes = Omit<AxisLabelOverlap, 'text'> &\n TextContent & {\n /** 是否展示标签 */\n visible: boolean;\n /**\n * 标签朝向,默认朝外(坐标线包围盒外部)\n * @default false\n */\n inside?: boolean;\n /** 标签同 tick 之间的间距 */\n space?: number;\n /**\n * 格式化文本回调\n * @param text 文本原始值\n * @param item 对应的图形元素\n * @param index 文本索引顺序\n * @returns 格式化文本\n */\n formatMethod?: (value: string, datum: Dict<any>, index: number, data?: Dict<any>[], layer?: number) => string;\n /**\n * 文本样式\n */\n style?: Partial<ITextGraphicAttribute> | callbackFunc<Partial<ITextGraphicAttribute> | undefined>;\n /**\n * 文本状态样式配置\n */\n state?: AxisItemStateStyle<\n Partial<ITextGraphicAttribute> | callbackFunc<Partial<ITextGraphicAttribute> | undefined>\n >;\n\n /**\n * 用于 label 的数据过滤\n * @param data\n * @param layer\n * @returns\n */\n dataFilter?: (data: AxisItem[], layer: number) => AxisItem[];\n };\n\nexport type CoordinateType = 'cartesian' | 'polar' | 'geo' | 'none';\nexport type IOrientType = 'left' | 'top' | 'right' | 'bottom' | 'z';\nexport type IPolarOrientType = 'radius' | 'angle';\n\ntype breakData = {\n /**\n * 截断后的值域范围\n */\n domain?: [number, number][];\n /**\n * 截断后的归一化范围\n */\n scope?: [number, number][];\n /**\n * 用户配置的截断范围\n */\n breakDomains: [number, number][];\n};\n\nexport interface ITickDataOpt {\n /**\n * 是否进行轴采样\n */\n sampling?: boolean;\n tickCount?: number | ((option: ITickCallbackOption) => number);\n forceTickCount?: number;\n tickStep?: number;\n tickMode?: 'average' | 'd3' | string | CustomTicksFunc<ContinuousScale>;\n noDecimals?: boolean;\n\n coordinateType: CoordinateType;\n axisOrientType: IOrientType | IPolarOrientType;\n startAngle?: number;\n\n labelFormatter?: (value: any) => string;\n labelStyle: ITextGraphicAttribute;\n labelGap?: number;\n labelFirstVisible?: boolean;\n labelLastVisible?: boolean;\n /**\n * 截断数据范围配置\n */\n breakData?: () => breakData;\n}\n\nexport interface ICartesianTickDataOpt extends ITickDataOpt {\n axisOrientType: IOrientType;\n labelFlush: boolean;\n /**\n * 截断数据范围配置\n */\n breakData?: () => breakData;\n}\n\nexport interface IPolarTickDataOpt extends ITickDataOpt {\n axisOrientType: IPolarOrientType;\n getRadius: () => number;\n labelOffset: number;\n inside: boolean;\n}\n\nexport interface ITickData {\n index: number;\n value: number | string;\n // label: string;\n}\n\nexport type ITickCallbackOption = {\n /**\n * 坐标轴占据的画布大小。\n * 直角坐标系中为轴的宽度或高度。\n * 极坐标系中半径轴的长度。\n */\n axisLength?: number;\n /**\n * 轴标签的样式\n */\n labelStyle?: ITextGraphicAttribute;\n};\n\nexport interface ILabelItem<T> extends Pick<IGraphic, 'AABBBounds'> {\n value?: T;\n}\n"]}
@@ -27,5 +27,4 @@ exports.DEFAULT_BRUSH_ATTRIBUTES = {
27
27
  minX: -1 / 0,
28
28
  maxX: 1 / 0
29
29
  }
30
- }, exports.DEFAULT_SIZE_THRESHOLD = 5;
31
- //# sourceMappingURL=config.js.map
30
+ }, exports.DEFAULT_SIZE_THRESHOLD = 5;
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "1.0.27-alpha.0";
1
+ export declare const version = "1.0.27";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "1.0.27-alpha.0", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "1.0.27", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./core/type"), exports), __exportStar(require("./scrollbar"), exports),
22
22
  __exportStar(require("./tag"), exports), __exportStar(require("./poptip"), exports),
23
23
  __exportStar(require("./crosshair"), exports), __exportStar(require("./label"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B;AAC7B,wDAAsC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.0.27-alpha.0\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\nexport * from './table-series-number';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B;AAC7B,wDAAsC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.0.27\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\nexport * from './table-series-number';\n"]}
package/dist/index.es.js CHANGED
@@ -17391,7 +17391,6 @@ var AXIS_ELEMENT_NAME;
17391
17391
  AXIS_ELEMENT_NAME["subTick"] = "axis-sub-tick";
17392
17392
  AXIS_ELEMENT_NAME["label"] = "axis-label";
17393
17393
  AXIS_ELEMENT_NAME["title"] = "axis-title";
17394
- AXIS_ELEMENT_NAME["labelHoverOnAxis"] = "axis-label-hover-on-axis";
17395
17394
  AXIS_ELEMENT_NAME["gridContainer"] = "axis-grid-container";
17396
17395
  AXIS_ELEMENT_NAME["grid"] = "axis-grid";
17397
17396
  AXIS_ELEMENT_NAME["gridRegion"] = "axis-grid-region";
@@ -17439,26 +17438,6 @@ const DEFAULT_AXIS_THEME = {
17439
17438
  fillOpacity: 1
17440
17439
  }
17441
17440
  },
17442
- labelHoverOnAxis: {
17443
- visible: false,
17444
- space: 7,
17445
- padding: 2,
17446
- position: 0,
17447
- autoRotate: false,
17448
- textStyle: {
17449
- fontSize: 12,
17450
- fill: 'red',
17451
- fontWeight: 'normal',
17452
- fillOpacity: 1
17453
- },
17454
- background: {
17455
- visible: true,
17456
- style: {
17457
- cornerRadius: 2,
17458
- fill: 'black'
17459
- }
17460
- }
17461
- },
17462
17441
  tick: {
17463
17442
  visible: true,
17464
17443
  inside: false,
@@ -20294,25 +20273,7 @@ function loadCircleAxisGridComponent() {
20294
20273
  loadLineAxisComponent();
20295
20274
  class LineAxis extends AxisBase {
20296
20275
  constructor(attributes, options) {
20297
- var _a;
20298
- if (attributes.labelHoverOnAxis) {
20299
- attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle);
20300
- if (attributes.labelHoverOnAxis.space === undefined) {
20301
- const { padding = 2 } = attributes.labelHoverOnAxis;
20302
- const parsedPadding = normalizePadding(padding);
20303
- const toDiffPadding = attributes.orient === 'bottom'
20304
- ? parsedPadding[0]
20305
- : attributes.orient === 'left'
20306
- ? parsedPadding[1]
20307
- : attributes.orient === 'top'
20308
- ? parsedPadding[2]
20309
- : parsedPadding[3];
20310
- const space = ((_a = attributes.label.space) !== null && _a !== void 0 ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
20311
- attributes.labelHoverOnAxis.space = space;
20312
- }
20313
- }
20314
20276
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
20315
- this.labelHoverOnAxisGroup = null;
20316
20277
  }
20317
20278
  _renderInner(container) {
20318
20279
  var _a;
@@ -20364,18 +20325,6 @@ class LineAxis extends AxisBase {
20364
20325
  bgRect.states = merge({}, DEFAULT_STATES$1, (_a = panel.state) !== null && _a !== void 0 ? _a : {});
20365
20326
  axisContainer.insertBefore(bgRect, axisContainer.firstChild);
20366
20327
  }
20367
- const { labelHoverOnAxis } = this.attribute;
20368
- if (labelHoverOnAxis && labelHoverOnAxis.visible) {
20369
- this.renderLabelHoverOnAxis();
20370
- }
20371
- }
20372
- renderLabelHoverOnAxis() {
20373
- const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute();
20374
- const hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
20375
- hoverOnLabel.name = AXIS_ELEMENT_NAME.title;
20376
- hoverOnLabel.id = this._getNodeId('hover-on-label');
20377
- this.labelHoverOnAxisGroup = hoverOnLabel;
20378
- this.axisContainer.add(hoverOnLabel);
20379
20328
  }
20380
20329
  renderLine(container) {
20381
20330
  const { start, end, line } = this.attribute;
@@ -20570,60 +20519,6 @@ class LineAxis extends AxisBase {
20570
20519
  }
20571
20520
  return attrs;
20572
20521
  }
20573
- getLabelHoverOnAxisAttribute() {
20574
- var _a, _b;
20575
- const { orient } = this.attribute;
20576
- const _c = this.attribute.labelHoverOnAxis, { position = 0, space = 4, autoRotate = true, textStyle = {}, background = {}, formatMethod, text: textContent = '', maxWidth } = _c, restAttrs = __rest(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]);
20577
- const point = this.getTickCoord(0);
20578
- if (orient === 'bottom' || orient === 'top') {
20579
- point.x = position;
20580
- }
20581
- else {
20582
- point.y = position;
20583
- }
20584
- let tickLength = 0;
20585
- if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.tick.inside === false) {
20586
- tickLength = this.attribute.tick.length || 4;
20587
- }
20588
- if (((_b = this.attribute.subTick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.subTick.inside === false) {
20589
- tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
20590
- }
20591
- const labelLength = 0;
20592
- const offset = tickLength + labelLength + space;
20593
- const labelPoint = this.getVerticalCoord(point, offset, false);
20594
- const vector = this.getVerticalVector(offset, false, { x: 0, y: 0 });
20595
- let { angle } = restAttrs;
20596
- let textAlign = 'center';
20597
- let textBaseline;
20598
- if (isNil(angle) && autoRotate) {
20599
- const axisVector = this.getRelativeVector();
20600
- const v1 = [1, 0];
20601
- const radian = angleTo(axisVector, v1, true);
20602
- angle = radian;
20603
- const { verticalFactor = 1 } = this.attribute;
20604
- const factor = -1 * verticalFactor;
20605
- if (factor === 1) {
20606
- textBaseline = 'bottom';
20607
- }
20608
- else {
20609
- textBaseline = 'top';
20610
- }
20611
- }
20612
- else {
20613
- const { textAlign: textAlign2, textBaseline: textBaseline2 } = this.getLabelAlign(vector, false, textStyle.angle);
20614
- textAlign = textAlign2;
20615
- textBaseline = textBaseline2;
20616
- }
20617
- const maxTagWidth = maxWidth;
20618
- const text = formatMethod ? formatMethod(textContent) : textContent;
20619
- const attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), { maxWidth: maxTagWidth, textStyle: Object.assign({ textAlign,
20620
- textBaseline }, textStyle), text });
20621
- attrs.angle = angle;
20622
- if (background && background.visible) {
20623
- attrs.panel = Object.assign(Object.assign({ visible: true }, restAttrs.panel), background.style);
20624
- }
20625
- return attrs;
20626
- }
20627
20522
  getTextBaseline(vector, inside) {
20628
20523
  let base = 'middle';
20629
20524
  const { verticalFactor = 1 } = this.attribute;
@@ -20856,8 +20751,8 @@ class LineAxis extends AxisBase {
20856
20751
  let limitLength = limitSize;
20857
20752
  let titleHeight = 0;
20858
20753
  let titleSpacing = 0;
20859
- const axisLineWidth = line && line.visible ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
20860
- const tickLength = tick && tick.visible ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
20754
+ const axisLineWidth = line && line.visible ? ((_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1) : 0;
20755
+ const tickLength = tick && tick.visible ? ((_c = tick.length) !== null && _c !== void 0 ? _c : 4) : 0;
20861
20756
  if (title && title.visible && typeof title.text === 'string') {
20862
20757
  titleHeight = measureTextSize(title.text, title.textStyle, (_e = (_d = this.stage) === null || _d === void 0 ? void 0 : _d.getTheme()) === null || _e === void 0 ? void 0 : _e.text).height;
20863
20758
  const padding = normalizePadding(title.padding);
@@ -20868,71 +20763,6 @@ class LineAxis extends AxisBase {
20868
20763
  }
20869
20764
  return limitLength;
20870
20765
  }
20871
- showLabelHoverOnAxis(position, text, adjustPosition = true) {
20872
- if (this.attribute.labelHoverOnAxis) {
20873
- const preContainerBounds = this.axisContainer.AABBBounds;
20874
- const preWidth = preContainerBounds.width();
20875
- const preHeight = preContainerBounds.height();
20876
- const preX1 = preContainerBounds.x1;
20877
- const preY1 = preContainerBounds.y1;
20878
- const preX2 = preContainerBounds.x2;
20879
- const preY2 = preContainerBounds.y2;
20880
- if (this.labelHoverOnAxisGroup) {
20881
- const { formatMethod } = this.attribute.labelHoverOnAxis;
20882
- const textStr = formatMethod ? formatMethod(text) : text;
20883
- this.labelHoverOnAxisGroup.setAttribute('text', textStr);
20884
- this.labelHoverOnAxisGroup.setAttribute('visible', true);
20885
- this.labelHoverOnAxisGroup.setAttribute('visibleAll', true);
20886
- if (this.attribute.orient === 'left' || this.attribute.orient === 'right') {
20887
- this.labelHoverOnAxisGroup.setAttributes({
20888
- y: position
20889
- });
20890
- }
20891
- else {
20892
- this.labelHoverOnAxisGroup.setAttributes({
20893
- x: position
20894
- });
20895
- }
20896
- }
20897
- else {
20898
- this.attribute.labelHoverOnAxis.visible = true;
20899
- this.attribute.labelHoverOnAxis.position = position;
20900
- this.attribute.labelHoverOnAxis.text = text;
20901
- this.renderLabelHoverOnAxis();
20902
- }
20903
- if (adjustPosition) {
20904
- const afterContainerBounds = this.axisContainer.AABBBounds;
20905
- const afterWidth = afterContainerBounds.width();
20906
- const afterHeight = afterContainerBounds.height();
20907
- const diffWidth = afterWidth - preWidth;
20908
- const diffHeight = afterHeight - preHeight;
20909
- if (diffWidth > 0 && (this.attribute.orient === 'top' || this.attribute.orient === 'bottom')) {
20910
- if (afterContainerBounds.x1 < preX1) {
20911
- this.showLabelHoverOnAxis(position + diffWidth, text, false);
20912
- }
20913
- else if (afterContainerBounds.x2 > preX2) {
20914
- this.showLabelHoverOnAxis(position - diffWidth, text, false);
20915
- }
20916
- }
20917
- if (diffHeight > 0 && (this.attribute.orient === 'left' || this.attribute.orient === 'right')) {
20918
- if (afterContainerBounds.y1 < preY1) {
20919
- this.showLabelHoverOnAxis(position + diffHeight, text, false);
20920
- }
20921
- else if (afterContainerBounds.y2 > preY2) {
20922
- this.showLabelHoverOnAxis(position - diffHeight, text, false);
20923
- }
20924
- }
20925
- }
20926
- }
20927
- }
20928
- hideLabelHoverOnAxis() {
20929
- if (this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup) {
20930
- this.labelHoverOnAxisGroup.setAttributes({
20931
- visible: false,
20932
- visibleAll: false
20933
- });
20934
- }
20935
- }
20936
20766
  release() {
20937
20767
  super.release();
20938
20768
  this._breaks = null;
@@ -21840,7 +21670,7 @@ const getPolarAngleLabelBounds = (scale, domain, op) => {
21840
21670
  const polarAngleAxisDiscreteTicks = (scale, op) => {
21841
21671
  const { tickCount, forceTickCount, tickStep, getRadius, labelOffset, labelGap = 0, labelStyle } = op;
21842
21672
  const radius = getRadius === null || getRadius === void 0 ? void 0 : getRadius();
21843
- if (!radius) {
21673
+ if (!radius || radius <= 0) {
21844
21674
  return convertDomainToTickData(scale.domain());
21845
21675
  }
21846
21676
  let scaleTicks;
@@ -34765,6 +34595,6 @@ TableSeriesNumber.defaultAttributes = {
34765
34595
  select: true
34766
34596
  };
34767
34597
 
34768
- const version = "1.0.27-alpha.0";
34598
+ const version = "1.0.27";
34769
34599
 
34770
34600
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
@@ -30,26 +30,6 @@ export declare class CircleAxis extends AxisBase<CircleAxisAttributes> {
30
30
  fillOpacity: number;
31
31
  };
32
32
  };
33
- labelHoverOnAxis: {
34
- visible: boolean;
35
- space: number;
36
- padding: number;
37
- position: number;
38
- autoRotate: boolean;
39
- textStyle: {
40
- fontSize: number;
41
- fill: string;
42
- fontWeight: string;
43
- fillOpacity: number;
44
- };
45
- background: {
46
- visible: boolean;
47
- style: {
48
- cornerRadius: number;
49
- fill: string;
50
- };
51
- };
52
- };
53
33
  tick: {
54
34
  visible: boolean;
55
35
  inside: boolean;
@@ -21,26 +21,6 @@ export declare const DEFAULT_AXIS_THEME: {
21
21
  fillOpacity: number;
22
22
  };
23
23
  };
24
- labelHoverOnAxis: {
25
- visible: boolean;
26
- space: number;
27
- padding: number;
28
- position: number;
29
- autoRotate: boolean;
30
- textStyle: {
31
- fontSize: number;
32
- fill: string;
33
- fontWeight: string;
34
- fillOpacity: number;
35
- };
36
- background: {
37
- visible: boolean;
38
- style: {
39
- cornerRadius: number;
40
- fill: string;
41
- };
42
- };
43
- };
44
24
  tick: {
45
25
  visible: boolean;
46
26
  inside: boolean;
package/es/axis/config.js CHANGED
@@ -21,26 +21,6 @@ export const DEFAULT_AXIS_THEME = {
21
21
  fillOpacity: 1
22
22
  }
23
23
  },
24
- labelHoverOnAxis: {
25
- visible: !1,
26
- space: 7,
27
- padding: 2,
28
- position: 0,
29
- autoRotate: !1,
30
- textStyle: {
31
- fontSize: 12,
32
- fill: "red",
33
- fontWeight: "normal",
34
- fillOpacity: 1
35
- },
36
- background: {
37
- visible: !0,
38
- style: {
39
- cornerRadius: 2,
40
- fill: "black"
41
- }
42
- }
43
- },
44
24
  tick: {
45
25
  visible: !0,
46
26
  inside: !1,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,KAAK,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;QACD,UAAU,EAAE;YACV,OAAO,EAAE,IAAI;YACb,KAAK,EAAE;gBACL,YAAY,EAAE,CAAC;gBACf,IAAI,EAAE,OAAO;aACd;SACF;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;CACV,CAAC","file":"config.js","sourcesContent":["export const DEFAULT_AXIS_THEME = {\n title: {\n space: 4,\n padding: 0,\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n padding: 0,\n style: {\n fontSize: 12,\n fill: '#333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n labelHoverOnAxis: {\n visible: false,\n space: 7,\n padding: 2,\n position: 0,\n autoRotate: false,\n textStyle: {\n fontSize: 12,\n fill: 'red',\n fontWeight: 'normal',\n fillOpacity: 1\n },\n background: {\n visible: true,\n style: {\n cornerRadius: 2,\n fill: 'black'\n }\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#999',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n }\n};\n\nexport const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {\n size: 8,\n stroke: '#000',\n lineWidth: 1,\n zIndex: 1\n};\n"]}
1
+ {"version":3,"sources":["../src/axis/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,KAAK,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,CAAC;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;CACV,CAAC","file":"config.js","sourcesContent":["export const DEFAULT_AXIS_THEME = {\n title: {\n space: 4,\n padding: 0,\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n padding: 0,\n style: {\n fontSize: 12,\n fill: '#333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#999',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#000',\n strokeOpacity: 1\n }\n }\n};\n\nexport const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {\n size: 8,\n stroke: '#000',\n lineWidth: 1,\n zIndex: 1\n};\n"]}
@@ -7,7 +7,6 @@ export declare enum AXIS_ELEMENT_NAME {
7
7
  subTick = "axis-sub-tick",
8
8
  label = "axis-label",
9
9
  title = "axis-title",
10
- labelHoverOnAxis = "axis-label-hover-on-axis",
11
10
  gridContainer = "axis-grid-container",
12
11
  grid = "axis-grid",
13
12
  gridRegion = "axis-grid-region",
@@ -5,11 +5,10 @@ export var AXIS_ELEMENT_NAME;
5
5
  AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container",
6
6
  AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick",
7
7
  AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title",
8
- AXIS_ELEMENT_NAME.labelHoverOnAxis = "axis-label-hover-on-axis", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container",
9
- AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region",
10
- AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background",
11
- AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break",
12
- AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
8
+ AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid",
9
+ AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line",
10
+ AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background",
11
+ AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
13
12
  }(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
14
13
 
15
14
  export var AxisStateValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,6CAAwB,CAAA;IACxB,qDAAgC,CAAA;IAChC,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,8CAAyB,CAAA;IACzB,yCAAoB,CAAA;IACpB,yCAAoB,CAAA;IACpB,kEAA6C,CAAA;IAC7C,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,oDAA+B,CAAA;IAC/B,uCAAkB,CAAA;IAClB,mDAA8B,CAAA;IAC9B,kEAA6C,CAAA;IAC7C,6CAAwB,CAAA;IACxB,0DAAqC,CAAA;AACvC,CAAC,EAlBW,iBAAiB,KAAjB,iBAAiB,QAkB5B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,sDAAoC,CAAA;IACpC,iCAAe,CAAA;IACf,gDAA8B,CAAA;AAChC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE;IACpC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC7B,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1B,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC","file":"constant.js","sourcesContent":["export enum AXIS_ELEMENT_NAME {\n innerView = 'inner-view',\n axisContainer = 'axis-container',\n labelContainer = 'axis-label-container',\n tickContainer = 'axis-tick-container',\n tick = 'axis-tick',\n subTick = 'axis-sub-tick',\n label = 'axis-label',\n title = 'axis-title',\n labelHoverOnAxis = 'axis-label-hover-on-axis',\n gridContainer = 'axis-grid-container',\n grid = 'axis-grid',\n gridRegion = 'axis-grid-region',\n line = 'axis-line',\n background = 'axis-background',\n axisLabelBackground = 'axis-label-background',\n axisBreak = 'axis-break',\n axisBreakSymbol = 'axis-break-symbol'\n}\n\nexport enum AxisStateValue {\n selected = 'selected',\n selectedReverse = 'selected_reverse',\n hover = 'hover',\n hoverReverse = 'hover_reverse'\n}\n\nexport const DEFAULT_STATES = {\n [AxisStateValue.selectedReverse]: {},\n [AxisStateValue.selected]: {},\n [AxisStateValue.hover]: {},\n [AxisStateValue.hoverReverse]: {}\n};\n\nexport const TopZIndex = 999;\n"]}
1
+ {"version":3,"sources":["../src/axis/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC3B,6CAAwB,CAAA;IACxB,qDAAgC,CAAA;IAChC,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,8CAAyB,CAAA;IACzB,yCAAoB,CAAA;IACpB,yCAAoB,CAAA;IACpB,0DAAqC,CAAA;IACrC,uCAAkB,CAAA;IAClB,oDAA+B,CAAA;IAC/B,uCAAkB,CAAA;IAClB,mDAA8B,CAAA;IAC9B,kEAA6C,CAAA;IAC7C,6CAAwB,CAAA;IACxB,0DAAqC,CAAA;AACvC,CAAC,EAjBW,iBAAiB,KAAjB,iBAAiB,QAiB5B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,sDAAoC,CAAA;IACpC,iCAAe,CAAA;IACf,gDAA8B,CAAA;AAChC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE;IACpC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC7B,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1B,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC","file":"constant.js","sourcesContent":["export enum AXIS_ELEMENT_NAME {\n innerView = 'inner-view',\n axisContainer = 'axis-container',\n labelContainer = 'axis-label-container',\n tickContainer = 'axis-tick-container',\n tick = 'axis-tick',\n subTick = 'axis-sub-tick',\n label = 'axis-label',\n title = 'axis-title',\n gridContainer = 'axis-grid-container',\n grid = 'axis-grid',\n gridRegion = 'axis-grid-region',\n line = 'axis-line',\n background = 'axis-background',\n axisLabelBackground = 'axis-label-background',\n axisBreak = 'axis-break',\n axisBreakSymbol = 'axis-break-symbol'\n}\n\nexport enum AxisStateValue {\n selected = 'selected',\n selectedReverse = 'selected_reverse',\n hover = 'hover',\n hoverReverse = 'hover_reverse'\n}\n\nexport const DEFAULT_STATES = {\n [AxisStateValue.selectedReverse]: {},\n [AxisStateValue.selected]: {},\n [AxisStateValue.hover]: {},\n [AxisStateValue.hoverReverse]: {}\n};\n\nexport const TopZIndex = 999;\n"]}