1 line
71 KiB
Plaintext
1 line
71 KiB
Plaintext
![]() |
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAiSC,CAAC","sourcesContent":["import { COMPONENT_TYPE, DIRECTION, LAYER } from './constant';\n\nimport {\n AxisLabelCfg,\n AxisLineCfg,\n AxisSubTickLineCfg,\n AxisTickLineCfg,\n AxisTitleCfg,\n ContinueLegendHandlerCfg,\n ContinueLegendLabelCfg,\n ContinueLegendRailCfg,\n ContinueLegendTrackCfg,\n Coordinate,\n CrosshairLineCfg,\n CrosshairTextBackgroundCfg,\n CrosshairTextCfg,\n GridLineCfg,\n GroupComponent,\n HtmlComponent,\n ICanvas,\n IGroup,\n IShape,\n LegendBackgroundCfg,\n LegendItemNameCfg,\n LegendItemValueCfg,\n LegendMarkerCfg,\n LegendTitleCfg,\n PathCommand,\n Scale,\n ScaleConfig,\n ShapeAttrs,\n} from './dependents';\n\nimport { View } from './chart';\nimport { Facet } from './facet';\nimport Element from './geometry/element';\n\n// ============================ 基础类型 ============================\n/** 通用对象 */\nexport interface LooseObject {\n [key: string]: any;\n}\n\n/** 一个点位置 */\nexport interface Point {\n readonly x: number;\n readonly y: number;\n}\n\n/** 画布范围 */\nexport interface Region {\n readonly start: Point;\n readonly end: Point;\n}\n\n/** 画布大小 */\nexport interface Size {\n readonly width: number;\n readonly height: number;\n}\n\n/** 带范围的点结构 */\nexport interface RangePoint {\n readonly x?: number | number[];\n readonly y?: number | number[];\n}\n\n/** 用户数据经过图形映射处理后的数据结构 */\nexport interface MappingDatum {\n /** 原始数据 */\n _origin: Datum;\n /** shape 的关键点信息 */\n points?: ShapeVertices;\n /** 相对于当前 shape 的下一个 shape 的关键点信息 */\n nextPoints?: ShapeVertices;\n /** x 轴的坐标 */\n x?: number[] | number;\n /** y 轴的坐标 */\n y?: number[] | number;\n /** 颜色 */\n color?: string;\n /** 渲染的 shape 类型 */\n shape?: string | string[];\n /** 大小 */\n size?: number;\n}\n\n/** 绘制 Shape 需要的图形、样式、关键点等信息 */\nexport interface ShapeInfo {\n /** x 坐标 */\n x: number | number[];\n /** y 坐标 */\n y: number | number[];\n /** 映射的 shape 类型 */\n shape?: string | string[];\n /** size 映射值 */\n size?: number;\n /** 映射的颜色值 */\n color?: string;\n /** 用户设置的图形样式 */\n style?: LooseObject;\n /** 是否在极坐标下 */\n isInCircle?: boolean;\n /** 对应的原始数据记录 */\n data?: Datum | Data;\n /** 存储进行图形映射后的数据 */\n mappingData?: MappingDatum | MappingDatum[];\n /** 构成 shape 的关键点 */\n points?: ShapeVertices;\n /** 下一个数据集对应的关键点 */\n nextPoints?: ShapeVertices;\n /** Geometry.Text 需要 */\n text?: string;\n /** 数据是否发生层叠 */\n isStack?: boolean;\n /** 是否连接空值,对 Path Line Area 这三种 Geometry 生效 */\n connectNulls?: boolean;\n /** 默认的 shape 样式 */\n defaultStyle?: LooseObject;\n}\n\n/** 用户配置的动画,属性均可选 */\nexport interface AnimateCfg {\n /** 动画缓动函数 */\n readonly easing?: string | AnimateEasingCallback;\n /** 动画执行函数 */\n readonly animation?: string;\n /** 动画执行时间 */\n readonly duration?: number | AnimateDurationCallback;\n /** 动画延迟时间 */\n readonly delay?: number | AnimateDelayCallback;\n /** 动画执行结束后的回调函数 */\n readonly callback?: () => any;\n}\n\n/** 传递给 G 的动画配置,duration 必须提供 */\nexport interface GAnimateCfg {\n /** 动画执行时间 */\n readonly duration: number;\n /** 动画缓动函数 */\n readonly easing?: string;\n /** 动画执行函数 */\n readonly animation?: string;\n /** 动画延迟时间 */\n readonly delay?: number;\n /** 动画执行结束后的回调函数 */\n readonly callback?: () => any;\n}\n\n// ============================ Geometry 接口相关的类型定义 ============================\n/** 图形属性配置项定义,<E4B989>
|