@visactor/vtable 0.9.2 → 0.9.3-alpha.0
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/ListTable.d.ts +2 -1
- package/cjs/ListTable.js +17 -13
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +69 -0
- package/cjs/PivotChart.js +435 -0
- package/cjs/PivotChart.js.map +1 -0
- package/cjs/PivotTable.d.ts +2 -1
- package/cjs/PivotTable.js +18 -13
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style/MultilineTextStyle.js +2 -2
- package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -1
- package/cjs/body-helper/style/ProgressBarStyle.js +15 -15
- package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
- package/cjs/body-helper/style/Style.d.ts +0 -1
- package/cjs/body-helper/style/Style.js +25 -28
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/chartModule.js +14 -0
- package/cjs/chartModule.js.map +1 -0
- package/cjs/components/axis/axis.d.ts +45 -0
- package/cjs/components/axis/axis.js +146 -0
- package/cjs/components/axis/axis.js.map +1 -0
- package/cjs/components/axis/band-scale.d.ts +18 -0
- package/cjs/components/axis/band-scale.js +54 -0
- package/cjs/components/axis/band-scale.js.map +1 -0
- package/cjs/components/axis/get-axis-attributes.d.ts +136 -0
- package/cjs/components/axis/get-axis-attributes.js +169 -0
- package/cjs/components/axis/get-axis-attributes.js.map +1 -0
- package/cjs/components/axis/label-overlap.d.ts +3 -0
- package/cjs/components/axis/label-overlap.js +46 -0
- package/cjs/components/axis/label-overlap.js.map +1 -0
- package/cjs/components/axis/linear-scale.d.ts +45 -0
- package/cjs/components/axis/linear-scale.js +120 -0
- package/cjs/components/axis/linear-scale.js.map +1 -0
- package/cjs/components/legend/get-legend-attributes.d.ts +5 -0
- package/cjs/components/legend/get-legend-attributes.js +90 -0
- package/cjs/components/legend/get-legend-attributes.js.map +1 -0
- package/cjs/components/legend/legend.d.ts +23 -0
- package/cjs/components/legend/legend.js +94 -0
- package/cjs/components/legend/legend.js.map +1 -0
- package/{es → cjs/components}/menu/dom/BaseMenu.d.ts +2 -2
- package/cjs/components/menu/dom/BaseMenu.js.map +1 -0
- package/cjs/components/menu/dom/Menu.js.map +1 -0
- package/cjs/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
- package/cjs/{menu → components/menu}/dom/MenuHandler.js +1 -1
- package/cjs/components/menu/dom/MenuHandler.js.map +1 -0
- package/cjs/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
- package/cjs/{menu → components/menu}/dom/logic/MenuContainer.js +2 -2
- package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -0
- package/cjs/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
- package/cjs/{menu → components/menu}/dom/logic/MenuElement.js +4 -4
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -0
- package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
- package/cjs/components/title/title.d.ts +12 -0
- package/cjs/components/title/title.js +66 -0
- package/cjs/components/title/title.js.map +1 -0
- package/{es → cjs/components}/tooltip/BaseTooltip.d.ts +3 -3
- package/cjs/components/tooltip/BaseTooltip.js.map +1 -0
- package/cjs/components/tooltip/Tooltip.js.map +1 -0
- package/cjs/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
- package/cjs/{tooltip → components/tooltip}/TooltipHandler.js +1 -1
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -0
- package/{es → cjs/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
- package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
- package/cjs/components/util/orient.d.ts +3 -0
- package/cjs/components/util/orient.js +14 -0
- package/cjs/components/util/orient.js.map +1 -0
- package/cjs/components/util/register.d.ts +3 -0
- package/cjs/components/util/register.js +15 -0
- package/cjs/components/util/register.js.map +1 -0
- package/cjs/components/util/tick-data/config.d.ts +1 -0
- package/cjs/components/util/tick-data/config.js +6 -0
- package/cjs/components/util/tick-data/config.js.map +1 -0
- package/cjs/components/util/tick-data/continuous.d.ts +2 -0
- package/cjs/components/util/tick-data/continuous.js +39 -0
- package/cjs/components/util/tick-data/continuous.js.map +1 -0
- package/cjs/components/util/tick-data/discrete/linear.d.ts +2 -0
- package/cjs/components/util/tick-data/discrete/linear.js +66 -0
- package/cjs/components/util/tick-data/discrete/linear.js.map +1 -0
- package/cjs/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
- package/cjs/components/util/tick-data/discrete/polar-angle.js +46 -0
- package/cjs/components/util/tick-data/discrete/polar-angle.js.map +1 -0
- package/cjs/components/util/tick-data/index.d.ts +2 -0
- package/cjs/components/util/tick-data/index.js +17 -0
- package/cjs/components/util/tick-data/index.js.map +1 -0
- package/cjs/components/util/tick-data/util.d.ts +21 -0
- package/cjs/components/util/tick-data/util.js +115 -0
- package/cjs/components/util/tick-data/util.js.map +1 -0
- package/cjs/components/util/transform.d.ts +5 -0
- package/cjs/components/util/transform.js +45 -0
- package/cjs/components/util/transform.js.map +1 -0
- package/cjs/core/BaseTable.d.ts +18 -5
- package/cjs/core/BaseTable.js +115 -41
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +5 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +6 -1
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/core/tableHelper.js +1 -2
- package/cjs/data/CachedDataSource.js +2 -1
- package/cjs/data/DataSource.js +2 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.d.ts +60 -0
- package/cjs/dataset/dataset-pivot-table.js +387 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -0
- package/cjs/dataset/dataset.d.ts +14 -19
- package/cjs/dataset/dataset.js +183 -200
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +68 -0
- package/cjs/dataset/statistics-helper.js +173 -0
- package/cjs/dataset/statistics-helper.js.map +1 -0
- package/cjs/dataset/util/zero-align.d.ts +10 -0
- package/cjs/dataset/util/zero-align.js +119 -0
- package/cjs/dataset/util/zero-align.js.map +1 -0
- package/cjs/event/EventHandler.js.map +1 -1
- package/cjs/event/EventTarget.d.ts +5 -5
- package/cjs/event/EventTarget.js +2 -2
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/event/VChartEventProxy.d.ts +1 -0
- package/cjs/event/VChartEventProxy.js +1 -0
- package/cjs/event/VChartEventProxy.js.map +1 -0
- package/cjs/event/event.js +7 -4
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +8 -6
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.d.ts +2 -0
- package/cjs/event/pivot-chart/axis-click.js +42 -0
- package/cjs/event/pivot-chart/axis-click.js.map +1 -0
- package/cjs/event/pivot-chart/axis-hover.d.ts +2 -0
- package/cjs/event/pivot-chart/axis-hover.js +41 -0
- package/cjs/event/pivot-chart/axis-hover.js.map +1 -0
- package/cjs/event/scroll.js +4 -3
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/sparkline-event.js +1 -2
- package/cjs/event/sparkline-event.js.map +1 -1
- package/cjs/header-helper/header-helper.js +1 -1
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/header-helper/style/MultilineTextHeaderStyle.js +2 -2
- package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
- package/cjs/header-helper/style/Style.d.ts +0 -1
- package/cjs/header-helper/style/Style.js +25 -28
- package/cjs/header-helper/style/Style.js.map +1 -1
- package/cjs/index.d.ts +4 -3
- package/cjs/index.js +11 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/cjs/layout/chart-helper/get-axis-config.js +118 -0
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -0
- package/cjs/layout/chart-helper/get-chart-spec.d.ts +7 -0
- package/cjs/layout/chart-helper/get-chart-spec.js +135 -0
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -0
- package/cjs/layout/index.js +2 -1
- package/cjs/layout/pivot-header-layout.d.ts +13 -5
- package/cjs/layout/pivot-header-layout.js +50 -14
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/pivot-layout.d.ts +54 -8
- package/cjs/layout/pivot-layout.js +399 -91
- package/cjs/layout/pivot-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +10 -0
- package/cjs/layout/simple-header-layout.js +43 -2
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/{chartTypes.js → chartModules.js} +1 -1
- package/cjs/plugins/chartModules.js.map +1 -0
- package/cjs/register.d.ts +1 -1
- package/cjs/register.js +6 -6
- package/cjs/register.js.map +1 -1
- package/cjs/render/layout/text.d.ts +33 -4
- package/cjs/render/layout/text.js +9 -3
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +17 -16
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/menu.d.ts +41 -0
- package/cjs/scenegraph/component/table-component.js +3 -3
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +4 -1
- package/cjs/scenegraph/graphic/chart.js +29 -17
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +22 -3
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/text.d.ts +15 -0
- package/cjs/scenegraph/group-creater/cell-helper.js +9 -3
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +71 -0
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +29 -35
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +6 -6
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +23 -15
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +20 -9
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +1 -1
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-cell.js +3 -2
- package/cjs/scenegraph/layout/update-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +1 -1
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +33 -3
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +3 -0
- package/cjs/scenegraph/refresh-node/update-chart.js +76 -7
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +8 -0
- package/cjs/scenegraph/scenegraph.js +115 -19
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +10 -8
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/style/corner-cell.d.ts +3 -0
- package/cjs/scenegraph/style/corner-cell.js +29 -0
- package/cjs/scenegraph/style/corner-cell.js.map +1 -0
- package/cjs/scenegraph/style/frame-border.d.ts +1 -0
- package/cjs/scenegraph/style/frame-border.js +3 -7
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js +2 -1
- package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/DARK.js +1 -2
- package/cjs/themes/theme.d.ts +10 -0
- package/cjs/themes/theme.js +50 -4
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/LimitPromiseQueue.js +2 -1
- package/cjs/tools/calc.d.ts +3 -0
- package/cjs/tools/calc.js +11 -3
- package/cjs/tools/calc.js.map +1 -1
- package/cjs/tools/debounce.js +1 -1
- package/cjs/tools/diff-cell.js +2 -2
- package/cjs/tools/dom.js +1 -1
- package/cjs/tools/env.js +1 -1
- package/cjs/ts-types/base-table.d.ts +29 -12
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +0 -1
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/component/axis.d.ts +12 -0
- package/cjs/ts-types/component/axis.js +6 -0
- package/cjs/ts-types/component/axis.js.map +1 -0
- package/cjs/ts-types/component/legend.d.ts +5 -0
- package/cjs/ts-types/component/legend.js +6 -0
- package/cjs/ts-types/component/legend.js.map +1 -0
- package/cjs/ts-types/component/title.d.ts +47 -0
- package/cjs/ts-types/component/title.js +6 -0
- package/cjs/ts-types/component/title.js.map +1 -0
- package/cjs/ts-types/component/util.d.ts +1 -0
- package/cjs/ts-types/component/util.js +6 -0
- package/cjs/ts-types/component/util.js.map +1 -0
- package/cjs/ts-types/customElement.d.ts +2 -0
- package/cjs/ts-types/customElement.js.map +1 -1
- package/cjs/ts-types/events.d.ts +108 -83
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/list-table/define/chart-define.d.ts +1 -1
- package/cjs/ts-types/list-table/define/chart-define.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -2
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +19 -5
- package/cjs/ts-types/new-data-set.js +2 -2
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
- package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +3 -1
- package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +3 -3
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
- package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/index.d.ts +1 -0
- package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/cjs/ts-types/pivot-table/title.d.ts +1 -1
- package/cjs/ts-types/pivot-table/title.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +27 -3
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +5 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/dist/vtable.js +37522 -24362
- package/dist/vtable.min.js +4 -2
- package/es/ListTable.d.ts +2 -1
- package/es/ListTable.js +17 -13
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +69 -0
- package/es/PivotChart.js +445 -0
- package/es/PivotChart.js.map +1 -0
- package/es/PivotTable.d.ts +2 -1
- package/es/PivotTable.js +19 -14
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style/MultilineTextStyle.js +2 -2
- package/es/body-helper/style/MultilineTextStyle.js.map +1 -1
- package/es/body-helper/style/ProgressBarStyle.js +15 -15
- package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
- package/es/body-helper/style/Style.d.ts +0 -1
- package/es/body-helper/style/Style.js +25 -28
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/{chartType.js → chartModule.js} +2 -2
- package/es/chartModule.js.map +1 -0
- package/es/components/axis/axis.d.ts +45 -0
- package/es/components/axis/axis.js +155 -0
- package/es/components/axis/axis.js.map +1 -0
- package/es/components/axis/band-scale.d.ts +18 -0
- package/es/components/axis/band-scale.js +46 -0
- package/es/components/axis/band-scale.js.map +1 -0
- package/es/components/axis/get-axis-attributes.d.ts +136 -0
- package/es/components/axis/get-axis-attributes.js +166 -0
- package/es/components/axis/get-axis-attributes.js.map +1 -0
- package/es/components/axis/label-overlap.d.ts +3 -0
- package/es/components/axis/label-overlap.js +39 -0
- package/es/components/axis/label-overlap.js.map +1 -0
- package/es/components/axis/linear-scale.d.ts +45 -0
- package/es/components/axis/linear-scale.js +104 -0
- package/es/components/axis/linear-scale.js.map +1 -0
- package/es/components/legend/get-legend-attributes.d.ts +5 -0
- package/es/components/legend/get-legend-attributes.js +84 -0
- package/es/components/legend/get-legend-attributes.js.map +1 -0
- package/es/components/legend/legend.d.ts +23 -0
- package/es/components/legend/legend.js +93 -0
- package/es/components/legend/legend.js.map +1 -0
- package/{cjs → es/components}/menu/dom/BaseMenu.d.ts +2 -2
- package/es/components/menu/dom/BaseMenu.js.map +1 -0
- package/es/components/menu/dom/Menu.js.map +1 -0
- package/es/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
- package/es/{menu → components/menu}/dom/MenuHandler.js +2 -2
- package/es/components/menu/dom/MenuHandler.js.map +1 -0
- package/es/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
- package/es/{menu → components/menu}/dom/logic/MenuContainer.js +4 -4
- package/es/components/menu/dom/logic/MenuContainer.js.map +1 -0
- package/es/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
- package/es/{menu → components/menu}/dom/logic/MenuElement.js +9 -9
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -0
- package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
- package/es/components/title/title.d.ts +12 -0
- package/es/components/title/title.js +61 -0
- package/es/components/title/title.js.map +1 -0
- package/{cjs → es/components}/tooltip/BaseTooltip.d.ts +3 -3
- package/es/components/tooltip/BaseTooltip.js.map +1 -0
- package/es/components/tooltip/Tooltip.js.map +1 -0
- package/es/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
- package/es/{tooltip → components/tooltip}/TooltipHandler.js +4 -4
- package/es/components/tooltip/TooltipHandler.js.map +1 -0
- package/{cjs → es/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
- package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +4 -4
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
- package/es/components/util/orient.d.ts +3 -0
- package/es/components/util/orient.js +8 -0
- package/es/components/util/orient.js.map +1 -0
- package/es/components/util/register.d.ts +3 -0
- package/es/components/util/register.js +8 -0
- package/es/components/util/register.js.map +1 -0
- package/es/components/util/tick-data/config.d.ts +1 -0
- package/es/components/util/tick-data/config.js +2 -0
- package/es/components/util/tick-data/config.js.map +1 -0
- package/es/components/util/tick-data/continuous.d.ts +2 -0
- package/es/components/util/tick-data/continuous.js +38 -0
- package/es/components/util/tick-data/continuous.js.map +1 -0
- package/es/components/util/tick-data/discrete/linear.d.ts +2 -0
- package/es/components/util/tick-data/discrete/linear.js +59 -0
- package/es/components/util/tick-data/discrete/linear.js.map +1 -0
- package/es/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
- package/es/components/util/tick-data/discrete/polar-angle.js +39 -0
- package/es/components/util/tick-data/discrete/polar-angle.js.map +1 -0
- package/es/components/util/tick-data/index.d.ts +2 -0
- package/es/components/util/tick-data/index.js +19 -0
- package/es/components/util/tick-data/index.js.map +1 -0
- package/es/components/util/tick-data/util.d.ts +21 -0
- package/es/components/util/tick-data/util.js +104 -0
- package/es/components/util/tick-data/util.js.map +1 -0
- package/es/components/util/transform.d.ts +5 -0
- package/es/components/util/transform.js +34 -0
- package/es/components/util/transform.js.map +1 -0
- package/es/core/BaseTable.d.ts +18 -5
- package/es/core/BaseTable.js +119 -43
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +5 -0
- package/es/core/TABLE_EVENT_TYPE.js +6 -1
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/core/tableHelper.js +1 -2
- package/es/data/CachedDataSource.js +2 -1
- package/es/data/DataSource.js +2 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.d.ts +60 -0
- package/es/dataset/dataset-pivot-table.js +378 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -0
- package/es/dataset/dataset.d.ts +14 -19
- package/es/dataset/dataset.js +175 -190
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +68 -0
- package/es/dataset/statistics-helper.js +152 -0
- package/es/dataset/statistics-helper.js.map +1 -0
- package/es/dataset/util/zero-align.d.ts +10 -0
- package/es/dataset/util/zero-align.js +111 -0
- package/es/dataset/util/zero-align.js.map +1 -0
- package/es/event/EventHandler.js.map +1 -1
- package/es/event/EventTarget.d.ts +5 -5
- package/es/event/EventTarget.js +2 -2
- package/es/event/EventTarget.js.map +1 -1
- package/es/event/VChartEventProxy.d.ts +1 -0
- package/es/event/VChartEventProxy.js +1 -0
- package/es/event/VChartEventProxy.js.map +1 -0
- package/es/event/event.js +10 -3
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +8 -6
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/pivot-chart/axis-click.d.ts +2 -0
- package/es/event/pivot-chart/axis-click.js +36 -0
- package/es/event/pivot-chart/axis-click.js.map +1 -0
- package/es/event/pivot-chart/axis-hover.d.ts +2 -0
- package/es/event/pivot-chart/axis-hover.js +33 -0
- package/es/event/pivot-chart/axis-hover.js.map +1 -0
- package/es/event/scroll.js +4 -3
- package/es/event/scroll.js.map +1 -1
- package/es/event/sparkline-event.js +1 -2
- package/es/event/sparkline-event.js.map +1 -1
- package/es/header-helper/header-helper.js +1 -1
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/header-helper/style/MultilineTextHeaderStyle.js +2 -2
- package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
- package/es/header-helper/style/Style.d.ts +0 -1
- package/es/header-helper/style/Style.js +25 -28
- package/es/header-helper/style/Style.js.map +1 -1
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -2
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/es/layout/chart-helper/get-axis-config.js +110 -0
- package/es/layout/chart-helper/get-axis-config.js.map +1 -0
- package/es/layout/chart-helper/get-chart-spec.d.ts +7 -0
- package/es/layout/chart-helper/get-chart-spec.js +126 -0
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -0
- package/es/layout/index.js +2 -1
- package/es/layout/pivot-header-layout.d.ts +13 -5
- package/es/layout/pivot-header-layout.js +50 -12
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/pivot-layout.d.ts +54 -8
- package/es/layout/pivot-layout.js +402 -89
- package/es/layout/pivot-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +10 -0
- package/es/layout/simple-header-layout.js +44 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/chartModules.js +2 -0
- package/es/plugins/chartModules.js.map +1 -0
- package/es/register.d.ts +1 -1
- package/es/register.js +3 -3
- package/es/register.js.map +1 -1
- package/es/render/layout/text.d.ts +33 -4
- package/es/render/layout/text.js +9 -3
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/component/custom.js +17 -16
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/menu.d.ts +41 -0
- package/es/scenegraph/component/table-component.js +3 -3
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +4 -1
- package/es/scenegraph/graphic/chart.js +29 -15
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +22 -3
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
- package/es/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
- package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/text.d.ts +15 -0
- package/es/scenegraph/group-creater/cell-helper.js +10 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +65 -0
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +27 -34
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +6 -6
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +23 -15
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +20 -9
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +1 -1
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-cell.js +3 -1
- package/es/scenegraph/layout/update-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +1 -1
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +34 -2
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +3 -0
- package/es/scenegraph/refresh-node/update-chart.js +70 -4
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +8 -0
- package/es/scenegraph/scenegraph.js +117 -19
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +10 -8
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/style/corner-cell.d.ts +3 -0
- package/es/scenegraph/style/corner-cell.js +25 -0
- package/es/scenegraph/style/corner-cell.js.map +1 -0
- package/es/scenegraph/style/frame-border.d.ts +1 -0
- package/es/scenegraph/style/frame-border.js +2 -6
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/scenegraph/utils/get-cell-merge.js +2 -1
- package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/state/state.js.map +1 -1
- package/es/themes/DARK.js +1 -2
- package/es/themes/theme.d.ts +10 -0
- package/es/themes/theme.js +50 -4
- package/es/themes/theme.js.map +1 -1
- package/es/tools/LimitPromiseQueue.js +2 -1
- package/es/tools/calc.d.ts +3 -0
- package/es/tools/calc.js +10 -0
- package/es/tools/calc.js.map +1 -1
- package/es/tools/debounce.js +1 -1
- package/es/tools/diff-cell.js +1 -1
- package/es/tools/dom.js +1 -1
- package/es/tools/env.js +1 -1
- package/es/ts-types/base-table.d.ts +29 -12
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +0 -1
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/component/axis.d.ts +12 -0
- package/es/ts-types/component/axis.js +2 -0
- package/es/ts-types/component/axis.js.map +1 -0
- package/es/ts-types/component/legend.d.ts +5 -0
- package/es/ts-types/component/legend.js +2 -0
- package/es/ts-types/component/legend.js.map +1 -0
- package/es/ts-types/component/title.d.ts +47 -0
- package/es/ts-types/component/title.js +2 -0
- package/es/ts-types/component/title.js.map +1 -0
- package/es/ts-types/component/util.d.ts +1 -0
- package/es/ts-types/component/util.js +2 -0
- package/es/ts-types/component/util.js.map +1 -0
- package/es/ts-types/customElement.d.ts +2 -0
- package/es/ts-types/customElement.js.map +1 -1
- package/es/ts-types/events.d.ts +108 -83
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/list-table/define/chart-define.d.ts +1 -1
- package/es/ts-types/list-table/define/chart-define.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +4 -2
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +19 -5
- package/es/ts-types/new-data-set.js +2 -2
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
- package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +4 -0
- package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +3 -3
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
- package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/index.d.ts +1 -0
- package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/es/ts-types/pivot-table/title.d.ts +1 -1
- package/es/ts-types/pivot-table/title.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +27 -3
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +5 -0
- package/es/ts-types/theme.js.map +1 -1
- package/package.json +16 -10
- package/cjs/chartType.js +0 -14
- package/cjs/chartType.js.map +0 -1
- package/cjs/menu/dom/BaseMenu.js.map +0 -1
- package/cjs/menu/dom/Menu.js.map +0 -1
- package/cjs/menu/dom/MenuHandler.js.map +0 -1
- package/cjs/menu/dom/logic/MenuContainer.js.map +0 -1
- package/cjs/menu/dom/logic/MenuElement.js.map +0 -1
- package/cjs/menu/dom/logic/MenuElementStyle.js.map +0 -1
- package/cjs/plugins/chartTypes.js.map +0 -1
- package/cjs/scenegraph/layout/auto-width.d.ts +0 -2
- package/cjs/scenegraph/layout/auto-width.js +0 -85
- package/cjs/scenegraph/layout/auto-width.js.map +0 -1
- package/cjs/tooltip/BaseTooltip.js.map +0 -1
- package/cjs/tooltip/Tooltip.js.map +0 -1
- package/cjs/tooltip/TooltipHandler.js.map +0 -1
- package/cjs/tooltip/logic/BubbleTooltipElement.js.map +0 -1
- package/cjs/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
- package/es/chartType.js.map +0 -1
- package/es/menu/dom/BaseMenu.js.map +0 -1
- package/es/menu/dom/Menu.js.map +0 -1
- package/es/menu/dom/MenuHandler.js.map +0 -1
- package/es/menu/dom/logic/MenuContainer.js.map +0 -1
- package/es/menu/dom/logic/MenuElement.js.map +0 -1
- package/es/menu/dom/logic/MenuElementStyle.js.map +0 -1
- package/es/plugins/chartTypes.js +0 -2
- package/es/plugins/chartTypes.js.map +0 -1
- package/es/scenegraph/layout/auto-width.d.ts +0 -2
- package/es/scenegraph/layout/auto-width.js +0 -82
- package/es/scenegraph/layout/auto-width.js.map +0 -1
- package/es/tooltip/BaseTooltip.js.map +0 -1
- package/es/tooltip/Tooltip.js.map +0 -1
- package/es/tooltip/TooltipHandler.js.map +0 -1
- package/es/tooltip/logic/BubbleTooltipElement.js.map +0 -1
- package/es/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
- /package/cjs/{chartType.d.ts → chartModule.d.ts} +0 -0
- /package/cjs/{menu → components/menu}/dom/BaseMenu.js +0 -0
- /package/cjs/{menu → components/menu}/dom/Menu.d.ts +0 -0
- /package/cjs/{menu → components/menu}/dom/Menu.js +0 -0
- /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
- /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
- /package/cjs/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
- /package/cjs/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
- /package/cjs/{tooltip → components/tooltip}/Tooltip.js +0 -0
- /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
- /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
- /package/cjs/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
- /package/es/{chartType.d.ts → chartModule.d.ts} +0 -0
- /package/es/{menu → components/menu}/dom/BaseMenu.js +0 -0
- /package/es/{menu → components/menu}/dom/Menu.d.ts +0 -0
- /package/es/{menu → components/menu}/dom/Menu.js +0 -0
- /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
- /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
- /package/es/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
- /package/es/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
- /package/es/{tooltip → components/tooltip}/Tooltip.js +0 -0
- /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
- /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
- /package/es/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
package/cjs/dataset/dataset.js
CHANGED
|
@@ -4,35 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Dataset = void 0;
|
|
6
6
|
|
|
7
|
-
const ts_types_1 = require("../ts-types");
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), util_1 = require("../tools/util"), ts_types_1 = require("../ts-types"), statistics_helper_1 = require("./statistics-helper"), zero_align_1 = require("./util/zero-align");
|
|
8
8
|
|
|
9
9
|
class Dataset {
|
|
10
|
-
constructor(dataConfig, rows, columns,
|
|
11
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
10
|
+
constructor(dataConfig, rows, columns, indicatorKeys, records, customColTree, customRowTree) {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
12
12
|
this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {}, this.colKeys = [],
|
|
13
13
|
this.rowKeys = [], this.rowOrder = "key_a_to_z", this.colOrder = "key_a_to_z", this.sorted = !1,
|
|
14
14
|
this.indicatorStatistics = [], this.aggregators = {}, this.stringJoinChar = String.fromCharCode(0),
|
|
15
|
-
this.rowsIsTotal = [], this.colsIsTotal = [], this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
|
|
15
|
+
this.rowsIsTotal = [], this.colsIsTotal = [], this.collectedValues = {}, this.cacheCollectedValues = {},
|
|
16
|
+
this.registerAggregators(), this.dataConfig = dataConfig, this.sortRules = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.sortRules,
|
|
17
|
+
this.aggregationRules = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.aggregationRules,
|
|
18
|
+
this.derivedFieldRules = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.derivedFieldRules,
|
|
19
|
+
this.mappingRules = null === (_d = this.dataConfig) || void 0 === _d ? void 0 : _d.mappingRules,
|
|
20
|
+
this.totals = null === (_e = this.dataConfig) || void 0 === _e ? void 0 : _e.totals,
|
|
21
|
+
this.rows = rows, this.columns = columns, this.indicatorKeys = indicatorKeys, this.colGrandTotalLabel = null !== (_h = null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.column) || void 0 === _g ? void 0 : _g.grandTotalLabel) && void 0 !== _h ? _h : "总计",
|
|
22
|
+
this.colSubTotalLabel = null !== (_l = null === (_k = null === (_j = this.totals) || void 0 === _j ? void 0 : _j.column) || void 0 === _k ? void 0 : _k.subTotalLabel) && void 0 !== _l ? _l : "小计",
|
|
23
|
+
this.rowGrandTotalLabel = null !== (_p = null === (_o = null === (_m = this.totals) || void 0 === _m ? void 0 : _m.row) || void 0 === _o ? void 0 : _o.grandTotalLabel) && void 0 !== _p ? _p : "总计",
|
|
24
|
+
this.rowSubTotalLabel = null !== (_s = null === (_r = null === (_q = this.totals) || void 0 === _q ? void 0 : _q.row) || void 0 === _r ? void 0 : _r.subTotalLabel) && void 0 !== _s ? _s : "小计",
|
|
25
|
+
this.collectValuesBy = null !== (_u = null === (_t = this.dataConfig) || void 0 === _t ? void 0 : _t.collectValuesBy) && void 0 !== _u ? _u : {
|
|
26
|
+
230417170554008: {
|
|
27
|
+
by: [ "230417171050031", "230417171050028" ]
|
|
28
|
+
}
|
|
29
|
+
}, this.rowsIsTotal = new Array(this.rows.length).fill(!1), this.colsIsTotal = new Array(this.columns.length).fill(!1);
|
|
30
|
+
for (let i = 0, len = null === (_x = null === (_w = null === (_v = this.totals) || void 0 === _v ? void 0 : _v.row) || void 0 === _w ? void 0 : _w.subTotalsDimensions) || void 0 === _x ? void 0 : _x.length; i < len; i++) {
|
|
25
31
|
const dimension = this.totals.row.subTotalsDimensions[i], dimensionIndex = this.rows.indexOf(dimension);
|
|
26
32
|
this.rowsIsTotal[dimensionIndex] = !0;
|
|
27
33
|
}
|
|
28
|
-
for (let i = 0, len = null === (
|
|
34
|
+
for (let i = 0, len = null === (_0 = null === (_z = null === (_y = this.totals) || void 0 === _y ? void 0 : _y.column) || void 0 === _z ? void 0 : _z.subTotalsDimensions) || void 0 === _0 ? void 0 : _0.length; i < len; i++) {
|
|
29
35
|
const dimension = this.totals.column.subTotalsDimensions[i], dimensionIndex = this.columns.indexOf(dimension);
|
|
30
36
|
this.colsIsTotal[dimensionIndex] = !0;
|
|
31
37
|
}
|
|
32
38
|
if (records) {
|
|
33
39
|
this.records = records;
|
|
34
40
|
const t0 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
35
|
-
this.setRecords(records);
|
|
41
|
+
this.setRecords(records), this.processCollectedValuesWithSumBy();
|
|
36
42
|
const t1 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
37
43
|
console.log("processRecords:", t1 - t0);
|
|
38
44
|
const t4 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
@@ -44,36 +50,57 @@ class Dataset {
|
|
|
44
50
|
const t3 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
45
51
|
console.log("sortKeys:", t3 - t2);
|
|
46
52
|
const t7 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
47
|
-
this.rowKeysPath = this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal,
|
|
48
|
-
this.colKeysPath = this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal,
|
|
53
|
+
this.rowKeysPath = customRowTree ? this.TreeToArr2(customRowTree) : this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal, null === (_2 = null === (_1 = null == this ? void 0 : this.totals) || void 0 === _1 ? void 0 : _1.row) || void 0 === _2 ? void 0 : _2.showGrandTotals, this.rowGrandTotalLabel, this.rowSubTotalLabel)),
|
|
54
|
+
this.colKeysPath = customColTree ? this.TreeToArr2(customColTree) : this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal, null === (_4 = null === (_3 = this.totals) || void 0 === _3 ? void 0 : _3.column) || void 0 === _4 ? void 0 : _4.showGrandTotals, this.colGrandTotalLabel, this.colSubTotalLabel));
|
|
49
55
|
const t8 = "undefined" != typeof window ? window.performance.now() : 0;
|
|
50
|
-
console.log("TreeToArr:", t8 - t7)
|
|
56
|
+
console.log("TreeToArr:", t8 - t7), this.dataConfig.isPivotChart && (this.dealWithZeroAlign(),
|
|
57
|
+
this.cacheDeminsionCollectedValues());
|
|
51
58
|
}
|
|
52
|
-
delete this.rowFlatKeys, delete this.colFlatKeys;
|
|
53
59
|
}
|
|
54
60
|
registerAggregator(type, aggregator) {
|
|
55
61
|
this.aggregators[type] = aggregator;
|
|
56
62
|
}
|
|
57
63
|
registerAggregators() {
|
|
58
|
-
this.registerAggregator(ts_types_1.AggregationType.
|
|
59
|
-
this.registerAggregator(ts_types_1.AggregationType.
|
|
60
|
-
this.registerAggregator(ts_types_1.AggregationType.
|
|
64
|
+
this.registerAggregator(ts_types_1.AggregationType.RECORD, statistics_helper_1.RecordAggregator),
|
|
65
|
+
this.registerAggregator(ts_types_1.AggregationType.SUM, statistics_helper_1.SumAggregator),
|
|
66
|
+
this.registerAggregator(ts_types_1.AggregationType.COUNT, statistics_helper_1.CountAggregator),
|
|
67
|
+
this.registerAggregator(ts_types_1.AggregationType.MAX, statistics_helper_1.MaxAggregator),
|
|
68
|
+
this.registerAggregator(ts_types_1.AggregationType.MIN, statistics_helper_1.MinAggregator),
|
|
69
|
+
this.registerAggregator(ts_types_1.AggregationType.AVG, statistics_helper_1.AvgAggregator);
|
|
61
70
|
}
|
|
62
71
|
setRecords(records) {
|
|
63
72
|
this.processRecords();
|
|
64
73
|
}
|
|
74
|
+
processCollectedValuesWithSumBy() {
|
|
75
|
+
var _a;
|
|
76
|
+
for (const field in this.collectedValues) if (null === (_a = this.collectValuesBy[field]) || void 0 === _a ? void 0 : _a.sumBy) for (const byKeys in this.collectedValues[field]) {
|
|
77
|
+
const max = Object.values(this.collectedValues[field][byKeys]).reduce(((acc, cur) => cur.value() > acc ? cur.value() : acc), Number.MIN_SAFE_INTEGER), min = Object.values(this.collectedValues[field][byKeys]).reduce(((acc, cur) => cur.value() < acc ? cur.value() : acc), Number.MAX_SAFE_INTEGER);
|
|
78
|
+
this.collectedValues[field][byKeys] = {}, this.collectedValues[field][byKeys].max = max,
|
|
79
|
+
this.collectedValues[field][byKeys].min = min;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
65
82
|
processRecords() {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
let isNeedFilter = !1;
|
|
85
|
+
(null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) >= 1 && (isNeedFilter = !0);
|
|
66
86
|
for (let i = 0, len = this.records.length; i < len; i++) {
|
|
67
87
|
const record = this.records[i];
|
|
68
|
-
this.filterRecord(record)
|
|
88
|
+
isNeedFilter && !this.filterRecord(record) || this.processRecord(record);
|
|
69
89
|
}
|
|
90
|
+
this.rowFlatKeys = {}, this.colFlatKeys = {};
|
|
70
91
|
}
|
|
71
92
|
filterRecord(record) {
|
|
72
93
|
var _a, _b;
|
|
73
94
|
let isReserved = !0;
|
|
74
|
-
for (let i = 0; i <
|
|
75
|
-
const filterRule = this.dataConfig.filterRules[i];
|
|
76
|
-
if (
|
|
95
|
+
for (let i = 0; i < this.dataConfig.filterRules.length; i++) {
|
|
96
|
+
const filterRule = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules[i];
|
|
97
|
+
if (filterRule.filterKey) {
|
|
98
|
+
const filterValue = record[filterRule.filterKey];
|
|
99
|
+
if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
|
|
100
|
+
isReserved = !1;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
} else if (!(null === (_b = filterRule.filterFunc) || void 0 === _b ? void 0 : _b.call(filterRule, record))) {
|
|
77
104
|
isReserved = !1;
|
|
78
105
|
break;
|
|
79
106
|
}
|
|
@@ -81,7 +108,7 @@ class Dataset {
|
|
|
81
108
|
return isReserved;
|
|
82
109
|
}
|
|
83
110
|
processRecord(record) {
|
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
85
112
|
null === (_a = this.derivedFieldRules) || void 0 === _a || _a.forEach(((derivedFieldRule, i) => {
|
|
86
113
|
record[derivedFieldRule.fieldName] = derivedFieldRule.derivedFunc(record);
|
|
87
114
|
}));
|
|
@@ -94,30 +121,47 @@ class Dataset {
|
|
|
94
121
|
const colAttr = this.columns[n];
|
|
95
122
|
colKey.push(record[colAttr]);
|
|
96
123
|
}
|
|
124
|
+
for (const field in this.collectValuesBy) if (record[field]) {
|
|
125
|
+
this.collectedValues[field] || (this.collectedValues[field] = {});
|
|
126
|
+
const collectKeys = this.collectValuesBy[field].by.map((byField => record[byField])).join(this.stringJoinChar);
|
|
127
|
+
if (this.collectedValues[field][collectKeys] || (this.collectValuesBy[field].sumBy ? this.collectedValues[field][collectKeys] = {} : this.collectValuesBy[field].range ? this.collectedValues[field][collectKeys] = {
|
|
128
|
+
min: Number.MAX_SAFE_INTEGER,
|
|
129
|
+
max: Number.MIN_SAFE_INTEGER
|
|
130
|
+
} : this.collectedValues[field][collectKeys] = new Set), this.collectValuesBy[field].sumBy) {
|
|
131
|
+
const sumByKeys = this.collectValuesBy[field].sumBy.map((byField => record[byField])).join(this.stringJoinChar);
|
|
132
|
+
this.collectedValues[field][collectKeys][sumByKeys] || (this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[ts_types_1.AggregationType.SUM](field)),
|
|
133
|
+
this.collectedValues[field][collectKeys][sumByKeys].push(record);
|
|
134
|
+
} else if (this.collectValuesBy[field].range) {
|
|
135
|
+
const fieldRange = this.collectedValues[field][collectKeys];
|
|
136
|
+
fieldRange.max = Math.max(record[field], fieldRange.max), fieldRange.min = Math.min(record[field], fieldRange.min);
|
|
137
|
+
} else {
|
|
138
|
+
this.collectedValues[field][collectKeys].add(record[field]);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
97
141
|
const flatRowKey = rowKey.join(this.stringJoinChar), flatColKey = colKey.join(this.stringJoinChar);
|
|
98
|
-
|
|
142
|
+
0 !== rowKey.length && (this.rowFlatKeys[flatRowKey] || (this.rowKeys.push(rowKey),
|
|
99
143
|
this.rowFlatKeys[flatRowKey] = 1)), 0 !== colKey.length && (this.colFlatKeys[flatColKey] || (this.colKeys.push(colKey),
|
|
100
|
-
this.colFlatKeys[flatColKey] = 1)),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
null === (
|
|
108
|
-
}
|
|
144
|
+
this.colFlatKeys[flatColKey] = 1)), this.tree[flatRowKey] || (this.tree[flatRowKey] = {}),
|
|
145
|
+
(null === (_b = this.tree[flatRowKey]) || void 0 === _b ? void 0 : _b[flatColKey]) || (this.tree[flatRowKey][flatColKey] = []);
|
|
146
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
147
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
148
|
+
if ((null === (_d = null === (_c = this.tree[flatRowKey]) || void 0 === _c ? void 0 : _c[flatColKey]) || void 0 === _d ? void 0 : _d[i]) || (this.tree[flatRowKey][flatColKey][i] = new this.aggregators[null !== (_e = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _e ? _e : ts_types_1.AggregationType.SUM](null !== (_f = null == aggRule ? void 0 : aggRule.field) && void 0 !== _f ? _f : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun)),
|
|
149
|
+
null == aggRule ? void 0 : aggRule.field) if ("string" == typeof (null == aggRule ? void 0 : aggRule.field)) (0,
|
|
150
|
+
util_1.isValid)(record[null == aggRule ? void 0 : aggRule.field]) && (null === (_h = null === (_g = this.tree[flatRowKey]) || void 0 === _g ? void 0 : _g[flatColKey]) || void 0 === _h || _h[i].push(record)); else {
|
|
151
|
+
(null == aggRule ? void 0 : aggRule.field.find((field => record[field]))) && (null === (_k = null === (_j = this.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k || _k[i].push(record));
|
|
152
|
+
} else (0, util_1.isValid)(record[this.indicatorKeys[i]]) && (null === (_m = null === (_l = this.tree[flatRowKey]) || void 0 === _l ? void 0 : _l[flatColKey]) || void 0 === _m || _m[i].push(record));
|
|
109
153
|
}
|
|
110
|
-
if (this.mappingRules) for (let i = 0; i < this.
|
|
154
|
+
if (this.mappingRules) for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
111
155
|
if (!this.indicatorStatistics[i]) {
|
|
112
|
-
const aggRule = this.getAggregatorRule(this.
|
|
156
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
113
157
|
this.indicatorStatistics[i] = {
|
|
114
|
-
max: new this.aggregators[ts_types_1.AggregationType.MAX](this.
|
|
115
|
-
min: new this.aggregators[ts_types_1.AggregationType.MIN](this.
|
|
116
|
-
total: new this.aggregators[null !== (
|
|
158
|
+
max: new this.aggregators[ts_types_1.AggregationType.MAX](this.indicatorKeys[i]),
|
|
159
|
+
min: new this.aggregators[ts_types_1.AggregationType.MIN](this.indicatorKeys[i]),
|
|
160
|
+
total: new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : ts_types_1.AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun)
|
|
117
161
|
};
|
|
118
162
|
}
|
|
119
|
-
this.indicatorStatistics[i].max.push(null === (
|
|
120
|
-
this.indicatorStatistics[i].min.push(null === (
|
|
163
|
+
this.indicatorStatistics[i].max.push(null === (_r = null === (_q = this.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i].value()),
|
|
164
|
+
this.indicatorStatistics[i].min.push(null === (_t = null === (_s = this.tree[flatRowKey]) || void 0 === _s ? void 0 : _s[flatColKey]) || void 0 === _t ? void 0 : _t[i].value()),
|
|
121
165
|
this.indicatorStatistics[i].total.push(record);
|
|
122
166
|
}
|
|
123
167
|
}
|
|
@@ -126,22 +170,28 @@ class Dataset {
|
|
|
126
170
|
this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.rowKeysPath = this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal, (null === (_b = null === (_a = null == this ? void 0 : this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || 0 === this.columns.length, this.rowGrandTotalLabel, this.rowSubTotalLabel)),
|
|
127
171
|
this.colKeysPath = this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.showGrandTotals) || 0 === this.rows.length, this.colGrandTotalLabel, this.colSubTotalLabel));
|
|
128
172
|
}
|
|
173
|
+
updateFilterRules(filterRules, isResetTree = !1) {
|
|
174
|
+
if (this.filterRules = filterRules, isResetTree) this.tree = {}; else for (const treeRowKey in this.tree) for (const treeColKey in this.tree[treeRowKey]) for (let i = 0; i < this.tree[treeRowKey][treeColKey].length; i++) this.tree[treeRowKey][treeColKey][i].reset();
|
|
175
|
+
this.collectedValues = {}, this.processRecords(), this.processCollectedValuesWithSumBy(),
|
|
176
|
+
this.dataConfig.isPivotChart && this.dealWithZeroAlign();
|
|
177
|
+
}
|
|
129
178
|
getAggregatorRule(indicatorKey) {
|
|
130
179
|
var _a;
|
|
131
180
|
return null === (_a = this.aggregationRules) || void 0 === _a ? void 0 : _a.find(((value, index) => indicatorKey === value.indicatorKey));
|
|
132
181
|
}
|
|
133
182
|
getAggregator(rowKey = [], colKey = [], indicator) {
|
|
134
183
|
var _a, _b;
|
|
135
|
-
const indicatorIndex = this.
|
|
184
|
+
const indicatorIndex = this.indicatorKeys.indexOf(indicator);
|
|
136
185
|
let agg, flatRowKey, flatColKey;
|
|
137
186
|
return flatRowKey = "string" == typeof rowKey ? rowKey : rowKey.join(this.stringJoinChar),
|
|
138
187
|
flatColKey = "string" == typeof colKey ? colKey : colKey.join(this.stringJoinChar),
|
|
139
|
-
|
|
188
|
+
agg = null === (_b = null === (_a = this.tree[flatRowKey]) || void 0 === _a ? void 0 : _a[flatColKey]) || void 0 === _b ? void 0 : _b[indicatorIndex],
|
|
140
189
|
agg || {
|
|
141
190
|
className: "",
|
|
142
191
|
push() {},
|
|
143
192
|
value: () => null,
|
|
144
|
-
formatValue: () => ""
|
|
193
|
+
formatValue: () => "",
|
|
194
|
+
reset() {}
|
|
145
195
|
};
|
|
146
196
|
}
|
|
147
197
|
sortKeys() {
|
|
@@ -154,13 +204,13 @@ class Dataset {
|
|
|
154
204
|
switch (this.rowOrder) {
|
|
155
205
|
case "value_a_to_z":
|
|
156
206
|
this.rowKeys.sort((function(a, b) {
|
|
157
|
-
return naturalSort(getValue(a, []), getValue(b, []));
|
|
207
|
+
return (0, statistics_helper_1.naturalSort)(getValue(a, []), getValue(b, []));
|
|
158
208
|
}));
|
|
159
209
|
break;
|
|
160
210
|
|
|
161
211
|
case "value_z_to_a":
|
|
162
212
|
this.rowKeys.sort((function(a, b) {
|
|
163
|
-
return -naturalSort(getValue(a, []), getValue(b, []));
|
|
213
|
+
return -(0, statistics_helper_1.naturalSort)(getValue(a, []), getValue(b, []));
|
|
164
214
|
}));
|
|
165
215
|
break;
|
|
166
216
|
|
|
@@ -170,13 +220,13 @@ class Dataset {
|
|
|
170
220
|
switch (this.colOrder) {
|
|
171
221
|
case "value_a_to_z":
|
|
172
222
|
this.colKeys.sort((function(a, b) {
|
|
173
|
-
return naturalSort(getValue([], a), getValue([], b));
|
|
223
|
+
return (0, statistics_helper_1.naturalSort)(getValue([], a), getValue([], b));
|
|
174
224
|
}));
|
|
175
225
|
break;
|
|
176
226
|
|
|
177
227
|
case "value_z_to_a":
|
|
178
228
|
this.colKeys.sort((function(a, b) {
|
|
179
|
-
return -naturalSort(getValue([], a), getValue([], b));
|
|
229
|
+
return -(0, statistics_helper_1.naturalSort)(getValue([], a), getValue([], b));
|
|
180
230
|
}));
|
|
181
231
|
break;
|
|
182
232
|
|
|
@@ -203,7 +253,7 @@ class Dataset {
|
|
|
203
253
|
isHasSortRule || results.push({
|
|
204
254
|
field: field,
|
|
205
255
|
fieldIndex: l,
|
|
206
|
-
func: naturalSort
|
|
256
|
+
func: statistics_helper_1.naturalSort
|
|
207
257
|
});
|
|
208
258
|
}
|
|
209
259
|
return results;
|
|
@@ -232,13 +282,14 @@ class Dataset {
|
|
|
232
282
|
colKey.length < that.columns.length && colKey[colKey.length - 1] !== that.colSubTotalLabel && colKey[colKey.length - 1] !== that.colGrandTotalLabel && colKey.push(that.colSubTotalLabel),
|
|
233
283
|
that.getAggregator(rowKey, colKey, sortRule.sortByIndicator).value();
|
|
234
284
|
};
|
|
235
|
-
return isSortRow ? naturalSort(getValue(a, sortRule.query), getValue(b, sortRule.query)) :
|
|
236
|
-
|
|
285
|
+
return isSortRow ? (0, statistics_helper_1.naturalSort)(getValue(a, sortRule.query), getValue(b, sortRule.query)) : (0,
|
|
286
|
+
statistics_helper_1.naturalSort)(getValue(sortRule.query, a), getValue(sortRule.query, b));
|
|
287
|
+
} : sortRule.sortBy ? (0, statistics_helper_1.sortBy)(sortRule.sortBy) : sortRule.sortType ? statistics_helper_1.typeSort : sortRule.sortFunc ? sortRule.sortFunc : statistics_helper_1.naturalSort;
|
|
237
288
|
}
|
|
238
289
|
totalStatistics() {
|
|
239
290
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
240
291
|
const that = this;
|
|
241
|
-
if ((null === (_b = null === (_a = null == that ? void 0 : that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.showSubTotals) && (null === (_e = null === (_d = null === (_c = null == that ? void 0 : that.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 || (null === (_g = null === (_f = null == that ? void 0 : that.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showSubTotals) && (null === (_k = null === (_j = null === (_h = null == that ? void 0 : that.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 || (null === (_m = null === (_l = null == that ? void 0 : that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || (null === (_p = null === (_o = null == that ? void 0 : that.totals) || void 0 === _o ? void 0 : _o.row) || void 0 === _p ? void 0 : _p.showGrandTotals)
|
|
292
|
+
if ((null === (_b = null === (_a = null == that ? void 0 : that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.showSubTotals) && (null === (_e = null === (_d = null === (_c = null == that ? void 0 : that.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 || (null === (_g = null === (_f = null == that ? void 0 : that.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showSubTotals) && (null === (_k = null === (_j = null === (_h = null == that ? void 0 : that.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 || (null === (_m = null === (_l = null == that ? void 0 : that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || (null === (_p = null === (_o = null == that ? void 0 : that.totals) || void 0 === _o ? void 0 : _o.row) || void 0 === _p ? void 0 : _p.showGrandTotals)) {
|
|
242
293
|
const rowTotalKeys = [], colCompute = (flatRowKey, flatColKey) => {
|
|
243
294
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
244
295
|
const colKey = flatColKey.split(this.stringJoinChar);
|
|
@@ -249,10 +300,10 @@ class Dataset {
|
|
|
249
300
|
colTotalKey.push(null !== (_f = null === (_e = null === (_d = that.totals) || void 0 === _d ? void 0 : _d.column) || void 0 === _e ? void 0 : _e.subTotalLabel) && void 0 !== _f ? _f : "小计");
|
|
250
301
|
const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
|
|
251
302
|
this.tree[flatRowKey][flatColTotalKey] || (this.tree[flatRowKey][flatColTotalKey] = []);
|
|
252
|
-
for (let i = 0; i < this.
|
|
303
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
253
304
|
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
254
|
-
const aggRule = this.getAggregatorRule(this.
|
|
255
|
-
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : ts_types_1.AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.
|
|
305
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
306
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : ts_types_1.AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
|
|
256
307
|
}
|
|
257
308
|
this.tree[flatRowKey][flatColTotalKey][i].push(null === (_k = null === (_j = that.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k ? void 0 : _k[i]);
|
|
258
309
|
}
|
|
@@ -261,10 +312,10 @@ class Dataset {
|
|
|
261
312
|
if ((null === (_m = null === (_l = that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || 0 === this.rows.length) {
|
|
262
313
|
const flatColTotalKey = that.colGrandTotalLabel;
|
|
263
314
|
this.tree[flatRowKey][flatColTotalKey] || (this.tree[flatRowKey][flatColTotalKey] = []);
|
|
264
|
-
for (let i = 0; i < this.
|
|
315
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
265
316
|
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
266
|
-
const aggRule = this.getAggregatorRule(this.
|
|
267
|
-
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : ts_types_1.AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.
|
|
317
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
318
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : ts_types_1.AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
|
|
268
319
|
}
|
|
269
320
|
this.tree[flatRowKey][flatColTotalKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
|
|
270
321
|
}
|
|
@@ -283,29 +334,29 @@ class Dataset {
|
|
|
283
334
|
if (this.tree[flatRowTotalKey] || (this.tree[flatRowTotalKey] = {}, rowTotalKeys.push(flatRowTotalKey)),
|
|
284
335
|
!this.tree[flatRowTotalKey][flatColKey]) {
|
|
285
336
|
this.tree[flatRowTotalKey][flatColKey] = [];
|
|
286
|
-
for (let i = 0; i < this.
|
|
337
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
287
338
|
if (!this.tree[flatRowTotalKey][flatColKey][i]) {
|
|
288
|
-
const aggRule = this.getAggregatorRule(this.
|
|
289
|
-
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : ts_types_1.AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.
|
|
339
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
340
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : ts_types_1.AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
|
|
290
341
|
}
|
|
291
342
|
this.tree[flatRowTotalKey][flatColKey][i].push(null === (_k = null === (_j = that.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k ? void 0 : _k[i]);
|
|
292
343
|
}
|
|
293
344
|
}
|
|
294
345
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.tree[flatRowTotalKey][flatColKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
|
|
346
|
+
}
|
|
347
|
+
if ((null === (_m = null === (_l = that.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showGrandTotals) || 0 === this.columns.length) {
|
|
348
|
+
const flatRowTotalKey = that.rowGrandTotalLabel;
|
|
349
|
+
this.tree[flatRowTotalKey] || (this.tree[flatRowTotalKey] = {}, rowTotalKeys.push(flatRowTotalKey)),
|
|
350
|
+
this.tree[flatRowTotalKey][flatColKey] || (this.tree[flatRowTotalKey][flatColKey] = []);
|
|
351
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
352
|
+
if (!this.tree[flatRowTotalKey][flatColKey][i]) {
|
|
353
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
354
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : ts_types_1.AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
|
|
305
355
|
}
|
|
356
|
+
this.tree[flatRowTotalKey][flatColKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
|
|
306
357
|
}
|
|
307
|
-
colCompute(flatRowKey, flatColKey);
|
|
308
358
|
}
|
|
359
|
+
colCompute(flatRowKey, flatColKey);
|
|
309
360
|
}));
|
|
310
361
|
})), rowTotalKeys.forEach((flatRowKey => {
|
|
311
362
|
Object.keys(that.tree[flatRowKey]).forEach((flatColKey => {
|
|
@@ -326,33 +377,33 @@ class Dataset {
|
|
|
326
377
|
if (!item) {
|
|
327
378
|
if (item = {
|
|
328
379
|
id: flatKey,
|
|
329
|
-
|
|
380
|
+
children: []
|
|
330
381
|
}, subTotalFlags[index]) {
|
|
331
|
-
let curChild = item.
|
|
382
|
+
let curChild = item.children;
|
|
332
383
|
for (let i = index; i < list.length - 1; i++) {
|
|
333
384
|
const totalChild = {
|
|
334
385
|
id: `${flatKey}${concatStr}${subTotalLabel}`,
|
|
335
|
-
|
|
386
|
+
children: []
|
|
336
387
|
};
|
|
337
|
-
curChild.push(totalChild), curChild = totalChild.
|
|
388
|
+
curChild.push(totalChild), curChild = totalChild.children;
|
|
338
389
|
}
|
|
339
390
|
}
|
|
340
|
-
map.set(flatKey, item), node ? subTotalFlags[index - 1] ? node.
|
|
391
|
+
map.set(flatKey, item), node ? subTotalFlags[index - 1] ? node.children.splice(node.children.length - 1, 0, item) : node.children.push(item) : result.push(item);
|
|
341
392
|
}
|
|
342
393
|
node = item;
|
|
343
394
|
}));
|
|
344
395
|
}(item))), isGrandTotal) {
|
|
345
396
|
const node = {
|
|
346
397
|
id: grandTotalLabel,
|
|
347
|
-
|
|
398
|
+
children: []
|
|
348
399
|
};
|
|
349
|
-
let curChild = node.
|
|
400
|
+
let curChild = node.children;
|
|
350
401
|
for (let i = 1; i < subTotalFlags.length; i++) {
|
|
351
402
|
const totalChild = {
|
|
352
403
|
id: grandTotalLabel,
|
|
353
|
-
|
|
404
|
+
children: []
|
|
354
405
|
};
|
|
355
|
-
curChild.push(totalChild), curChild = totalChild.
|
|
406
|
+
curChild.push(totalChild), curChild = totalChild.children;
|
|
356
407
|
}
|
|
357
408
|
result.push(node);
|
|
358
409
|
}
|
|
@@ -362,129 +413,61 @@ class Dataset {
|
|
|
362
413
|
const result = [];
|
|
363
414
|
function getPath(node, arr) {
|
|
364
415
|
var _a;
|
|
365
|
-
arr.push(node.id), node.
|
|
416
|
+
arr.push(node.id), node.children.length > 0 ? null === (_a = node.children) || void 0 === _a || _a.forEach((childItem => getPath(childItem, [ ...arr ]))) : result.push(arr);
|
|
366
417
|
}
|
|
367
418
|
return tree.forEach((treeNode => getPath(treeNode, []))), result;
|
|
368
419
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
formatValue() {
|
|
379
|
-
return this._formatedValue || (this.formatFun ? this._formatedValue = this.formatFun(this.value()) : this._formatedValue = this.value()),
|
|
380
|
-
this._formatedValue;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
class SumAggregator extends Aggregator {
|
|
385
|
-
constructor() {
|
|
386
|
-
super(...arguments), this.type = ts_types_1.AggregationType.SUM, this.sum = 0;
|
|
387
|
-
}
|
|
388
|
-
push(record) {
|
|
389
|
-
this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
|
|
390
|
-
"Aggregator" === record.className ? this.sum += record.value() : isNaN(parseFloat(record[this.field])) || (this.sum += parseFloat(record[this.field]));
|
|
391
|
-
}
|
|
392
|
-
value() {
|
|
393
|
-
return this.sum;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
class CountAggregator extends Aggregator {
|
|
398
|
-
constructor() {
|
|
399
|
-
super(...arguments), this.type = ts_types_1.AggregationType.COUNT, this.count = 0;
|
|
400
|
-
}
|
|
401
|
-
push(record) {
|
|
402
|
-
this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
|
|
403
|
-
"Aggregator" === record.className ? this.count += record.value() : this.count++;
|
|
404
|
-
}
|
|
405
|
-
value() {
|
|
406
|
-
return this.count;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
class AvgAggregator extends Aggregator {
|
|
411
|
-
constructor() {
|
|
412
|
-
super(...arguments), this.type = ts_types_1.AggregationType.AVG, this.sum = 0, this.count = 0;
|
|
413
|
-
}
|
|
414
|
-
push(record) {
|
|
415
|
-
this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
|
|
416
|
-
"Aggregator" === record.className && record.type === ts_types_1.AggregationType.AVG ? (this.sum += record.sum,
|
|
417
|
-
this.count += record.count) : isNaN(parseFloat(record[this.field])) || (this.sum += parseFloat(record[this.field]),
|
|
418
|
-
this.count++);
|
|
419
|
-
}
|
|
420
|
-
value() {
|
|
421
|
-
return this.sum / this.count;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
class MaxAggregator extends Aggregator {
|
|
426
|
-
constructor() {
|
|
427
|
-
super(...arguments), this.type = ts_types_1.AggregationType.MAX, this.max = Number.MIN_SAFE_INTEGER,
|
|
428
|
-
this.isRecord = !1;
|
|
429
|
-
}
|
|
430
|
-
push(record) {
|
|
431
|
-
this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
|
|
432
|
-
"number" == typeof record ? this.max = record > this.max ? record : this.max : "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : isNaN(record[this.field]) || (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max);
|
|
433
|
-
}
|
|
434
|
-
value() {
|
|
435
|
-
return this.max;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
class MinAggregator extends Aggregator {
|
|
440
|
-
constructor() {
|
|
441
|
-
super(...arguments), this.type = ts_types_1.AggregationType.MIN, this.min = Number.MAX_SAFE_INTEGER,
|
|
442
|
-
this.isRecord = !1;
|
|
420
|
+
TreeToArr2(tree) {
|
|
421
|
+
const result = [];
|
|
422
|
+
function getPath(node, arr) {
|
|
423
|
+
var _a, _b;
|
|
424
|
+
arr.push(arr.length > 0 ? [ arr[arr.length - 1], node.value ].join(String.fromCharCode(0)) : node.value),
|
|
425
|
+
(null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) > 0 && !node.children[0].indicatorKey ? null === (_b = node.children) || void 0 === _b || _b.forEach((childItem => getPath(childItem, [ ...arr ]))) : result.push(arr);
|
|
426
|
+
}
|
|
427
|
+
return tree.forEach((treeNode => getPath(treeNode, []))), result;
|
|
443
428
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
429
|
+
dealWithZeroAlign() {
|
|
430
|
+
const indicatorsToAlign = [];
|
|
431
|
+
for (let i = 0; i < this.aggregationRules.length; i++) {
|
|
432
|
+
const rule = this.aggregationRules[i];
|
|
433
|
+
(0, vutils_1.isArray)(rule.field) && 2 === rule.field.length && indicatorsToAlign.push(rule.field);
|
|
434
|
+
}
|
|
435
|
+
indicatorsToAlign.forEach((indicatorToAlign => {
|
|
436
|
+
const indicator1 = indicatorToAlign[0], indicator2 = indicatorToAlign[1], collectedValue1 = this.collectedValues[indicator1], collectedValue2 = this.collectedValues[indicator2];
|
|
437
|
+
this.collectedValues[indicator1 + "_align"] = {}, this.collectedValues[indicator2 + "_align"] = {};
|
|
438
|
+
for (const key in collectedValue1) {
|
|
439
|
+
const range1 = collectedValue1[key], range2 = collectedValue2[key], newRanges = (0,
|
|
440
|
+
zero_align_1.getNewRangeToAlign)(range1, range2);
|
|
441
|
+
if (newRanges) {
|
|
442
|
+
const {range1: newRange1, range2: newRange2} = newRanges;
|
|
443
|
+
this.collectedValues[indicator1 + "_align"][key] = {
|
|
444
|
+
min: newRange1[0],
|
|
445
|
+
max: newRange1[1]
|
|
446
|
+
}, this.collectedValues[indicator2 + "_align"][key] = {
|
|
447
|
+
min: newRange2[0],
|
|
448
|
+
max: newRange2[1]
|
|
449
|
+
};
|
|
450
|
+
} else this.collectedValues[indicator1 + "_align"][key] = {
|
|
451
|
+
min: range1.min,
|
|
452
|
+
max: range1.max
|
|
453
|
+
}, this.collectedValues[indicator2 + "_align"][key] = {
|
|
454
|
+
min: range2.min,
|
|
455
|
+
max: range2.max
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
}));
|
|
447
459
|
}
|
|
448
|
-
|
|
449
|
-
|
|
460
|
+
cacheDeminsionCollectedValues() {
|
|
461
|
+
for (const key in this.collectValuesBy) "xField" !== this.collectValuesBy[key].type && "yField" !== this.collectValuesBy[key].type || (this.dataConfig.dimensionSortArray ? this.cacheCollectedValues[key] = arraySortByAnotherArray(this.collectedValues[key], this.dataConfig.dimensionSortArray) : this.cacheCollectedValues[key] = this.collectedValues[key]);
|
|
450
462
|
}
|
|
451
463
|
}
|
|
452
464
|
|
|
453
|
-
function
|
|
454
|
-
return
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return a && b ? a.toString().localeCompare(b.toString(), "zh") : a ? 1 : -1;
|
|
465
|
+
function arraySortByAnotherArray(array, sortArray) {
|
|
466
|
+
return array.sort(((a, b) => {
|
|
467
|
+
const aIndex = sortArray.indexOf(a), bIndex = sortArray.indexOf(b);
|
|
468
|
+
return aIndex < bIndex ? -1 : aIndex > bIndex ? 1 : 0;
|
|
469
|
+
}));
|
|
459
470
|
}
|
|
460
471
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
let a, a1, b, b1, nas = 0, nbs = 0;
|
|
464
|
-
if (null !== bs && null === as) return -1;
|
|
465
|
-
if (null !== as && null === bs) return 1;
|
|
466
|
-
if ("number" == typeof as && isNaN(as)) return -1;
|
|
467
|
-
if ("number" == typeof bs && isNaN(bs)) return 1;
|
|
468
|
-
if (nas = +as, nbs = +bs, nas < nbs) return -1;
|
|
469
|
-
if (nas > nbs) return 1;
|
|
470
|
-
if ("number" == typeof as && "number" != typeof bs) return -1;
|
|
471
|
-
if ("number" == typeof bs && "number" != typeof as) return 1;
|
|
472
|
-
if ("number" == typeof as && "number" == typeof bs) return 0;
|
|
473
|
-
if (isNaN(nbs) && !isNaN(nas)) return -1;
|
|
474
|
-
if (isNaN(nas) && !isNaN(nbs)) return 1;
|
|
475
|
-
if (a = String(as), b = String(bs), a === b) return 0;
|
|
476
|
-
if (!rd.test(a) || !rd.test(b)) return a > b ? 1 : -1;
|
|
477
|
-
for (a = a.match(rx), b = b.match(rx); a.length && b.length; ) if (a1 = a.shift(),
|
|
478
|
-
b1 = b.shift(), a1 !== b1) return rd.test(a1) && rd.test(b1) ? a1.replace(rz, ".0") - b1.replace(rz, ".0") : a1 > b1 ? 1 : -1;
|
|
479
|
-
return a.length - b.length;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
function sortBy(order) {
|
|
483
|
-
let x;
|
|
484
|
-
const mapping = {}, lowercase_mapping = {};
|
|
485
|
-
for (let i = 0; i < order.length; i++) x = order[i], mapping[x] = i, "string" == typeof x && (lowercase_mapping[x.toLowerCase()] = i);
|
|
486
|
-
return function(a, b) {
|
|
487
|
-
return null !== mapping[a] && void 0 !== mapping[a] && null !== mapping[b] && void 0 !== mapping[b] ? mapping[a] - mapping[b] : null !== mapping[a] && void 0 !== mapping[a] ? -1 : null !== mapping[b] && void 0 !== mapping[b] ? 1 : null !== lowercase_mapping[a] && void 0 !== mapping[a] && null !== lowercase_mapping[b] && void 0 !== mapping[b] ? lowercase_mapping[a] - lowercase_mapping[b] : null === lowercase_mapping[a] || void 0 === mapping[a] || null === lowercase_mapping[b] || void 0 === mapping[b] ? 0 : null !== lowercase_mapping[a] && void 0 !== mapping[a] ? -1 : null !== lowercase_mapping[b] && void 0 !== mapping[b] ? 1 : naturalSort(a, b);
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
//# sourceMappingURL=dataset.js.map
|
|
472
|
+
//# sourceMappingURL=dataset.js.map
|
|
473
|
+
exports.Dataset = Dataset;
|