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