@antv/g2plot 2.4.19 → 2.4.20
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/dist/g2plot.min.js +1 -1
- package/dist/g2plot.min.js.map +1 -1
- package/esm/adaptor/brush.js +2 -3
- package/esm/adaptor/brush.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/interactions/brush.d.ts +18 -6
- package/esm/interactions/brush.js +35 -25
- package/esm/interactions/brush.js.map +1 -1
- package/esm/types/interaction.d.ts +5 -0
- package/esm/types/interaction.js.map +1 -1
- package/lib/adaptor/brush.js +2 -3
- package/lib/adaptor/brush.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interactions/brush.d.ts +18 -6
- package/lib/interactions/brush.js +35 -25
- package/lib/interactions/brush.js.map +1 -1
- package/lib/types/interaction.d.ts +5 -0
- package/lib/types/interaction.js.map +1 -1
- package/package.json +1 -1
- package/src/adaptor/brush.ts +2 -2
- package/src/index.ts +1 -1
- package/src/interactions/brush.ts +38 -25
- package/src/types/interaction.ts +6 -0
package/esm/adaptor/brush.js
CHANGED
|
@@ -15,7 +15,6 @@ export function brushInteraction(params) {
|
|
|
15
15
|
// 设置 brush 交互
|
|
16
16
|
if (brush === null || brush === void 0 ? void 0 : brush.enabled) {
|
|
17
17
|
BRUSH_TYPES.forEach(function (type) {
|
|
18
|
-
var _a;
|
|
19
18
|
var enable = false;
|
|
20
19
|
switch (brush.type) {
|
|
21
20
|
case 'x-rect':
|
|
@@ -29,8 +28,8 @@ export function brushInteraction(params) {
|
|
|
29
28
|
break;
|
|
30
29
|
}
|
|
31
30
|
var obj = { type: type, enable: enable };
|
|
32
|
-
if (
|
|
33
|
-
obj.cfg = getInteractionCfg(type, brush.type, brush
|
|
31
|
+
if (brush) {
|
|
32
|
+
obj.cfg = getInteractionCfg(type, brush.type, brush);
|
|
34
33
|
}
|
|
35
34
|
interactions.push(obj);
|
|
36
35
|
});
|
package/esm/adaptor/brush.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/adaptor/brush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,kBAAkB;AAClB,OAAO,uBAAuB,CAAC;AAI/B,IAAM,WAAW,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;AAEjH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAA8B,MAAiB;IACrE,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IAEnB,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAa;IAE1B,iBAAiB;IACjB,IAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,EAAE,UAAC,CAAC,IAAK,OAAA,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAlC,CAAkC,CAAC,CAAC;IAEnG,cAAc;IACd,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAE;QAClB,WAAW,CAAC,OAAO,CAAC,UAAC,IAAI
|
|
1
|
+
{"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/adaptor/brush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,kBAAkB;AAClB,OAAO,uBAAuB,CAAC;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GAAG,CAAC,GAAG,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACtD;YACD,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,4BAA4B;QAC5B,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,MAAK,WAAW,EAAE;YACjC,YAAY,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE;oBACH,YAAY,EAAE,KAAK,CAAC,MAAM;iBAC3B;aACF,CAAC,CAAC;SACJ;KACF;IACD,OAAO,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,YAAY,cAAA,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { filter } from '@antv/util';\nimport { Params } from '../core/adaptor';\nimport { getInteractionCfg } from '../interactions/brush';\nimport { deepAssign } from '../utils';\nimport { Options as BaseOptions, BrushCfg, Interaction, Writable } from '../types';\n\n/** 先引入brush 交互 */\nimport '../interactions/brush';\n\ntype Options = Pick<BaseOptions, 'interactions'> & { brush?: BrushCfg };\n\nconst BRUSH_TYPES = ['brush', 'brush-x', 'brush-y', 'brush-highlight', 'brush-x-highlight', 'brush-y-highlight'];\n\n/**\n * brush 交互\n */\nexport function brushInteraction<O extends Options = Options>(params: Params<O>): Params<O> {\n const { options } = params;\n\n const { brush } = options;\n\n // 先过滤掉 brush 等交互\n const interactions = filter(options.interactions || [], (i) => BRUSH_TYPES.indexOf(i.type) === -1);\n\n // 设置 brush 交互\n if (brush?.enabled) {\n BRUSH_TYPES.forEach((type) => {\n let enable = false;\n switch (brush.type) {\n case 'x-rect':\n enable = type === (brush.action === 'highlight' ? 'brush-x-highlight' : 'brush-x');\n break;\n case 'y-rect':\n enable = type === (brush.action === 'highlight' ? 'brush-y-highlight' : 'brush-y');\n break;\n default:\n enable = type === (brush.action === 'highlight' ? 'brush-highlight' : 'brush');\n break;\n }\n const obj: Writable<Interaction> = { type, enable };\n\n if (brush) {\n obj.cfg = getInteractionCfg(type, brush.type, brush);\n }\n interactions.push(obj);\n });\n\n // 塞入 button 配置 (G2Plot 的封装)\n if (brush?.action !== 'highlight') {\n interactions.push({\n type: 'filter-action',\n cfg: {\n buttonConfig: brush.button,\n },\n });\n }\n }\n return deepAssign({}, params, { options: { interactions } });\n}\n"]}
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,uDAAuD;AACvD,OAAO,EAAE,MAAM,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SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.19';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,yDAAyD;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,0DA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,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.20';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
@@ -9,11 +9,16 @@ declare function isPointInView(context: any): any;
|
|
|
9
9
|
/**
|
|
10
10
|
* 获取 交互 start 阶段的相关配置
|
|
11
11
|
*/
|
|
12
|
-
export declare function getInteractionCfg(interactionType: string, brushType?: string,
|
|
13
|
-
showEnable: {
|
|
12
|
+
export declare function getInteractionCfg(interactionType: string, brushType?: string, options?: BrushCfg): {
|
|
13
|
+
showEnable: ({
|
|
14
14
|
trigger: string;
|
|
15
15
|
action: string;
|
|
16
|
-
|
|
16
|
+
isEnable: ((context: any) => boolean) | (() => true);
|
|
17
|
+
} | {
|
|
18
|
+
trigger: string;
|
|
19
|
+
action: string;
|
|
20
|
+
isEnable?: undefined;
|
|
21
|
+
})[];
|
|
17
22
|
start: {
|
|
18
23
|
trigger: string;
|
|
19
24
|
isEnable: typeof isPointInView;
|
|
@@ -37,13 +42,18 @@ export declare function getInteractionCfg(interactionType: string, brushType?: s
|
|
|
37
42
|
action: string[];
|
|
38
43
|
}[];
|
|
39
44
|
} | {
|
|
40
|
-
showEnable: {
|
|
45
|
+
showEnable: ({
|
|
41
46
|
trigger: string;
|
|
42
47
|
action: string;
|
|
43
|
-
|
|
48
|
+
isEnable: ((context: any) => boolean) | (() => true);
|
|
49
|
+
} | {
|
|
50
|
+
trigger: string;
|
|
51
|
+
action: string;
|
|
52
|
+
isEnable?: undefined;
|
|
53
|
+
})[];
|
|
44
54
|
start: ({
|
|
45
55
|
trigger: string;
|
|
46
|
-
isEnable(context: any)
|
|
56
|
+
isEnable: (context: any) => boolean;
|
|
47
57
|
action: string[];
|
|
48
58
|
arg: {
|
|
49
59
|
maskStyle: import("@antv/g2").ShapeAttrs;
|
|
@@ -51,6 +61,7 @@ export declare function getInteractionCfg(interactionType: string, brushType?: s
|
|
|
51
61
|
} | {
|
|
52
62
|
trigger: string;
|
|
53
63
|
action: string[];
|
|
64
|
+
isEnable?: undefined;
|
|
54
65
|
arg?: undefined;
|
|
55
66
|
})[];
|
|
56
67
|
processing: {
|
|
@@ -60,6 +71,7 @@ export declare function getInteractionCfg(interactionType: string, brushType?: s
|
|
|
60
71
|
end: ({
|
|
61
72
|
trigger: string;
|
|
62
73
|
action: string[];
|
|
74
|
+
isEnable?: undefined;
|
|
63
75
|
} | {
|
|
64
76
|
trigger: string;
|
|
65
77
|
isEnable(context: any): boolean;
|
|
@@ -16,19 +16,20 @@ function isPointInView(context) {
|
|
|
16
16
|
/**
|
|
17
17
|
* 获取 交互 start 阶段的相关配置
|
|
18
18
|
*/
|
|
19
|
-
export function getInteractionCfg(interactionType, brushType,
|
|
19
|
+
export function getInteractionCfg(interactionType, brushType, options) {
|
|
20
|
+
var _a = options || {}, mask = _a.mask, isStartEnable = _a.isStartEnable;
|
|
20
21
|
var maskType = brushType || 'rect';
|
|
21
22
|
switch (interactionType) {
|
|
22
23
|
case 'brush':
|
|
23
24
|
return {
|
|
24
25
|
showEnable: [
|
|
25
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
26
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
26
27
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
27
28
|
],
|
|
28
29
|
start: [
|
|
29
30
|
{
|
|
30
31
|
trigger: 'mousedown',
|
|
31
|
-
isEnable: isPointInView,
|
|
32
|
+
isEnable: isStartEnable || isPointInView,
|
|
32
33
|
action: ['brush:start', maskType + "-mask:start", maskType + "-mask:show"],
|
|
33
34
|
// 对应第二个action的参数
|
|
34
35
|
arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -64,18 +65,25 @@ export function getInteractionCfg(interactionType, brushType, mask) {
|
|
|
64
65
|
case 'brush-highlight':
|
|
65
66
|
return {
|
|
66
67
|
showEnable: [
|
|
67
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
68
|
-
{ trigger: '
|
|
68
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
69
|
+
{ trigger: 'plot:mousemove', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
70
|
+
{
|
|
71
|
+
trigger: 'plot:mousemove',
|
|
72
|
+
action: 'cursor:default',
|
|
73
|
+
isEnable: function (context) { return (isStartEnable ? !isStartEnable(context) : false); },
|
|
74
|
+
},
|
|
75
|
+
{ trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (function () { return true; }) },
|
|
69
76
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
70
77
|
{ trigger: 'mask:mouseleave', action: 'cursor:crosshair' },
|
|
71
78
|
],
|
|
72
79
|
start: [
|
|
73
80
|
{
|
|
74
81
|
trigger: 'plot:mousedown',
|
|
75
|
-
isEnable:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
isEnable: isStartEnable ||
|
|
83
|
+
(function (context) {
|
|
84
|
+
// 不要点击在 mask 上重新开始
|
|
85
|
+
return !context.isInShape('mask');
|
|
86
|
+
}),
|
|
79
87
|
action: [maskType + "-mask:start", maskType + "-mask:show"],
|
|
80
88
|
// 对应第 1 个action的参数
|
|
81
89
|
arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -115,13 +123,13 @@ export function getInteractionCfg(interactionType, brushType, mask) {
|
|
|
115
123
|
case 'brush-x':
|
|
116
124
|
return {
|
|
117
125
|
showEnable: [
|
|
118
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
126
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
119
127
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
120
128
|
],
|
|
121
129
|
start: [
|
|
122
130
|
{
|
|
123
131
|
trigger: 'mousedown',
|
|
124
|
-
isEnable: isPointInView,
|
|
132
|
+
isEnable: isStartEnable || isPointInView,
|
|
125
133
|
action: ['brush-x:start', maskType + "-mask:start", maskType + "-mask:show"],
|
|
126
134
|
// 对应第二个action的参数
|
|
127
135
|
arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -146,18 +154,19 @@ export function getInteractionCfg(interactionType, brushType, mask) {
|
|
|
146
154
|
case 'brush-x-highlight':
|
|
147
155
|
return {
|
|
148
156
|
showEnable: [
|
|
149
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
150
|
-
{ trigger: 'mask:mouseenter', action: 'cursor:move' },
|
|
157
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
158
|
+
{ trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (function () { return true; }) },
|
|
151
159
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
152
160
|
{ trigger: 'mask:mouseleave', action: 'cursor:crosshair' },
|
|
153
161
|
],
|
|
154
162
|
start: [
|
|
155
163
|
{
|
|
156
164
|
trigger: 'plot:mousedown',
|
|
157
|
-
isEnable:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
isEnable: isStartEnable ||
|
|
166
|
+
(function (context) {
|
|
167
|
+
// 不要点击在 mask 上重新开始
|
|
168
|
+
return !context.isInShape('mask');
|
|
169
|
+
}),
|
|
161
170
|
action: [maskType + "-mask:start", maskType + "-mask:show"],
|
|
162
171
|
// 对应第 1 个action的参数
|
|
163
172
|
arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -197,13 +206,13 @@ export function getInteractionCfg(interactionType, brushType, mask) {
|
|
|
197
206
|
case 'brush-y':
|
|
198
207
|
return {
|
|
199
208
|
showEnable: [
|
|
200
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
209
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
201
210
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
202
211
|
],
|
|
203
212
|
start: [
|
|
204
213
|
{
|
|
205
214
|
trigger: 'mousedown',
|
|
206
|
-
isEnable: isPointInView,
|
|
215
|
+
isEnable: isStartEnable || isPointInView,
|
|
207
216
|
action: ['brush-y:start', maskType + "-mask:start", maskType + "-mask:show"],
|
|
208
217
|
// 对应第二个action的参数
|
|
209
218
|
arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -228,18 +237,19 @@ export function getInteractionCfg(interactionType, brushType, mask) {
|
|
|
228
237
|
case 'brush-y-highlight':
|
|
229
238
|
return {
|
|
230
239
|
showEnable: [
|
|
231
|
-
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair' },
|
|
232
|
-
{ trigger: 'mask:mouseenter', action: 'cursor:move' },
|
|
240
|
+
{ trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (function () { return true; }) },
|
|
241
|
+
{ trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (function () { return true; }) },
|
|
233
242
|
{ trigger: 'plot:mouseleave', action: 'cursor:default' },
|
|
234
243
|
{ trigger: 'mask:mouseleave', action: 'cursor:crosshair' },
|
|
235
244
|
],
|
|
236
245
|
start: [
|
|
237
246
|
{
|
|
238
247
|
trigger: 'plot:mousedown',
|
|
239
|
-
isEnable:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
isEnable: isStartEnable ||
|
|
249
|
+
(function (context) {
|
|
250
|
+
// 不要点击在 mask 上重新开始
|
|
251
|
+
return !context.isInShape('mask');
|
|
252
|
+
}),
|
|
243
253
|
action: [maskType + "-mask:start", maskType + "-mask:show"],
|
|
244
254
|
// 对应第 1 个action的参数
|
|
245
255
|
arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/interactions/brush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,cAAc,CAAC,oBAAoB,EAAE,YAAY,EAAE;IACjD,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAEzC;;;;;GAKG;AAEH,SAAS,aAAa,CAAC,OAAO;IAC5B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAuB,EAAE,SAAkB,EAAE,IAAuB;IACpG,IAAM,QAAQ,GAAG,SAAS,IAAI,MAAM,CAAC;IAErC,QAAQ,eAAe,EAAE;QACvB,KAAK,OAAO;YACV,OAAO;gBACL,UAAU,EAAE;oBACV,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE;oBAC1D,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,EAAE;iBACzD;gBACD,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,WAAW;wBACpB,QAAQ,EAAE,aAAa;wBACvB,MAAM,EAAE,CAAC,aAAa,EAAK,QAAQ,gBAAa,EAAK,QAAQ,eAAY,CAAC;wBAC1E,iBAAiB;wBACjB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,CAAC;qBACxC;iBACF;gBACD,UAAU,EAAE;oBACV;wBACE,OAAO,EAAE,W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BAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3F,aAAa;AACb,mBAAmB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["import { registerAction, registerInteraction } from '@antv/g2';\nimport { BrushCfg } from '../types';\nimport { ButtonAction } from './actions/reset-button';\n\nregisterAction('brush-reset-button', ButtonAction, {\n name: 'brush-reset-button',\n});\n\nregisterInteraction('filter-action', {});\n\n/**\n * G2 已经内置了 brush、brush-x、brush-y 等交互,其它:\n *\n * 1. element-range-highlight 是否可用重命名为 brush-highlight?(mask 可以移动)\n * 2. brush-visible 与 brush 的区别是?\n */\n\nfunction isPointInView(context) {\n return context.isInPlot();\n}\n\n/**\n * 获取 交互 start 阶段的相关配置\n */\nexport function getInteractionCfg(interactionType: string, brushType?: string, mask?: BrushCfg['mask']) {\n const maskType = brushType || 'rect';\n\n switch (interactionType) {\n case 'brush':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isPointInView,\n action: ['brush:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: [\n 'brush:filter',\n 'brush:end',\n `${maskType}-mask:end`,\n `${maskType}-mask:hide`,\n 'brush-reset-button:show',\n ],\n },\n ],\n rollback: [\n {\n trigger: 'brush-reset-button:click',\n action: ['brush:reset', 'brush-reset-button:hide', 'cursor:crosshair'],\n },\n ],\n };\n case 'brush-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'mask:mouseenter', action: 'cursor:move' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable(context) {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n },\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-x':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isPointInView,\n action: ['brush-x:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-x:filter', 'brush-x:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-x:reset'] }],\n };\n case 'brush-x-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'mask:mouseenter', action: 'cursor:move' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable(context) {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n },\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-y':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isPointInView,\n action: ['brush-y:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-y:filter', 'brush-y:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-y:reset'] }],\n };\n case 'brush-y-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair' },\n { trigger: 'mask:mouseenter', action: 'cursor:move' },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable(context) {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n },\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n\n default:\n return {};\n }\n}\n\n// 直接拷贝过来的\nregisterInteraction('brush', getInteractionCfg('brush'));\n// 复写 element-range-highlight interaction\nregisterInteraction('brush-highlight', getInteractionCfg('brush-highlight'));\n// 复写\nregisterInteraction('brush-x', getInteractionCfg('brush-x', 'x-rect'));\n// 复写\nregisterInteraction('brush-y', getInteractionCfg('brush-y', 'y-rect'));\n// 新增, x 框选高亮\nregisterInteraction('brush-x-highlight', getInteractionCfg('brush-x-highlight', 'x-rect'));\n// 新增, y 框选高亮\nregisterInteraction('brush-y-highlight', getInteractionCfg('brush-y-high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EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["import { registerAction, registerInteraction } from '@antv/g2';\nimport { BrushCfg } from '../types';\nimport { ButtonAction } from './actions/reset-button';\n\nregisterAction('brush-reset-button', ButtonAction, {\n name: 'brush-reset-button',\n});\n\nregisterInteraction('filter-action', {});\n\n/**\n * G2 已经内置了 brush、brush-x、brush-y 等交互,其它:\n *\n * 1. element-range-highlight 是否可用重命名为 brush-highlight?(mask 可以移动)\n * 2. brush-visible 与 brush 的区别是?\n */\n\nfunction isPointInView(context) {\n return context.isInPlot();\n}\n\n/**\n * 获取 交互 start 阶段的相关配置\n */\nexport function getInteractionCfg(interactionType: string, brushType?: string, options?: BrushCfg) {\n const { mask, isStartEnable } = options || {};\n const maskType = brushType || 'rect';\n\n switch (interactionType) {\n case 'brush':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: [\n 'brush:filter',\n 'brush:end',\n `${maskType}-mask:end`,\n `${maskType}-mask:hide`,\n 'brush-reset-button:show',\n ],\n },\n ],\n rollback: [\n {\n trigger: 'brush-reset-button:click',\n action: ['brush:reset', 'brush-reset-button:hide', 'cursor:crosshair'],\n },\n ],\n };\n case 'brush-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mousemove', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n {\n trigger: 'plot:mousemove',\n action: 'cursor:default',\n isEnable: (context) => (isStartEnable ? !isStartEnable(context) : false),\n },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-x':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-x:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-x:filter', 'brush-x:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-x:reset'] }],\n };\n case 'brush-x-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-y':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-y:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-y:filter', 'brush-y:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-y:reset'] }],\n };\n case 'brush-y-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n\n default:\n return {};\n }\n}\n\n// 直接拷贝过来的\nregisterInteraction('brush', getInteractionCfg('brush'));\n// 复写 element-range-highlight interaction\nregisterInteraction('brush-highlight', getInteractionCfg('brush-highlight'));\n// 复写\nregisterInteraction('brush-x', getInteractionCfg('brush-x', 'x-rect'));\n// 复写\nregisterInteraction('brush-y', getInteractionCfg('brush-y', 'y-rect'));\n// 新增, x 框选高亮\nregisterInteraction('brush-x-highlight', getInteractionCfg('brush-x-highlight', 'x-rect'));\n// 新增, y 框选高亮\nregisterInteraction('brush-y-highlight', getInteractionCfg('brush-y-highlight', 'y-rect'));\n"]}
|
|
@@ -41,4 +41,9 @@ export declare type BrushCfg = {
|
|
|
41
41
|
* @description brush button 的配置, 只在 action: 'filter' 的情况下适用
|
|
42
42
|
*/
|
|
43
43
|
readonly button?: ButtonCfg;
|
|
44
|
+
/**
|
|
45
|
+
* @title 是否允许 brush 交互开始的回调
|
|
46
|
+
* @description 是否允许 brush 交互开始的回调
|
|
47
|
+
*/
|
|
48
|
+
readonly isStartEnable?: (context: any) => boolean;
|
|
44
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/types/interaction.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { ButtonCfg } from './button';\n\nexport type Interaction = {\n readonly type: string;\n readonly cfg?: Record<string, any>;\n /** 是否开启交互, 默认开启 */\n readonly enable?: boolean;\n};\n\n/** brush 交互 */\nexport type BrushCfg = {\n /**\n * @title 是否启用\n * @description 是否启用 brush 交互\n */\n readonly enabled?: boolean;\n /**\n * @title brush 类型\n * @description '矩形', 'x 方向' 和 'y 方向', 'circle', 'path'(不规则矩形). 默认: 'rect'.\n * @default \"rect\"\n */\n readonly type?: 'rect' | 'x-rect' | 'y-rect' | 'circle' | 'path';\n /**\n * @title brush 操作\n * @description '筛选过滤' 和 '高亮强调'. 默认: 'filter'. 目前只在 type 为 'rect' 的情况下生效\n * @default \"filter\"\n */\n readonly action?: 'filter' | 'highlight';\n /**\n * @title mask\n * @description brush mask 的配置\n */\n readonly mask?: {\n /**\n * @title mask 样式\n * @description mask 蒙层样式\n */\n style?: ShapeAttrs;\n };\n /**\n * @title button 配置\n * @description brush button 的配置, 只在 action: 'filter' 的情况下适用\n */\n readonly button?: ButtonCfg;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/types/interaction.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { ButtonCfg } from './button';\n\nexport type Interaction = {\n readonly type: string;\n readonly cfg?: Record<string, any>;\n /** 是否开启交互, 默认开启 */\n readonly enable?: boolean;\n};\n\n/** brush 交互 */\nexport type BrushCfg = {\n /**\n * @title 是否启用\n * @description 是否启用 brush 交互\n */\n readonly enabled?: boolean;\n /**\n * @title brush 类型\n * @description '矩形', 'x 方向' 和 'y 方向', 'circle', 'path'(不规则矩形). 默认: 'rect'.\n * @default \"rect\"\n */\n readonly type?: 'rect' | 'x-rect' | 'y-rect' | 'circle' | 'path';\n /**\n * @title brush 操作\n * @description '筛选过滤' 和 '高亮强调'. 默认: 'filter'. 目前只在 type 为 'rect' 的情况下生效\n * @default \"filter\"\n */\n readonly action?: 'filter' | 'highlight';\n /**\n * @title mask\n * @description brush mask 的配置\n */\n readonly mask?: {\n /**\n * @title mask 样式\n * @description mask 蒙层样式\n */\n style?: ShapeAttrs;\n };\n /**\n * @title button 配置\n * @description brush button 的配置, 只在 action: 'filter' 的情况下适用\n */\n readonly button?: ButtonCfg;\n\n /**\n * @title 是否允许 brush 交互开始的回调\n * @description 是否允许 brush 交互开始的回调\n */\n readonly isStartEnable?: (context: any) => boolean;\n};\n"]}
|
package/lib/adaptor/brush.js
CHANGED
|
@@ -18,7 +18,6 @@ function brushInteraction(params) {
|
|
|
18
18
|
// 设置 brush 交互
|
|
19
19
|
if (brush === null || brush === void 0 ? void 0 : brush.enabled) {
|
|
20
20
|
BRUSH_TYPES.forEach(function (type) {
|
|
21
|
-
var _a;
|
|
22
21
|
var enable = false;
|
|
23
22
|
switch (brush.type) {
|
|
24
23
|
case 'x-rect':
|
|
@@ -32,8 +31,8 @@ function brushInteraction(params) {
|
|
|
32
31
|
break;
|
|
33
32
|
}
|
|
34
33
|
var obj = { type: type, enable: enable };
|
|
35
|
-
if (
|
|
36
|
-
obj.cfg = brush_1.getInteractionCfg(type, brush.type, brush
|
|
34
|
+
if (brush) {
|
|
35
|
+
obj.cfg = brush_1.getInteractionCfg(type, brush.type, brush);
|
|
37
36
|
}
|
|
38
37
|
interactions.push(obj);
|
|
39
38
|
});
|
package/lib/adaptor/brush.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/adaptor/brush.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,+CAA0D;AAC1D,kCAAsC;AAGtC,kBAAkB;AAClB,iCAA+B;AAI/B,IAAM,WAAW,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;AAEjH;;GAEG;AACH,SAAgB,gBAAgB,CAA8B,MAAiB;IACrE,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IAEnB,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAa;IAE1B,iBAAiB;IACjB,IAAM,YAAY,GAAG,aAAM,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,EAAE,UAAC,CAAC,IAAK,OAAA,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAlC,CAAkC,CAAC,CAAC;IAEnG,cAAc;IACd,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAE;QAClB,WAAW,CAAC,OAAO,CAAC,UAAC,IAAI
|
|
1
|
+
{"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/adaptor/brush.ts"],"names":[],"mapp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AE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC;YAEpD,IAAI,KAAK,EAAE;gBACT,GAAG,CAAC,GAAG,GAAG,yBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACtD;YACD,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,4BAA4B;QAC5B,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,MAAK,WAAW,EAAE;YACjC,YAAY,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE;oBACH,YAAY,EAAE,KAAK,CAAC,MAAM;iBAC3B;aACF,CAAC,CAAC;SACJ;KACF;IACD,OAAO,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,YAAY,cAAA,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC;AA1CD,4CA0CC","sourcesContent":["import { filter } from '@antv/util';\nimport { Params } from '../core/adaptor';\nimport { getInteractionCfg } from '../interactions/brush';\nimport { deepAssign } from '../utils';\nimport { Options as BaseOptions, BrushCfg, Interaction, Writable } from '../types';\n\n/** 先引入brush 交互 */\nimport '../interactions/brush';\n\ntype Options = Pick<BaseOptions, 'interactions'> & { brush?: BrushCfg };\n\nconst BRUSH_TYPES = ['brush', 'brush-x', 'brush-y', 'brush-highlight', 'brush-x-highlight', 'brush-y-highlight'];\n\n/**\n * brush 交互\n */\nexport function brushInteraction<O extends Options = Options>(params: Params<O>): Params<O> {\n const { options } = params;\n\n const { brush } = options;\n\n // 先过滤掉 brush 等交互\n const interactions = filter(options.interactions || [], (i) => BRUSH_TYPES.indexOf(i.type) === -1);\n\n // 设置 brush 交互\n if (brush?.enabled) {\n BRUSH_TYPES.forEach((type) => {\n let enable = false;\n switch (brush.type) {\n case 'x-rect':\n enable = type === (brush.action === 'highlight' ? 'brush-x-highlight' : 'brush-x');\n break;\n case 'y-rect':\n enable = type === (brush.action === 'highlight' ? 'brush-y-highlight' : 'brush-y');\n break;\n default:\n enable = type === (brush.action === 'highlight' ? 'brush-highlight' : 'brush');\n break;\n }\n const obj: Writable<Interaction> = { type, enable };\n\n if (brush) {\n obj.cfg = getInteractionCfg(type, brush.type, brush);\n }\n interactions.push(obj);\n });\n\n // 塞入 button 配置 (G2Plot 的封装)\n if (brush?.action !== 'highlight') {\n interactions.push({\n type: 'filter-action',\n cfg: {\n buttonConfig: brush.button,\n },\n });\n }\n }\n return deepAssign({}, params, { options: { interactions } });\n}\n"]}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.adaptors = exports.registerLocale = exports.G2 = exports.version = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
exports.version = '2.4.
|
|
5
|
+
exports.version = '2.4.20';
|
|
6
6
|
// G2 自定义能力透出
|
|
7
7
|
var G2 = tslib_1.__importStar(require("@antv/g2"));
|
|
8
8
|
exports.G2 = G2;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,mDAA+B;AACtB,gBAAE;AAEX,QAAQ;AACR,wCAA+C;AAOtC,+FAPA,uBAAc,OAOA;AANvB,yCAA+C;AAC/C,yCAA+C;AAC/C,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAItC,WAAW;AACX,wCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAElB,uBAAuB;AACvB,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AAKb,SAAS;A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OAAA;AAAE,oGAAA,MAAM,OAAA;AASrD,uCAAuC;AACvC,2CAAqG;AACxF,QAAA,QAAQ,GAAG,EAAE,KAAK,gBAAA,EAAE,MAAM,iBAAA,EAAE,OAAO,kBAAA,EAAE,UAAU,qBAAA,EAAE,WAAW,sBAAA,EAAE,KAAK,gBAAA,EAAE,SAAS,oBAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,6BAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export const version = '2.4.19';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验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AAmE;AACnE,mCAA6B;AAApB,2FAAA,CAAC,OAAA;AAEV,8BAA8B;AAC9B,2CAAmD;AAA1C,2GAAA,gBAAgB,OAAA;AAEzB,eAAe;AACf,mCAA+C;AAAtC,gGAAA,GAAG,OAAa;AAEzB,oBAAoB;AACpB,mCAAyC;AAAhC,0FAAA,GAAG,OAAO;AAGnB,2DAA2D;AAC3D,uCAAsC;AAA7B,8FAAA,KAAK,OAAA;AAGd,uCAAuC;AACvC,iCAAiD;AAAxC,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAE/B,0CAA0C;AAC1C,mDAAoF;AAA3E,kGAAA,IAAI,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,kGAAA,IAAI,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,qGAAA,OAAO,OAAA;AAAE,oGAAA,MAAM,OAAA;AASrD,uCAAuC;AACvC,2CAAqG;AACxF,QAAA,QAAQ,GAAG,EAAE,KAAK,gBAAA,EAAE,MAAM,iBAAA,EAAE,OAAO,kBAAA,EAAE,UAAU,qBAAA,EAAE,WAAW,sBAAA,EAAE,KAAK,gBAAA,EAAE,SAAS,oBAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,6BAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export const version = '2.4.20';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|