@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.
- package/cjs/components/axis/get-axis-attributes.d.ts +7 -0
- package/cjs/components/axis/get-axis-attributes.js +13 -17
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/media-click.js +1 -2
- package/cjs/event/sparkline-event.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.js +7 -5
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js +17 -7
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +3 -3
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +2 -4
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/Rect.js +1 -1
- package/cjs/ts-types/base-table.js +1 -1
- package/cjs/ts-types/common.js +1 -1
- package/cjs/ts-types/customElement.js +1 -1
- package/dist/vtable.js +29 -12
- package/dist/vtable.min.js +2 -2
- package/es/components/axis/get-axis-attributes.d.ts +7 -0
- package/es/components/axis/get-axis-attributes.js +1 -1
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/media-click.js +1 -2
- package/es/event/sparkline-event.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.js +7 -5
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/es/layout/chart-helper/get-axis-domain.js +19 -7
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +3 -3
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +2 -4
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/tools/LimitPromiseQueue.js +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/Rect.js +1 -1
- package/es/ts-types/base-table.js +1 -1
- package/es/ts-types/common.js +1 -1
- package/es/ts-types/customElement.js +1 -1
- 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;
|
|
@@ -19,7 +19,7 @@ export const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-
|
|
|
19
19
|
|
|
20
20
|
export const DEFAULT_TEXT_FONT_SIZE = 14;
|
|
21
21
|
|
|
22
|
-
const THEME_CONSTANTS = {
|
|
22
|
+
export const THEME_CONSTANTS = {
|
|
23
23
|
FONT_FAMILY: DEFAULT_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CAAC,CAAC,IAAI;YACrD,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1E,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAC3B,KAAK,EAAE;gBACL,OAAO,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,OAAO;gBAClC,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK;gBAC9B,KAAK,EAAE,kBAAkB,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,CAAC;aACnD;YACD,UAAU,EAAE;gBACV,OAAO,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,0CAAE,OAAO;gBACvC,KAAK,EAAE,kBAAkB,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC;aACxD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC3C,KAAK,EAAE,mBAAmB,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,CAAC;gBACnD,UAAU,EAAE,mBAAmB,CAAC,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,kBAAkB,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;YACjD,KAAK,EAAE,mBAAmB,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;SACnD;KACF,CAAC;AACJ,CAAC","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,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;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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AC,UAAU,0CAAE,OAAO;gBACvC,KAAK,EAAE,kBAAkB,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC;aACxD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC3C,KAAK,EAAE,mBAAmB,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,CAAC;gBACnD,UAAU,EAAE,mBAAmB,CAAC,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,kBAAkB,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;YACjD,KAAK,EAAE,mBAAmB,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC;SACnD;KACF,CAAC;AACJ,CAAC","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"]}
|
package/es/core/BaseTable.js
CHANGED
|
@@ -72,7 +72,7 @@ export class BaseTable extends EventTarget {
|
|
|
72
72
|
}
|
|
73
73
|
constructor(container, options = {}) {
|
|
74
74
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75
|
-
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.13.
|
|
75
|
+
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.13.4-alpha.2",
|
|
76
76
|
this.id = `VTable${Date.now()}`, this.isReleased = !1, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
77
77
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
78
78
|
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 = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options;
|