@visactor/vtable 0.13.3 → 0.13.4-alpha.2

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.
Files changed (53) hide show
  1. package/cjs/components/axis/get-axis-attributes.d.ts +7 -0
  2. package/cjs/components/axis/get-axis-attributes.js +13 -17
  3. package/cjs/components/axis/get-axis-attributes.js.map +1 -1
  4. package/cjs/core/BaseTable.js +1 -1
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/event/media-click.js +1 -2
  7. package/cjs/event/sparkline-event.js +2 -1
  8. package/cjs/index.d.ts +1 -1
  9. package/cjs/index.js +1 -1
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/layout/chart-helper/get-axis-config.js +7 -5
  12. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  13. package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -1
  14. package/cjs/layout/chart-helper/get-axis-domain.js +17 -7
  15. package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
  16. package/cjs/layout/chart-helper/get-chart-spec.js +3 -3
  17. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  18. package/cjs/scenegraph/layout/update-height.js +2 -4
  19. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  20. package/cjs/tools/LimitPromiseQueue.js +1 -1
  21. package/cjs/tools/NumberMap.js +1 -1
  22. package/cjs/tools/Rect.js +1 -1
  23. package/cjs/ts-types/base-table.js +1 -1
  24. package/cjs/ts-types/common.js +1 -1
  25. package/cjs/ts-types/customElement.js +1 -1
  26. package/dist/vtable.js +29 -12
  27. package/dist/vtable.min.js +2 -2
  28. package/es/components/axis/get-axis-attributes.d.ts +7 -0
  29. package/es/components/axis/get-axis-attributes.js +1 -1
  30. package/es/components/axis/get-axis-attributes.js.map +1 -1
  31. package/es/core/BaseTable.js +1 -1
  32. package/es/core/BaseTable.js.map +1 -1
  33. package/es/event/media-click.js +1 -2
  34. package/es/event/sparkline-event.js +2 -1
  35. package/es/index.d.ts +1 -1
  36. package/es/index.js +1 -1
  37. package/es/index.js.map +1 -1
  38. package/es/layout/chart-helper/get-axis-config.js +7 -5
  39. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  40. package/es/layout/chart-helper/get-axis-domain.d.ts +1 -1
  41. package/es/layout/chart-helper/get-axis-domain.js +19 -7
  42. package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
  43. package/es/layout/chart-helper/get-chart-spec.js +3 -3
  44. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  45. package/es/scenegraph/layout/update-height.js +2 -4
  46. package/es/scenegraph/layout/update-height.js.map +1 -1
  47. package/es/tools/LimitPromiseQueue.js +1 -1
  48. package/es/tools/NumberMap.js +1 -1
  49. package/es/tools/Rect.js +1 -1
  50. package/es/ts-types/base-table.js +1 -1
  51. package/es/ts-types/common.js +1 -1
  52. package/es/ts-types/customElement.js +1 -1
  53. package/package.json +3 -3
@@ -1,6 +1,13 @@
1
1
  import type { ICellAxisOption } from '../../ts-types/component/axis';
2
2
  export declare const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";
3
3
  export declare const DEFAULT_TEXT_FONT_SIZE = 14;
4
+ export declare const THEME_CONSTANTS: {
5
+ FONT_FAMILY: string;
6
+ LABEL_FONT_SIZE: number;
7
+ MAP_LABEL_FONT_SIZE: number;
8
+ TITLE_FONT_SIZE: number;
9
+ AXIS_TICK_SIZE: number;
10
+ };
4
11
  export declare const commonAxis: {
5
12
  domainLine: {
6
13
  visible: boolean;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.getAxisAttributes = exports.commonAxis = exports.DEFAULT_TEXT_FONT_SIZE = exports.DEFAULT_TEXT_FONT_FAMILY = void 0;
5
+ }), exports.getAxisAttributes = exports.commonAxis = exports.THEME_CONSTANTS = exports.DEFAULT_TEXT_FONT_SIZE = exports.DEFAULT_TEXT_FONT_FAMILY = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), transform_1 = require("../util/transform"), DEFAULT_TITLE_STYLE = {
8
8
  left: {
@@ -17,17 +17,6 @@ const vutils_1 = require("@visactor/vutils"), transform_1 = require("../util/tra
17
17
  angle: {}
18
18
  };
19
19
 
20
- exports.DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
21
- exports.DEFAULT_TEXT_FONT_SIZE = 14;
22
-
23
- const THEME_CONSTANTS = {
24
- FONT_FAMILY: exports.DEFAULT_TEXT_FONT_FAMILY,
25
- LABEL_FONT_SIZE: exports.DEFAULT_TEXT_FONT_SIZE,
26
- MAP_LABEL_FONT_SIZE: 10,
27
- TITLE_FONT_SIZE: 18,
28
- AXIS_TICK_SIZE: 4
29
- };
30
-
31
20
  function getAxisAttributes(option) {
32
21
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
33
22
  const spec = (0, vutils_1.merge)({}, option);
@@ -107,7 +96,14 @@ function getAxisAttributes(option) {
107
96
  };
108
97
  }
109
98
 
110
- exports.commonAxis = {
99
+ exports.DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
100
+ exports.DEFAULT_TEXT_FONT_SIZE = 14, exports.THEME_CONSTANTS = {
101
+ FONT_FAMILY: exports.DEFAULT_TEXT_FONT_FAMILY,
102
+ LABEL_FONT_SIZE: exports.DEFAULT_TEXT_FONT_SIZE,
103
+ MAP_LABEL_FONT_SIZE: 10,
104
+ TITLE_FONT_SIZE: 18,
105
+ AXIS_TICK_SIZE: 4
106
+ }, exports.commonAxis = {
111
107
  domainLine: {
112
108
  visible: !0,
113
109
  style: {
@@ -136,7 +132,7 @@ exports.commonAxis = {
136
132
  },
137
133
  tick: {
138
134
  visible: !0,
139
- tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE,
135
+ tickSize: exports.THEME_CONSTANTS.AXIS_TICK_SIZE,
140
136
  style: {
141
137
  lineWidth: 1,
142
138
  stroke: "#D9DDE4",
@@ -145,7 +141,7 @@ exports.commonAxis = {
145
141
  },
146
142
  subTick: {
147
143
  visible: !1,
148
- tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE / 2,
144
+ tickSize: exports.THEME_CONSTANTS.AXIS_TICK_SIZE / 2,
149
145
  style: {
150
146
  lineWidth: 1,
151
147
  stroke: "#D9DDE4",
@@ -156,7 +152,7 @@ exports.commonAxis = {
156
152
  visible: !0,
157
153
  space: 1,
158
154
  style: {
159
- fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,
155
+ fontSize: exports.THEME_CONSTANTS.LABEL_FONT_SIZE,
160
156
  fill: "#89909D",
161
157
  fontWeight: "normal",
162
158
  fillOpacity: 1
@@ -165,7 +161,7 @@ exports.commonAxis = {
165
161
  title: {
166
162
  space: 10,
167
163
  style: {
168
- fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,
164
+ fontSize: exports.THEME_CONSTANTS.LABEL_FONT_SIZE,
169
165
  fill: "#333333",
170
166
  fontWeight: "normal",
171
167
  fillOpacity: 1
@@ -1 +1 @@
1
- {"version":3,"sources":["components/axis/get-axis-attributes.ts"],"names":[],"mappings":";;;AAAA,6CAA6E;AAC7E,iDAAoG;AAGpG,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;KACvB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;KACvB;IACD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;CACV,CAAC;AAEW,QAAA,wBAA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AA,8BAAkB,EAAC,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC;aACxD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,IAAA,+BAAmB,EAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC3C,KAAK,EAAE,IAAA,+BAAmB,EAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,CAAC;gBACnD,UAAU,EAAE,IAAA,+BAAmB,EAAC,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC;aAC9D;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO;YACjC,KAAK,EAAE,IAAA,8BAAkB,EAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;YACjD,KAAK,EAAE,IAAA,+BAAmB,EAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;SACnD;KACF,CAAC;AACJ,CAAC;AAjHD,8CAiHC","file":"get-axis-attributes.js","sourcesContent":["import { degreeToRadian, isNil, merge, pickWithout } from '@visactor/vutils';\nimport { transformAxisLineStyle, transformStateStyle, transformToGraphic } from '../util/transform';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\n\nconst DEFAULT_TITLE_STYLE = {\n left: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n right: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n radius: {},\n angle: {}\n};\n\nexport const DEFAULT_TEXT_FONT_FAMILY =\n // eslint-disable-next-line max-len\n 'PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol';\n\nexport const DEFAULT_TEXT_FONT_SIZE = 14;\n\nconst THEME_CONSTANTS = {\n FONT_FAMILY: DEFAULT_TEXT_FONT_FAMILY,\n LABEL_FONT_SIZE: DEFAULT_TEXT_FONT_SIZE,\n MAP_LABEL_FONT_SIZE: 10,\n TITLE_FONT_SIZE: 18,\n AXIS_TICK_SIZE: 4\n};\n\nexport const commonAxis = {\n domainLine: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n grid: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#EBEDF2',\n strokeOpacity: 1,\n lineDash: [] as any[]\n }\n },\n subGrid: {\n visible: false,\n style: {\n lineWidth: 1,\n stroke: '#EBEDF2',\n strokeOpacity: 1,\n lineDash: [4, 4]\n }\n },\n tick: {\n visible: true,\n tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE / 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n label: {\n visible: true,\n space: 1, // hack: VChart中为0,为了方便fs调试暂时改为1\n style: {\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,\n fill: '#89909D',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n title: {\n space: 10,\n style: {\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n }\n};\n\nexport function getAxisAttributes(option: ICellAxisOption) {\n const spec = merge({}, option);\n // const spec = option;\n let titleAngle = spec.title?.angle ?? 0;\n let titleTextStyle;\n if (spec.orient === 'left' || spec.orient === 'right') {\n // 处理纵轴的标题样式\n if (spec.title?.autoRotate && isNil(spec.title.angle)) {\n titleAngle = spec.orient === 'left' ? -90 : 90;\n titleTextStyle = DEFAULT_TITLE_STYLE[spec.orient];\n }\n }\n\n const labelSpec = pickWithout(spec.label, ['style', 'formatMethod', 'state']);\n\n return {\n orient: spec.orient,\n select: spec.select,\n hover: spec.hover,\n line: transformAxisLineStyle(spec.domainLine),\n label: {\n style:\n // isFunction(spec.label.style)\n // ? (datum: Datum, index: number) => {\n // const style = this._preprocessSpec(spec.label.style(datum.rawValue, index, datum));\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.label?.style, style)));\n // }\n // :\n transformToGraphic(spec.label.style),\n formatMethod: spec.label.formatMethod\n ? (value: any, datum: any, index: number) => {\n return spec.label.formatMethod(datum.rawValue, datum);\n }\n : null,\n state: transformStateStyle(spec.label.state),\n ...labelSpec\n },\n tick: {\n visible: spec.tick.visible,\n length: spec.tick.tickSize,\n inside: spec.tick.inside,\n alignWithLabel: spec.tick.alignWithLabel,\n style:\n // isFunction(spec.tick.style)\n // ? (datum: Datum, index: number) => {\n // const style = this._preprocessSpec(spec.tick.style(datum.rawValue, index, datum));\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.tick?.style, style)));\n // }\n // :\n transformToGraphic(spec.tick.style),\n state: transformStateStyle(spec.tick.state),\n dataFilter: spec.tick.dataFilter\n },\n subTick: {\n visible: spec.subTick.visible,\n length: spec.subTick.tickSize,\n inside: spec.subTick.inside,\n count: spec.subTick.tickCount,\n style: transformToGraphic(spec.subTick.style),\n state: transformStateStyle(spec.subTick.state)\n },\n grid: {\n type: 'line',\n visible: spec.grid.visible,\n alternateColor: spec.grid.alternateColor,\n alignWithLabel: spec.grid.alignWithLabel,\n style:\n // isFunction(spec.grid.style)\n // ? (datum: Datum, index: number) => {\n // const style = spec.grid.style(datum.datum?.rawValue, index, datum.datum);\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.grid?.style, style)));\n // }\n // :\n transformToGraphic(spec.grid.style)\n },\n subGrid: {\n type: 'line',\n visible: spec.subGrid.visible,\n alternateColor: spec.subGrid.alternateColor,\n style: transformToGraphic(spec.subGrid.style)\n },\n title: {\n visible: spec.title.visible,\n position: spec.title.position,\n space: spec.title.space,\n autoRotate: false, // 默认不对外提供该配置\n angle: titleAngle ? degreeToRadian(titleAngle) : null,\n textStyle: merge({}, titleTextStyle, transformToGraphic(spec.title.style)),\n padding: spec.title.padding,\n shape: {\n visible: spec.title.shape?.visible,\n space: spec.title.shape?.space,\n style: transformToGraphic(spec.title.shape?.style)\n },\n background: {\n visible: spec.title.background?.visible,\n style: transformToGraphic(spec.title.background?.style)\n },\n state: {\n text: transformStateStyle(spec.title.state),\n shape: transformStateStyle(spec.title.shape?.state),\n background: transformStateStyle(spec.title.background?.state)\n }\n },\n panel: {\n visible: spec.background?.visible,\n style: transformToGraphic(spec.background?.style),\n state: transformStateStyle(spec.background?.state)\n }\n };\n}\n"]}
1
+ {"version":3,"sources":["components/axis/get-axis-attributes.ts"],"names":[],"mappings":";;;AAAA,6CAA6E;AAC7E,iDAAoG;AAGpG,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;KACvB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;KACvB;IACD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;CACV,CAAC;AAEW,QAAA,wBAAwB,GAEnC,kJAAkJ,CAAC;AAExI,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAE5B,QAAA,eAAe,GAAG;IAC7B,WAAW,EAAE,gCAAwB;IACrC,eAAe,EAAE,8BAAsB;IACvC,mBAAmB,EAAE,EAAE;IACvB,eAAe,EAAE,EAAE;IACnB,cAAc,EAAE,CAAC;CAClB,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,CAAC;YAChB,QAAQ,EAA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AAK,EAAE,IAAA,+BAAmB,EAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;SACnD;KACF,CAAC;AACJ,CAAC;AAjHD,8CAiHC","file":"get-axis-attributes.js","sourcesContent":["import { degreeToRadian, isNil, merge, pickWithout } from '@visactor/vutils';\nimport { transformAxisLineStyle, transformStateStyle, transformToGraphic } from '../util/transform';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\n\nconst DEFAULT_TITLE_STYLE = {\n left: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n right: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n radius: {},\n angle: {}\n};\n\nexport const DEFAULT_TEXT_FONT_FAMILY =\n // eslint-disable-next-line max-len\n 'PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol';\n\nexport const DEFAULT_TEXT_FONT_SIZE = 14;\n\nexport const THEME_CONSTANTS = {\n FONT_FAMILY: DEFAULT_TEXT_FONT_FAMILY,\n LABEL_FONT_SIZE: DEFAULT_TEXT_FONT_SIZE,\n MAP_LABEL_FONT_SIZE: 10,\n TITLE_FONT_SIZE: 18,\n AXIS_TICK_SIZE: 4\n};\n\nexport const commonAxis = {\n domainLine: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n grid: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#EBEDF2',\n strokeOpacity: 1,\n lineDash: [] as any[]\n }\n },\n subGrid: {\n visible: false,\n style: {\n lineWidth: 1,\n stroke: '#EBEDF2',\n strokeOpacity: 1,\n lineDash: [4, 4]\n }\n },\n tick: {\n visible: true,\n tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n tickSize: THEME_CONSTANTS.AXIS_TICK_SIZE / 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n label: {\n visible: true,\n space: 1, // hack: VChart中为0,为了方便fs调试暂时改为1\n style: {\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,\n fill: '#89909D',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n title: {\n space: 10,\n style: {\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n }\n};\n\nexport function getAxisAttributes(option: ICellAxisOption) {\n const spec = merge({}, option);\n // const spec = option;\n let titleAngle = spec.title?.angle ?? 0;\n let titleTextStyle;\n if (spec.orient === 'left' || spec.orient === 'right') {\n // 处理纵轴的标题样式\n if (spec.title?.autoRotate && isNil(spec.title.angle)) {\n titleAngle = spec.orient === 'left' ? -90 : 90;\n titleTextStyle = DEFAULT_TITLE_STYLE[spec.orient];\n }\n }\n\n const labelSpec = pickWithout(spec.label, ['style', 'formatMethod', 'state']);\n\n return {\n orient: spec.orient,\n select: spec.select,\n hover: spec.hover,\n line: transformAxisLineStyle(spec.domainLine),\n label: {\n style:\n // isFunction(spec.label.style)\n // ? (datum: Datum, index: number) => {\n // const style = this._preprocessSpec(spec.label.style(datum.rawValue, index, datum));\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.label?.style, style)));\n // }\n // :\n transformToGraphic(spec.label.style),\n formatMethod: spec.label.formatMethod\n ? (value: any, datum: any, index: number) => {\n return spec.label.formatMethod(datum.rawValue, datum);\n }\n : null,\n state: transformStateStyle(spec.label.state),\n ...labelSpec\n },\n tick: {\n visible: spec.tick.visible,\n length: spec.tick.tickSize,\n inside: spec.tick.inside,\n alignWithLabel: spec.tick.alignWithLabel,\n style:\n // isFunction(spec.tick.style)\n // ? (datum: Datum, index: number) => {\n // const style = this._preprocessSpec(spec.tick.style(datum.rawValue, index, datum));\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.tick?.style, style)));\n // }\n // :\n transformToGraphic(spec.tick.style),\n state: transformStateStyle(spec.tick.state),\n dataFilter: spec.tick.dataFilter\n },\n subTick: {\n visible: spec.subTick.visible,\n length: spec.subTick.tickSize,\n inside: spec.subTick.inside,\n count: spec.subTick.tickCount,\n style: transformToGraphic(spec.subTick.style),\n state: transformStateStyle(spec.subTick.state)\n },\n grid: {\n type: 'line',\n visible: spec.grid.visible,\n alternateColor: spec.grid.alternateColor,\n alignWithLabel: spec.grid.alignWithLabel,\n style:\n // isFunction(spec.grid.style)\n // ? (datum: Datum, index: number) => {\n // const style = spec.grid.style(datum.datum?.rawValue, index, datum.datum);\n\n // return transformToGraphic(this._preprocessSpec(merge({}, this._theme.grid?.style, style)));\n // }\n // :\n transformToGraphic(spec.grid.style)\n },\n subGrid: {\n type: 'line',\n visible: spec.subGrid.visible,\n alternateColor: spec.subGrid.alternateColor,\n style: transformToGraphic(spec.subGrid.style)\n },\n title: {\n visible: spec.title.visible,\n position: spec.title.position,\n space: spec.title.space,\n autoRotate: false, // 默认不对外提供该配置\n angle: titleAngle ? degreeToRadian(titleAngle) : null,\n textStyle: merge({}, titleTextStyle, transformToGraphic(spec.title.style)),\n padding: spec.title.padding,\n shape: {\n visible: spec.title.shape?.visible,\n space: spec.title.shape?.space,\n style: transformToGraphic(spec.title.shape?.style)\n },\n background: {\n visible: spec.title.background?.visible,\n style: transformToGraphic(spec.title.background?.style)\n },\n state: {\n text: transformStateStyle(spec.title.state),\n shape: transformStateStyle(spec.title.shape?.state),\n background: transformStateStyle(spec.title.background?.state)\n }\n },\n panel: {\n visible: spec.background?.visible,\n style: transformToGraphic(spec.background?.style),\n state: transformStateStyle(spec.background?.state)\n }\n };\n}\n"]}
@@ -45,7 +45,7 @@ class BaseTable extends EventTarget_1.EventTarget {
45
45
  }
46
46
  constructor(container, options = {}) {
47
47
  var _a, _b, _c, _d, _e, _f, _g;
48
- if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.13.3",
48
+ if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.13.4-alpha.2",
49
49
  this.id = `VTable${Date.now()}`, this.isReleased = !1, this.throttleInvalidate = (0,
50
50
  util_1.throttle2)(this.render.bind(this), 200), !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
51
51
  const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, keyboardOptions: keyboardOptions, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options;