@visactor/vchart 2.0.4-alpha.5 → 2.0.4-alpha.6

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.
@@ -11,5 +11,4 @@ Object.defineProperty(exports, "__esModule", {
11
11
  AttributeLevel[AttributeLevel.User_Chart = 6] = "User_Chart", AttributeLevel[AttributeLevel.User_Series = 7] = "User_Series",
12
12
  AttributeLevel[AttributeLevel.User_Mark = 8] = "User_Mark", AttributeLevel[AttributeLevel.User_SeriesStyle = 9] = "User_SeriesStyle",
13
13
  AttributeLevel[AttributeLevel.Built_In = 99] = "Built_In";
14
- }(AttributeLevel = exports.AttributeLevel || (exports.AttributeLevel = {}));
15
- //# sourceMappingURL=attribute.js.map
14
+ }(AttributeLevel = exports.AttributeLevel || (exports.AttributeLevel = {}));
@@ -8,4 +8,5 @@ const base_1 = require("./base");
8
8
 
9
9
  exports.DEFAULT_LABEL_LIMIT = `${base_1.PREFIX}_LABEL_LIMIT`, exports.DEFAULT_LABEL_ALIGN = `${base_1.PREFIX}_LABEL_ALIGN`,
10
10
  exports.DEFAULT_LABEL_TEXT = `${base_1.PREFIX}_LABEL_TEXT`, exports.DEFAULT_LABEL_VISIBLE = `${base_1.PREFIX}_LABEL_VISIBLE`,
11
- exports.DEFAULT_LABEL_X = `${base_1.PREFIX}_LABEL_X`, exports.DEFAULT_LABEL_Y = `${base_1.PREFIX}_LABEL_Y`;
11
+ exports.DEFAULT_LABEL_X = `${base_1.PREFIX}_LABEL_X`, exports.DEFAULT_LABEL_Y = `${base_1.PREFIX}_LABEL_Y`;
12
+ //# sourceMappingURL=label.js.map
@@ -6,5 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
 
7
7
  const base_1 = require("./base");
8
8
 
9
- exports.WaterfallDefaultSeriesField = `${base_1.PREFIX}_waterfall_default_seriesField`;
10
- //# sourceMappingURL=waterfall.js.map
9
+ exports.WaterfallDefaultSeriesField = `${base_1.PREFIX}_waterfall_default_seriesField`;
@@ -10,4 +10,4 @@ exports.WORD_CLOUD_ANGLE = `${base_1.PREFIX}_WORD_CLOUD_ANGLE`, exports.WORD_CLO
10
10
  exports.WORD_CLOUD_WEIGHT = `${base_1.PREFIX}_WORD_CLOUD_WEIGHT`, exports.WORDCLOUD_COLOR = `${base_1.PREFIX}_WORDCLOUD_COLOR`,
11
11
  exports.WORDCLOUD_DATA_TOTAL = `${base_1.PREFIX}_WORDCLOUD_DATA_TOTAL`, exports.WORD_CLOUD_TEXT = `${base_1.PREFIX}_WORD_CLOUD_TEXT`,
12
12
  exports.WORDCLOUD_SHAPE_DATA_TOTAL = `${base_1.PREFIX}_WORDCLOUD_SHAPE_DATA_TOTAL`;
13
- //# sourceMappingURL=word-cloud.js.map
13
+ //# sourceMappingURL=word-cloud.js.map
@@ -26,4 +26,5 @@ class ExpressionFunction {
26
26
  }
27
27
  }
28
28
 
29
- exports.ExpressionFunction = ExpressionFunction;
29
+ exports.ExpressionFunction = ExpressionFunction;
30
+ //# sourceMappingURL=expression-function.js.map
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "2.0.4-alpha.5";
4
+ export declare const version = "2.0.4-alpha.6";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export type { IRegion } from '../region/interface';
package/cjs/core/index.js CHANGED
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "Factory", {
35
35
  get: function() {
36
36
  return factory_1.Factory;
37
37
  }
38
- }), exports.version = "2.0.4-alpha.5", __exportStar(require("../event/interface"), exports),
38
+ }), exports.version = "2.0.4-alpha.6", __exportStar(require("../event/interface"), exports),
39
39
  __exportStar(require("../theme/interface"), exports), __exportStar(require("../model/interface"), exports),
40
40
  __exportStar(require("./interface"), exports), __exportStar(require("../typings"), exports),
41
41
  __exportStar(require("../constant/base"), exports), __exportStar(require("../constant/data"), exports),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,eAAe,CAAC;AAOvC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AAEnC,8CAA4B;AAC5B,6CAA2B;AAI3B,mDAAiC;AACjC,mDAAiC;AACjC,qDAAmC;AACnC,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AACvB,iDAAoD;AAA3C,4GAAA,cAAc,OAAA;AACvB,uDAA6D;AAApD,6GAAA,gBAAgB,OAAA;AACzB,2CAA+C;AAAtC,mGAAA,UAAU,OAAA;AAKnB,wDAAsC;AACtC,oDAAkC;AAGlC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAUgC;AAT9B,uGAAA,OAAO,OAAA;AACP,2GAAA,WAAW,OAAA;AACX,8GAAA,cAAc,OAAA;AACd,0GAAA,UAAU,OAAA;AACV,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,4GAAA,YAAY,OAAA;AAEd,6DAAsE;AAA7D,+GAAA,YAAY,OAAA;AAAE,8GAAA,WAAW,OAAA;AAGlC,gDAA8B;AAC9B,uCAAmD;AAA1C,2GAAA,kBAAkB,OAAA;AAC3B,0CAAgD;AAAvC,mGAAA,WAAW,OAAA;AACpB,6CAAmG;AAA1F,yHAAA,6BAA6B,OAAA;AAAE,4HAAA,gCAAgC,OAAA;AACxE,oDAAmD;AAA1C,gGAAA,MAAM,OAAA;AACf,uCAAqC;AAA5B,6FAAA,IAAI,OAAA;AACb,qCAA2C;AAAlC,mGAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.4-alpha.5\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,eAAe,CAAC;AAOvC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AAEnC,8CAA4B;AAC5B,6CAA2B;AAI3B,mDAAiC;AACjC,mDAAiC;AACjC,qDAAmC;AACnC,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AACvB,iDAAoD;AAA3C,4GAAA,cAAc,OAAA;AACvB,uDAA6D;AAApD,6GAAA,gBAAgB,OAAA;AACzB,2CAA+C;AAAtC,mGAAA,UAAU,OAAA;AAKnB,wDAAsC;AACtC,oDAAkC;AAGlC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAUgC;AAT9B,uGAAA,OAAO,OAAA;AACP,2GAAA,WAAW,OAAA;AACX,8GAAA,cAAc,OAAA;AACd,0GAAA,UAAU,OAAA;AACV,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,4GAAA,YAAY,OAAA;AAEd,6DAAsE;AAA7D,+GAAA,YAAY,OAAA;AAAE,8GAAA,WAAW,OAAA;AAGlC,gDAA8B;AAC9B,uCAAmD;AAA1C,2GAAA,kBAAkB,OAAA;AAC3B,0CAAgD;AAAvC,mGAAA,WAAW,OAAA;AACpB,6CAAmG;AAA1F,yHAAA,6BAA6B,OAAA;AAAE,4HAAA,gCAAgC,OAAA;AACxE,oDAAmD;AAA1C,gGAAA,MAAM,OAAA;AACf,uCAAqC;AAA5B,6FAAA,IAAI,OAAA;AACb,qCAA2C;AAAlC,mGAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.4-alpha.6\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
@@ -920,4 +920,4 @@ const registerVChartCore = () => {
920
920
  };
921
921
 
922
922
  exports.registerVChartCore = registerVChartCore, (0, exports.registerVChartCore)();
923
- //# sourceMappingURL=vchart.js.map
923
+ //# sourceMappingURL=vchart.js.map
package/cjs/util/style.js CHANGED
@@ -47,8 +47,9 @@ function transformIndicatorStyle(style, datum) {
47
47
  }
48
48
 
49
49
  function transformToGraphic(style) {
50
- return (null == style ? void 0 : style.angle) && (style.angle = (0, vutils_1.degreeToRadian)(style.angle)),
51
- style;
50
+ return (null == style ? void 0 : style.angle) ? Object.assign(Object.assign({}, style), {
51
+ angle: (0, vutils_1.degreeToRadian)(style.angle)
52
+ }) : style;
52
53
  }
53
54
 
54
55
  exports.transformComponentStyle = transformComponentStyle, exports.transformStateStyle = transformStateStyle,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":";;;AAAA,6CAAuE;AAUvE,SAAgB,uBAAuB,CAAC,MAAW,EAAE;IACnD,MAAM,SAAS,qBACV,GAAG,CACP,CAAC;IAEF,IAAI,IAAA,mBAAU,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACzB,SAAS,CAAC,KAAK,GAAG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,IAAA,gBAAO,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YACpC,aAAa,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC;AAhBD,oEAgBC;AAED,SAAgB,uBAAuB,CAAC,KAAU,EAAE,KAAU;IAC5D,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC/B,IAAI,IAAA,mBAAU,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;YAC1B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;SACxC;aAAM;YACL,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACjC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC;AAbD,0DAaC;AAED,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE;QAChB,KAAK,CAAC,KAAK,GAAG,IAAA,uBAAc,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAND,gDAMC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isFunction } from '@visactor/vutils';\nimport type { Datum } from '../typings';\nimport type { LegendItemDatum } from '@visactor/vrender-components';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n const newConfig = {\n ...cfg\n };\n\n if (isFunction(cfg.style)) {\n newConfig.style = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.style(item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.style)) {\n newConfig.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n const newStateStyle = {};\n Object.keys(cfg.state).forEach(key => {\n if (isFunction(cfg.state[key])) {\n newStateStyle[key] = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.state[key](item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.state[key])) {\n newStateStyle[key] = transformToGraphic(cfg.state[key]);\n }\n });\n newConfig.state = newStateStyle;\n }\n\n return newConfig;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (value: any, index: number, datum: Datum, data: Datum[]) =>\n transformToGraphic(stateStyle[key](value, index, datum, data));\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformAxisLabelStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (datum: Datum, index: number, data: Datum[], layer?: number) => {\n return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));\n };\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformIndicatorStyle(style: any, datum: any) {\n if (isEmpty(style)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(style).forEach(key => {\n if (isFunction(style[key])) {\n newStateStyle[key] = style[key](datum);\n } else {\n newStateStyle[key] = style[key];\n }\n });\n return transformToGraphic(newStateStyle);\n}\n\nexport function transformToGraphic(style: any) {\n if (style?.angle) {\n style.angle = degreeToRadian(style.angle);\n }\n\n return style;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":";;;AAAA,6CAAuE;AAUvE,SAAgB,uBAAuB,CAAC,MAAW,EAAE;IACnD,MAAM,SAAS,qBACV,GAAG,CACP,CAAC;IAEF,IAAI,IAAA,mBAAU,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACzB,SAAS,CAAC,KAAK,GAAG,CAAC,IAAqB,EAAE,UAAmB,EAAE,KAAa,EAAE,QAA2B,EAAE,EAAE,CAC3G,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;KACpE;SAAM,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC9B,SAAS,CAAC,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,aAAa,GAAG,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,IAAA,mBAAU,EAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC9B,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAqB,EAAE,UAAmB,EAAE,KAAa,EAAE,QAA2B,EAAE,EAAE,CAC9G,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;aACzE;iBAAM,IA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,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE;QAChB,uCACK,KAAK,KACR,KAAK,EAAE,IAAA,uBAAc,EAAC,KAAK,CAAC,KAAK,CAAC,IAClC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AATD,gDASC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isFunction } from '@visactor/vutils';\nimport type { Datum } from '../typings';\nimport type { LegendItemDatum } from '@visactor/vrender-components';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n const newConfig = {\n ...cfg\n };\n\n if (isFunction(cfg.style)) {\n newConfig.style = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.style(item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.style)) {\n newConfig.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n const newStateStyle = {};\n Object.keys(cfg.state).forEach(key => {\n if (isFunction(cfg.state[key])) {\n newStateStyle[key] = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.state[key](item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.state[key])) {\n newStateStyle[key] = transformToGraphic(cfg.state[key]);\n }\n });\n newConfig.state = newStateStyle;\n }\n\n return newConfig;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (value: any, index: number, datum: Datum, data: Datum[]) =>\n transformToGraphic(stateStyle[key](value, index, datum, data));\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformAxisLabelStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (datum: Datum, index: number, data: Datum[], layer?: number) => {\n return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));\n };\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformIndicatorStyle(style: any, datum: any) {\n if (isEmpty(style)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(style).forEach(key => {\n if (isFunction(style[key])) {\n newStateStyle[key] = style[key](datum);\n } else {\n newStateStyle[key] = style[key];\n }\n });\n return transformToGraphic(newStateStyle);\n}\n\nexport function transformToGraphic(style: any) {\n if (style?.angle) {\n return {\n ...style,\n angle: degreeToRadian(style.angle)\n };\n }\n\n return style;\n}\n"]}
@@ -7,5 +7,4 @@ export var AttributeLevel;
7
7
  AttributeLevel[AttributeLevel.User_Chart = 6] = "User_Chart", AttributeLevel[AttributeLevel.User_Series = 7] = "User_Series",
8
8
  AttributeLevel[AttributeLevel.User_Mark = 8] = "User_Mark", AttributeLevel[AttributeLevel.User_SeriesStyle = 9] = "User_SeriesStyle",
9
9
  AttributeLevel[AttributeLevel.Built_In = 99] = "Built_In";
10
- }(AttributeLevel || (AttributeLevel = {}));
11
- //# sourceMappingURL=attribute.js.map
10
+ }(AttributeLevel || (AttributeLevel = {}));
@@ -10,4 +10,5 @@ export const DEFAULT_LABEL_VISIBLE = `${PREFIX}_LABEL_VISIBLE`;
10
10
 
11
11
  export const DEFAULT_LABEL_X = `${PREFIX}_LABEL_X`;
12
12
 
13
- export const DEFAULT_LABEL_Y = `${PREFIX}_LABEL_Y`;
13
+ export const DEFAULT_LABEL_Y = `${PREFIX}_LABEL_Y`;
14
+ //# sourceMappingURL=label.js.map
@@ -1,4 +1,3 @@
1
1
  import { PREFIX } from "./base";
2
2
 
3
- export const WaterfallDefaultSeriesField = `${PREFIX}_waterfall_default_seriesField`;
4
- //# sourceMappingURL=waterfall.js.map
3
+ export const WaterfallDefaultSeriesField = `${PREFIX}_waterfall_default_seriesField`;
@@ -13,4 +13,4 @@ export const WORDCLOUD_DATA_TOTAL = `${PREFIX}_WORDCLOUD_DATA_TOTAL`;
13
13
  export const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
14
14
 
15
15
  export const WORDCLOUD_SHAPE_DATA_TOTAL = `${PREFIX}_WORDCLOUD_SHAPE_DATA_TOTAL`;
16
- //# sourceMappingURL=word-cloud.js.map
16
+ //# sourceMappingURL=word-cloud.js.map
@@ -18,4 +18,5 @@ export class ExpressionFunction {
18
18
  getFunctionNameList() {
19
19
  return Object.keys(this.functions);
20
20
  }
21
- }
21
+ }
22
+ //# sourceMappingURL=expression-function.js.map
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "2.0.4-alpha.5";
4
+ export declare const version = "2.0.4-alpha.6";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export type { IRegion } from '../region/interface';
package/esm/core/index.js CHANGED
@@ -4,7 +4,7 @@ import { Factory } from "./factory";
4
4
 
5
5
  export { VChart, Factory };
6
6
 
7
- export const version = "2.0.4-alpha.5";
7
+ export const version = "2.0.4-alpha.6";
8
8
 
9
9
  export * from "../event/interface";
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAOvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.4-alpha.5\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAOvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.4-alpha.6\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
@@ -981,4 +981,4 @@ export const registerVChartCore = () => {
981
981
  Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
982
982
  registerGroupMark(), registerGesturePlugin(), registerElementHighlight(), registerElementSelect(),
983
983
  registerTheme(darkTheme.name, darkTheme);
984
- //# sourceMappingURL=vchart.js.map
984
+ //# sourceMappingURL=vchart.js.map
package/esm/util/style.js CHANGED
@@ -37,7 +37,8 @@ export function transformIndicatorStyle(style, datum) {
37
37
  }
38
38
 
39
39
  export function transformToGraphic(style) {
40
- return (null == style ? void 0 : style.angle) && (style.angle = degreeToRadian(style.angle)),
41
- style;
40
+ return (null == style ? void 0 : style.angle) ? Object.assign(Object.assign({}, style), {
41
+ angle: degreeToRadian(style.angle)
42
+ }) : style;
42
43
  }
43
44
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAUvE,MAAM,UAAU,uBAAuB,CAAC,MAAW,EAAE;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YACxF,CAAC,CAAC;SACH;aAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YACpC,aAAa,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAU,EAAE,KAAU;IAC5D,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC/B,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;YAC1B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;SACxC;aAAM;YACL,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACjC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAU;IAC3C,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE;QAChB,KAAK,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,OAAO,KAAK,CAAC;AACf,CAAC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isFunction } from '@visactor/vutils';\nimport type { Datum } from '../typings';\nimport type { LegendItemDatum } from '@visactor/vrender-components';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n const newConfig = {\n ...cfg\n };\n\n if (isFunction(cfg.style)) {\n newConfig.style = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.style(item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.style)) {\n newConfig.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n const newStateStyle = {};\n Object.keys(cfg.state).forEach(key => {\n if (isFunction(cfg.state[key])) {\n newStateStyle[key] = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.state[key](item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.state[key])) {\n newStateStyle[key] = transformToGraphic(cfg.state[key]);\n }\n });\n newConfig.state = newStateStyle;\n }\n\n return newConfig;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (value: any, index: number, datum: Datum, data: Datum[]) =>\n transformToGraphic(stateStyle[key](value, index, datum, data));\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformAxisLabelStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (datum: Datum, index: number, data: Datum[], layer?: number) => {\n return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));\n };\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformIndicatorStyle(style: any, datum: any) {\n if (isEmpty(style)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(style).forEach(key => {\n if (isFunction(style[key])) {\n newStateStyle[key] = style[key](datum);\n } else {\n newStateStyle[key] = style[key];\n }\n });\n return transformToGraphic(newStateStyle);\n}\n\nexport function transformToGraphic(style: any) {\n if (style?.angle) {\n style.angle = degreeToRadian(style.angle);\n }\n\n return style;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAUvE,MAAM,UAAU,uBAAuB,CAAC,MAAW,EAAE;IACnD,MAAM,SAAS,qBACV,GAAG,CACP,CAAC;IAEF,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACzB,SAAS,CAAC,KAAK,GAAG,CAAC,IAAqB,EAAE,UAAmB,EAAE,KAAa,EAAE,QAA2B,EAAE,EAAE,CAC3G,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;KACpE;SAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC9B,SAAS,CAAC,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,aAAa,GAAG,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC9B,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAqB,EAAE,UAAmB,EAAE,KAAa,EAAE,QAA2B,EAAE,EAAE,CAC9G,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;aAC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,KAAK,CAAC,KAAK,CAAC,IAClC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isFunction } from '@visactor/vutils';\nimport type { Datum } from '../typings';\nimport type { LegendItemDatum } from '@visactor/vrender-components';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n const newConfig = {\n ...cfg\n };\n\n if (isFunction(cfg.style)) {\n newConfig.style = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.style(item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.style)) {\n newConfig.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n const newStateStyle = {};\n Object.keys(cfg.state).forEach(key => {\n if (isFunction(cfg.state[key])) {\n newStateStyle[key] = (item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) =>\n transformToGraphic(cfg.state[key](item, isSelected, index, allItems));\n } else if (!isEmpty(cfg.state[key])) {\n newStateStyle[key] = transformToGraphic(cfg.state[key]);\n }\n });\n newConfig.state = newStateStyle;\n }\n\n return newConfig;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (value: any, index: number, datum: Datum, data: Datum[]) =>\n transformToGraphic(stateStyle[key](value, index, datum, data));\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformAxisLabelStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(stateStyle).forEach(key => {\n if (isFunction(stateStyle[key])) {\n newStateStyle[key] = (datum: Datum, index: number, data: Datum[], layer?: number) => {\n return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));\n };\n } else if (!isEmpty(stateStyle[key])) {\n newStateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return newStateStyle;\n}\n\nexport function transformIndicatorStyle(style: any, datum: any) {\n if (isEmpty(style)) {\n return null;\n }\n const newStateStyle = {};\n Object.keys(style).forEach(key => {\n if (isFunction(style[key])) {\n newStateStyle[key] = style[key](datum);\n } else {\n newStateStyle[key] = style[key];\n }\n });\n return transformToGraphic(newStateStyle);\n}\n\nexport function transformToGraphic(style: any) {\n if (style?.angle) {\n return {\n ...style,\n angle: degreeToRadian(style.angle)\n };\n }\n\n return style;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vchart",
3
- "version": "2.0.4-alpha.5",
3
+ "version": "2.0.4-alpha.6",
4
4
  "description": "charts lib based @visactor/VGrammar",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -83,8 +83,8 @@
83
83
  "cross-env": "^7.0.3",
84
84
  "@internal/typescript-json-schema": "0.0.1",
85
85
  "@internal/bundler": "0.0.1",
86
- "@internal/ts-config": "0.0.1",
87
- "@internal/eslint-config": "0.0.1"
86
+ "@internal/eslint-config": "0.0.1",
87
+ "@internal/ts-config": "0.0.1"
88
88
  },
89
89
  "dependencies": {
90
90
  "@visactor/vutils": "~1.0.6",
@@ -95,7 +95,7 @@
95
95
  "@visactor/vrender-kits": "1.0.9",
96
96
  "@visactor/vrender-components": "1.0.9",
97
97
  "@visactor/vrender-animate": "1.0.9",
98
- "@visactor/vutils-extension": "2.0.4-alpha.5"
98
+ "@visactor/vutils-extension": "2.0.4-alpha.6"
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public",