@bino-bi/bn-template-engine 1.0.0-alpha.0 → 1.0.0-alpha.3
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/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +1 -0
- package/dist/bn-template-engine/p-0f1504f3.entry.js +1 -0
- package/dist/bn-template-engine/p-1970906d.entry.js +1 -0
- package/dist/bn-template-engine/p-1dbd339c.entry.js +1 -0
- package/dist/bn-template-engine/p-2e68cf09.entry.js +1 -0
- package/dist/bn-template-engine/p-31cc6a2d.entry.js +1 -0
- package/dist/bn-template-engine/p-37881d05.entry.js +1 -0
- package/dist/bn-template-engine/{p-65f8962a.entry.js → p-3b894997.entry.js} +1 -1
- package/dist/bn-template-engine/p-50e49732.entry.js +1 -0
- package/dist/bn-template-engine/{p-ad94cf63.entry.js → p-6c7c0455.entry.js} +1 -1
- package/dist/bn-template-engine/p-6da93eae.entry.js +1 -0
- package/dist/bn-template-engine/p-701e1578.entry.js +1 -0
- package/dist/bn-template-engine/{p-_LBTIfNN.js → p-8tsCnxIz.js} +1 -1
- package/dist/bn-template-engine/p-997b2fe4.entry.js +1 -0
- package/dist/bn-template-engine/p-B4ySv9KQ.js +1 -0
- package/dist/bn-template-engine/p-BL8gyUwE.js +1 -0
- package/dist/bn-template-engine/p-BSfqOkN_.js +1 -0
- package/dist/bn-template-engine/{p-Cp4MVxCu.js → p-C0yAPzJz.js} +1 -1
- package/dist/bn-template-engine/{p--TeDldm8.js → p-CRLgp9-v.js} +1 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
- package/dist/bn-template-engine/p-DG-1MR_T.js +1 -0
- package/dist/bn-template-engine/{p-CnI71OA9.js → p-DRikHQE-.js} +1 -1
- package/dist/bn-template-engine/p-DVMu6dEy.js +1 -0
- package/dist/bn-template-engine/p-DtdQCMzj.js +1 -0
- package/dist/bn-template-engine/p-JNHhIe7t.js +2 -0
- package/dist/bn-template-engine/p-a90f1cbe.entry.js +1 -0
- package/dist/bn-template-engine/p-b7bec050.entry.js +1 -0
- package/dist/bn-template-engine/p-d7f0cbaf.entry.js +1 -0
- package/dist/bn-template-engine/p-dfb61aa5.entry.js +1 -0
- package/dist/bn-template-engine/p-ece17f84.entry.js +1 -0
- package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
- package/dist/bn-template-engine/p-fd427179.entry.js +1 -0
- package/dist/bn-template-engine/p-sqjrku2z.js +1 -0
- package/dist/bn-template-engine/{p-CY1RzLjU.js → p-tzFCK9qn.js} +1 -1
- package/dist/cjs/{DataFormatDigits-DmTbhF8q.js → DataFormatDigits-DAmZzqbD.js} +1 -1
- package/dist/cjs/{DateStringFactory-Dn0aRj2Y.js → DateStringFactory-CcluhpGI.js} +4 -5
- package/dist/cjs/{luxon-8hyy5YD7.js → Order-BKoDS21t.js} +310 -0
- package/dist/cjs/{SVGVariancesStyleGroup-Czizhngt.js → SVGVariancesStyleGroup-DYYAU-81.js} +1 -1
- package/dist/cjs/{StringAdapter-0EbYMkR0.js → StringAdapter-Bneo8T4k.js} +1 -1
- package/dist/cjs/bn-asset.cjs.entry.js +5 -6
- package/dist/cjs/{bn-body_3.cjs.entry.js → bn-body_4.cjs.entry.js} +360 -27
- package/dist/cjs/bn-card.cjs.entry.js +5 -6
- package/dist/cjs/bn-chart-structure.cjs.entry.js +17 -22
- package/dist/cjs/bn-chart-time.cjs.entry.js +38 -51
- package/dist/cjs/bn-component-style.cjs.entry.js +5 -6
- package/dist/cjs/bn-context_5.cjs.entry.js +145 -78
- package/dist/cjs/bn-dataset.cjs.entry.js +5 -6
- package/dist/cjs/bn-grid.cjs.entry.js +8 -11
- package/dist/cjs/bn-image.cjs.entry.js +8 -11
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -6
- package/dist/cjs/bn-layout-card.cjs.entry.js +3 -3
- package/dist/cjs/bn-layout-page.cjs.entry.js +2 -2
- package/dist/cjs/bn-message.cjs.entry.js +6 -7
- package/dist/cjs/bn-template-engine.cjs.js +2 -2
- package/dist/cjs/bn-template.cjs.entry.js +4 -5
- package/dist/cjs/bn-text.cjs.entry.js +12 -16
- package/dist/cjs/bn-tree.cjs.entry.js +8 -11
- package/dist/cjs/{context-protocol-BkYHFkXE.js → context-protocol-CRPmux5D.js} +1 -1
- package/dist/cjs/editor-companion.cjs.entry.js +3 -3
- package/dist/cjs/ibcs-chart-structure.cjs.entry.js +31 -33
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +42 -44
- package/dist/cjs/{index-CScBFiS1.js → index-Cjw0q6gP.js} +1 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{withDataset-ZdN-RRTx.js → scaling-D8sIIKft.js} +68 -3
- package/dist/cjs/{withBodyObserver-B0_W1VOf.js → withBodyObserver-C6gLgq_e.js} +2 -2
- package/dist/cjs/{componentRegister-C17UFNPh.js → withComponentStatus-_x4LQZ0N.js} +43 -6
- package/dist/cjs/{withComponentStyle-C6KHnZHt.js → withComponentStyle-DMtic_9Y.js} +3 -3
- package/dist/cjs/{withHasError-Dspb3lIV.js → withHasError-B8gHkfV2.js} +1 -1
- package/dist/cjs/{withStyled-Bf-stJTR.js → withStyled-CW30Bh6c.js} +18 -63
- package/dist/cjs/{withTranslation-Cz0M5maV.js → withTranslation-CWPAIRjh.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -10
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +21 -30
- package/dist/collection/components/bn-message/bn-message.js +1 -1
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-table/bn-table.js +63 -12
- package/dist/collection/components/bn-table/ibcs-table.css +7 -5
- package/dist/collection/components/bn-table/ibcs-table.js +22 -1
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +56 -25
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -1
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +12 -3
- package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +9 -1
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +1 -1
- package/dist/collection/components/bn-title/bn-title.js +1 -9
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/utils/DateStringFactory.js +0 -1
- package/dist/collection/utils/constants.js +27 -0
- package/dist/collection/utils/validate.js +4 -1
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/ibcsRuleSet.js +1 -1
- package/dist/components/scaling.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/components/withHasError.js +1 -1
- package/dist/esm/{DataFormatDigits-Dt6gpIiZ.js → DataFormatDigits--qIbKvXa.js} +1 -1
- package/dist/esm/{DateStringFactory-_Qiv0IvF.js → DateStringFactory-XWdUjsn8.js} +1 -2
- package/dist/esm/{luxon-DbyXf6dF.js → Order-sqjrku2z.js} +307 -1
- package/dist/esm/{SVGVariancesStyleGroup-DlWgvpzs.js → SVGVariancesStyleGroup-ibg3sLjM.js} +1 -1
- package/dist/esm/{StringAdapter-BLvo1Krl.js → StringAdapter-BCLJpQQ8.js} +1 -1
- package/dist/esm/bn-asset.entry.js +5 -6
- package/dist/esm/{bn-body_3.entry.js → bn-body_4.entry.js} +356 -24
- package/dist/esm/bn-card.entry.js +5 -6
- package/dist/esm/bn-chart-structure.entry.js +12 -17
- package/dist/esm/bn-chart-time.entry.js +31 -44
- package/dist/esm/bn-component-style.entry.js +5 -6
- package/dist/esm/bn-context_5.entry.js +124 -57
- package/dist/esm/bn-dataset.entry.js +5 -6
- package/dist/esm/bn-grid.entry.js +8 -11
- package/dist/esm/bn-image.entry.js +8 -11
- package/dist/esm/bn-internationalization.entry.js +5 -6
- package/dist/esm/bn-layout-card.entry.js +3 -3
- package/dist/esm/bn-layout-page.entry.js +2 -2
- package/dist/esm/bn-message.entry.js +6 -7
- package/dist/esm/bn-template-engine.js +3 -3
- package/dist/esm/bn-template.entry.js +4 -5
- package/dist/esm/bn-text.entry.js +11 -15
- package/dist/esm/bn-tree.entry.js +8 -11
- package/dist/esm/{context-protocol-DzeqZxg6.js → context-protocol-Bz5klD-F.js} +1 -1
- package/dist/esm/editor-companion.entry.js +3 -3
- package/dist/esm/ibcs-chart-structure.entry.js +5 -7
- package/dist/esm/ibcs-chart-time.entry.js +6 -8
- package/dist/esm/{index-B27Ax6P_.js → index-JNHhIe7t.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{withDataset-BT2VQCsG.js → scaling-C6K8FYSF.js} +67 -4
- package/dist/esm/{withBodyObserver-gZpZiEIK.js → withBodyObserver-DczL5ia8.js} +2 -2
- package/dist/esm/{componentRegister-BtVfu16B.js → withComponentStatus-DodoSXe-.js} +36 -1
- package/dist/esm/{withComponentStyle-NaxfakAG.js → withComponentStyle-BerJY64r.js} +3 -3
- package/dist/esm/{withHasError-C48fTE2k.js → withHasError-B3QX2emi.js} +1 -1
- package/dist/esm/{withStyled-CpUTv74m.js → withStyled-D1fAWJ3g.js} +8 -51
- package/dist/esm/{withTranslation-Do4GhleK.js → withTranslation-mimbJdER.js} +3 -3
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -2
- package/dist/types/components/bn-table/bn-table.d.ts +11 -7
- package/dist/types/components/bn-table/ibcs-table.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +3 -0
- package/dist/types/components/bn-title/bn-title.d.ts +0 -1
- package/dist/types/components.d.ts +22 -403
- package/dist/types/utils/constants.d.ts +15 -0
- package/dist/types/utils/validate.d.ts +1 -0
- package/package.json +2 -3
- package/readme.md +0 -1
- package/dist/bn-template-engine/assets/gpx/Chasing_Legends.gpx +0 -195076
- package/dist/bn-template-engine/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
- package/dist/bn-template-engine/assets/icons/gpx-finish.png +0 -0
- package/dist/bn-template-engine/assets/icons/gpx-shadow.png +0 -0
- package/dist/bn-template-engine/assets/icons/gpx-start.png +0 -0
- package/dist/bn-template-engine/assets/icons/marker-example.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-end.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-start.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-wpt.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-shadow.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin.png +0 -0
- package/dist/bn-template-engine/p-0e7dc113.entry.js +0 -1
- package/dist/bn-template-engine/p-264c6bad.entry.js +0 -1
- package/dist/bn-template-engine/p-326a0902.entry.js +0 -1
- package/dist/bn-template-engine/p-38a8bde3.entry.js +0 -1
- package/dist/bn-template-engine/p-577eafcd.entry.js +0 -1
- package/dist/bn-template-engine/p-5905cc43.entry.js +0 -1
- package/dist/bn-template-engine/p-5d155a72.entry.js +0 -1
- package/dist/bn-template-engine/p-6b8d1ebf.entry.js +0 -1
- package/dist/bn-template-engine/p-7995acb2.entry.js +0 -1
- package/dist/bn-template-engine/p-7afe431e.entry.js +0 -1
- package/dist/bn-template-engine/p-8014b1ac.entry.js +0 -1
- package/dist/bn-template-engine/p-80423fc8.entry.js +0 -1
- package/dist/bn-template-engine/p-91e74d42.entry.js +0 -1
- package/dist/bn-template-engine/p-930a9e29.entry.js +0 -1
- package/dist/bn-template-engine/p-93C9jL8R.js +0 -1
- package/dist/bn-template-engine/p-93ff8584.entry.js +0 -1
- package/dist/bn-template-engine/p-B0m0U4wJ.js +0 -1
- package/dist/bn-template-engine/p-B27Ax6P_.js +0 -2
- package/dist/bn-template-engine/p-B79VcHiT.js +0 -1
- package/dist/bn-template-engine/p-BBd0ZVLL.js +0 -1
- package/dist/bn-template-engine/p-BFatTBqh.js +0 -1
- package/dist/bn-template-engine/p-BQp6ZPYW.js +0 -1
- package/dist/bn-template-engine/p-BhEQy-2D.js +0 -1
- package/dist/bn-template-engine/p-BtVfu16B.js +0 -1
- package/dist/bn-template-engine/p-CfWnag33.js +0 -1
- package/dist/bn-template-engine/p-DbyXf6dF.js +0 -1
- package/dist/bn-template-engine/p-TdL-LRR9.js +0 -1
- package/dist/bn-template-engine/p-a342cd3c.entry.js +0 -1
- package/dist/bn-template-engine/p-bc37d750.entry.js +0 -1
- package/dist/bn-template-engine/p-c9f050bf.entry.js +0 -1
- package/dist/bn-template-engine/p-d07a0ca3.entry.js +0 -1
- package/dist/bn-template-engine/p-e5f372af.entry.js +0 -1
- package/dist/bn-template-engine/p-e620028c.entry.js +0 -1
- package/dist/bn-template-engine/p-e81e116a.entry.js +0 -1
- package/dist/bn-template-engine/p-eca98070.entry.js +0 -1
- package/dist/bn-template-engine/p-ee6de950.entry.js +0 -1
- package/dist/bn-template-engine/p-efe0ef1e.entry.js +0 -1
- package/dist/bn-template-engine/p-f034f1b8.entry.js +0 -1
- package/dist/bn-template-engine/p-f1c1a8a3.entry.js +0 -1
- package/dist/bn-template-engine/p-fe573a1a.entry.js +0 -1
- package/dist/bn-template-engine/p-kMyLevYy.js +0 -1
- package/dist/cjs/Order-B4NIqQWe.js +0 -129
- package/dist/cjs/bn-map.cjs.entry.js +0 -425
- package/dist/cjs/constants-DHqQXSSd.js +0 -158
- package/dist/cjs/ibcs-map.cjs.entry.js +0 -1075
- package/dist/cjs/ibcs-title.cjs.entry.js +0 -352
- package/dist/cjs/scaling-B23eOtsC.js +0 -67
- package/dist/cjs/test-runner-card.cjs.entry.js +0 -27
- package/dist/cjs/test-runner-chart-time.cjs.entry.js +0 -230
- package/dist/cjs/test-runner-chart.cjs.entry.js +0 -326
- package/dist/cjs/test-runner-map.cjs.entry.js +0 -1862
- package/dist/cjs/test-runner-table.cjs.entry.js +0 -477
- package/dist/cjs/test-runner-time.cjs.entry.js +0 -381
- package/dist/cjs/test-runner-title.cjs.entry.js +0 -115
- package/dist/cjs/withComponentStatus-BrxL7usr.js +0 -39
- package/dist/collection/components/bn-map/bn-map.css +0 -4
- package/dist/collection/components/bn-map/bn-map.js +0 -725
- package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Chasing_Legends.gpx +0 -195076
- package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-finish.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-shadow.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-start.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/marker-example.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-end.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-start.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-wpt.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-shadow.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/ibcs-map.css +0 -674
- package/dist/collection/components/bn-map/ibcs-map/ibcs-map.js +0 -744
- package/dist/collection/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.js +0 -9
- package/dist/collection/components/bn-map/ibcs-map/utils/model/GpxLayer.js +0 -13
- package/dist/collection/components/bn-map/ibcs-map/utils/model/Marker.js +0 -11
- package/dist/collection/components/bn-map/ibcs-map/utils/model/index.js +0 -2
- package/dist/collection/test-runner/test-runner-card.js +0 -36
- package/dist/collection/test-runner/test-runner-chart-time.js +0 -234
- package/dist/collection/test-runner/test-runner-chart.js +0 -364
- package/dist/collection/test-runner/test-runner-map.js +0 -1901
- package/dist/collection/test-runner/test-runner-table.js +0 -469
- package/dist/collection/test-runner/test-runner-time.js +0 -399
- package/dist/collection/test-runner/test-runner-title.js +0 -108
- package/dist/components/bn-map.d.ts +0 -11
- package/dist/components/bn-map.js +0 -1
- package/dist/components/componentRegister.js +0 -1
- package/dist/components/ibcs-map.d.ts +0 -11
- package/dist/components/ibcs-map.js +0 -1
- package/dist/components/ibcs-map2.js +0 -1
- package/dist/components/test-runner-card.d.ts +0 -11
- package/dist/components/test-runner-card.js +0 -1
- package/dist/components/test-runner-chart-time.d.ts +0 -11
- package/dist/components/test-runner-chart-time.js +0 -1
- package/dist/components/test-runner-chart.d.ts +0 -11
- package/dist/components/test-runner-chart.js +0 -1
- package/dist/components/test-runner-map.d.ts +0 -11
- package/dist/components/test-runner-map.js +0 -1
- package/dist/components/test-runner-table.d.ts +0 -11
- package/dist/components/test-runner-table.js +0 -1
- package/dist/components/test-runner-time.d.ts +0 -11
- package/dist/components/test-runner-time.js +0 -1
- package/dist/components/test-runner-title.d.ts +0 -11
- package/dist/components/test-runner-title.js +0 -1
- package/dist/components/withDataset.js +0 -1
- package/dist/esm/Order-B4fpLe_f.js +0 -125
- package/dist/esm/bn-map.entry.js +0 -423
- package/dist/esm/constants-kMyLevYy.js +0 -158
- package/dist/esm/ibcs-map.entry.js +0 -1073
- package/dist/esm/ibcs-title.entry.js +0 -350
- package/dist/esm/scaling-BBd0ZVLL.js +0 -64
- package/dist/esm/test-runner-card.entry.js +0 -25
- package/dist/esm/test-runner-chart-time.entry.js +0 -228
- package/dist/esm/test-runner-chart.entry.js +0 -324
- package/dist/esm/test-runner-map.entry.js +0 -1860
- package/dist/esm/test-runner-table.entry.js +0 -475
- package/dist/esm/test-runner-time.entry.js +0 -379
- package/dist/esm/test-runner-title.entry.js +0 -113
- package/dist/esm/withComponentStatus-elELReKt.js +0 -37
- package/dist/types/components/bn-map/bn-map.d.ts +0 -122
- package/dist/types/components/bn-map/ibcs-map/ibcs-map.d.ts +0 -73
- package/dist/types/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.d.ts +0 -8
- package/dist/types/components/bn-map/ibcs-map/utils/model/GpxLayer.d.ts +0 -11
- package/dist/types/components/bn-map/ibcs-map/utils/model/Marker.d.ts +0 -9
- package/dist/types/components/bn-map/ibcs-map/utils/model/index.d.ts +0 -2
- package/dist/types/test-runner/test-runner-card.d.ts +0 -3
- package/dist/types/test-runner/test-runner-chart-time.d.ts +0 -3
- package/dist/types/test-runner/test-runner-chart.d.ts +0 -3
- package/dist/types/test-runner/test-runner-map.d.ts +0 -3
- package/dist/types/test-runner/test-runner-table.d.ts +0 -3
- package/dist/types/test-runner/test-runner-time.d.ts +0 -3
- package/dist/types/test-runner/test-runner-title.d.ts +0 -3
|
@@ -150,28 +150,52 @@ function getBarStroke(varianceStyle) {
|
|
|
150
150
|
// Solid and hatched bars don't need visible stroke
|
|
151
151
|
return { stroke: "none", strokeWidth: 0 };
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Computes an effective max for proportional scaling that keeps most bars readable.
|
|
155
|
+
* If a few outliers (extreme values) dominate, the effective max is capped so the
|
|
156
|
+
* majority of bars remain at a useful size. Values exceeding the effective max are
|
|
157
|
+
* flagged as "extreme" and rendered with an arrow indicator.
|
|
158
|
+
*
|
|
159
|
+
* Algorithm: effectiveMax = median * EXTREME_THRESHOLD (default 3×).
|
|
160
|
+
* If this would be less than absMax, some values are extreme.
|
|
161
|
+
* If the median is 0 (e.g. single value), falls back to absMax.
|
|
162
|
+
*/
|
|
163
|
+
const EXTREME_THRESHOLD = 3;
|
|
164
|
+
function computeEffectiveMax(columnStats) {
|
|
165
|
+
if (columnStats.median <= 0) {
|
|
166
|
+
return columnStats.absMax;
|
|
167
|
+
}
|
|
168
|
+
const cap = columnStats.median * EXTREME_THRESHOLD;
|
|
169
|
+
return Math.min(cap, columnStats.absMax);
|
|
170
|
+
}
|
|
153
171
|
/**
|
|
154
172
|
* Renders an absolute variance bar chart (d_ prefix).
|
|
155
173
|
* Horizontal bar with centered axis, green for positive, red for negative.
|
|
156
174
|
* Value label shown next to the bar (black text per IBCS).
|
|
157
175
|
*
|
|
158
176
|
* Layout: [left label area][bar area with axis][right label area]
|
|
159
|
-
* Uses unitScaling to determine bar width (pixels per unit of measure).
|
|
160
177
|
*/
|
|
161
178
|
const AbsoluteVarianceBar = (props) => {
|
|
162
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
179
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 3, styles = DEFAULT_STYLES, } = props;
|
|
163
180
|
const s = styles.scaleFactor;
|
|
164
|
-
const labelAreaWidth =
|
|
165
|
-
const maxBarWidth =
|
|
166
|
-
|
|
167
|
-
const
|
|
181
|
+
const labelAreaWidth = 38 * s;
|
|
182
|
+
const maxBarWidth = maxBarWidthEm * styles.fontSize * s;
|
|
183
|
+
// Adaptive axis placement based on data range
|
|
184
|
+
const hasNeg = columnStats.min < 0;
|
|
185
|
+
const hasPos = columnStats.max > 0;
|
|
186
|
+
const negBarWidth = hasNeg ? maxBarWidth : 0;
|
|
187
|
+
const posBarWidth = hasPos ? maxBarWidth : 0;
|
|
188
|
+
const barAreaWidth = negBarWidth + posBarWidth;
|
|
189
|
+
const totalWidth = (hasNeg ? labelAreaWidth : 0) + barAreaWidth + (hasPos ? labelAreaWidth : 0);
|
|
168
190
|
const padding = 2 * s;
|
|
169
191
|
const barHeight = height - padding * 2;
|
|
170
|
-
const axisX =
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
const
|
|
192
|
+
const axisX = (hasNeg ? labelAreaWidth : 0) + negBarWidth;
|
|
193
|
+
// Proportional scaling with outlier detection
|
|
194
|
+
const effectiveMax = computeEffectiveMax(columnStats);
|
|
195
|
+
const absValue = Math.abs(value);
|
|
196
|
+
const proportion = effectiveMax > 0 ? absValue / effectiveMax : 0;
|
|
197
|
+
const isExtreme = absValue > effectiveMax;
|
|
198
|
+
const barWidth = Math.min(proportion, 1) * maxBarWidth;
|
|
175
199
|
const isPositive = value >= 0;
|
|
176
200
|
const barX = isPositive ? axisX : axisX - barWidth;
|
|
177
201
|
const barY = padding;
|
|
@@ -195,7 +219,8 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
195
219
|
// Negative values: label in left area, right-aligned
|
|
196
220
|
const labelX = isPositive ? axisX + barWidth + 4 * s : axisX - barWidth - 4 * s;
|
|
197
221
|
const labelAnchor = isPositive ? "start" : "end";
|
|
198
|
-
|
|
222
|
+
const centerY = height / 2;
|
|
223
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), barWidth > 0 && (h("rect", { x: barX, y: barY, width: barWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme && isPositive && (h("polygon", { points: `${axisX + maxBarWidth},${centerY} ${axisX + maxBarWidth - 6 * s},${centerY - 3 * s} ${axisX + maxBarWidth - 6 * s},${centerY + 3 * s}`, fill: barStyle.fill === "transparent" ? barStyle.stroke : barStyle.fill })), isExtreme && !isPositive && (h("polygon", { points: `${axisX - maxBarWidth},${centerY} ${axisX - maxBarWidth + 6 * s},${centerY - 3 * s} ${axisX - maxBarWidth + 6 * s},${centerY + 3 * s}`, fill: barStyle.fill === "transparent" ? barStyle.stroke : barStyle.fill })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": styles.fontSize, "font-family": styles.fontFamily }, displayValue)));
|
|
199
224
|
};
|
|
200
225
|
/**
|
|
201
226
|
* Renders a relative variance pin chart (dr_ prefix).
|
|
@@ -205,30 +230,36 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
205
230
|
* Uses percentageScaling to determine pin length (pixels per percentage point).
|
|
206
231
|
*/
|
|
207
232
|
const RelativeVariancePin = (props) => {
|
|
208
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
233
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 3, styles = DEFAULT_STYLES, } = props;
|
|
209
234
|
const s = styles.scaleFactor;
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
const
|
|
235
|
+
// Pin length is ~2/3 of bar width for visual balance
|
|
236
|
+
const maxPinLength = Math.round(maxBarWidthEm * 0.67 * styles.fontSize) * s;
|
|
237
|
+
const pinPadding = 5 * s;
|
|
238
|
+
// Adaptive axis placement based on data range
|
|
239
|
+
const hasNeg = columnStats.min < 0;
|
|
240
|
+
const hasPos = columnStats.max > 0;
|
|
241
|
+
const negPinWidth = hasNeg ? maxPinLength + pinPadding : 0;
|
|
242
|
+
const posPinWidth = hasPos ? maxPinLength + pinPadding : 0;
|
|
243
|
+
const pinAreaWidth = negPinWidth + posPinWidth;
|
|
244
|
+
const labelAreaWidth = 45 * s;
|
|
213
245
|
const totalWidth = pinAreaWidth + labelAreaWidth;
|
|
214
|
-
const axisX =
|
|
246
|
+
const axisX = negPinWidth;
|
|
215
247
|
const centerY = height / 2;
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const
|
|
248
|
+
// Proportional scaling with outlier detection
|
|
249
|
+
const effectiveMax = computeEffectiveMax(columnStats);
|
|
250
|
+
const absValue = Math.abs(value);
|
|
251
|
+
const proportion = effectiveMax > 0 ? absValue / effectiveMax : 0;
|
|
252
|
+
const isExtreme = absValue > effectiveMax;
|
|
253
|
+
const pinLength = Math.min(proportion, 1) * maxPinLength;
|
|
221
254
|
const isPositive = value >= 0;
|
|
222
255
|
const pinEndX = isPositive ? axisX + pinLength : axisX - pinLength;
|
|
223
256
|
// Get style based on column type (scenario vs variance)
|
|
224
257
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
225
258
|
const dotRadius = 3 * s;
|
|
226
|
-
// Show arrow for extreme values (when pin would exceed max length)
|
|
227
|
-
const isExtreme = scaledLength > maxPinLength;
|
|
228
259
|
const displayValue = formattedValue || formatValue(value, true, measureScale);
|
|
229
260
|
// Label always on the right side after the pin area
|
|
230
261
|
const labelX = pinAreaWidth + 4 * s;
|
|
231
|
-
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${
|
|
262
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${axisX + maxPinLength},${centerY} ${axisX + maxPinLength - 6 * s},${centerY - 3 * s} ${axisX + maxPinLength - 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), isExtreme && !isPositive && (h("polygon", { points: `${axisX - maxPinLength},${centerY} ${axisX - maxPinLength + 6 * s},${centerY - 3 * s} ${axisX - maxPinLength + 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": "start", fill: styles.fontColor, "font-size": styles.fontSize, "font-style": "italic", "font-family": styles.fontFamily }, displayValue)));
|
|
232
263
|
};
|
|
233
264
|
/**
|
|
234
265
|
* CellBarChart - Renders IBCS-compliant variance bar charts.
|
|
@@ -79,7 +79,9 @@ export class TableRow {
|
|
|
79
79
|
if (isSecondaryElement) {
|
|
80
80
|
prefixStyle = "prefix-second";
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
if (columnType) {
|
|
83
|
+
cssStyle = `${cssStyle} ${columnType}`;
|
|
84
|
+
}
|
|
83
85
|
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
|
|
84
86
|
cell.isBarChart = isBarChart;
|
|
85
87
|
cell.columnStats = columnStats;
|
|
@@ -113,9 +113,11 @@ export class TableDataSetFactory {
|
|
|
113
113
|
if (!barColumns || barColumns.length === 0) {
|
|
114
114
|
return statsMap;
|
|
115
115
|
}
|
|
116
|
-
//
|
|
116
|
+
// Collect all values per column for median calculation
|
|
117
|
+
const valuesMap = new Map();
|
|
117
118
|
for (const column of barColumns) {
|
|
118
|
-
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0 });
|
|
119
|
+
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0, median: 0 });
|
|
120
|
+
valuesMap.set(column, []);
|
|
119
121
|
}
|
|
120
122
|
// Iterate through all groups and rows
|
|
121
123
|
for (const groupData of queryData) {
|
|
@@ -126,17 +128,24 @@ export class TableDataSetFactory {
|
|
|
126
128
|
const stats = statsMap.get(column);
|
|
127
129
|
stats.min = Math.min(stats.min, value);
|
|
128
130
|
stats.max = Math.max(stats.max, value);
|
|
131
|
+
valuesMap.get(column).push(Math.abs(value));
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
// Finalize absMax values
|
|
136
|
+
// Finalize absMax and median values
|
|
134
137
|
for (const [column, stats] of statsMap) {
|
|
135
138
|
if (stats.min === Infinity || stats.max === -Infinity) {
|
|
136
139
|
stats.min = 0;
|
|
137
140
|
stats.max = 0;
|
|
138
141
|
}
|
|
139
142
|
stats.absMax = Math.max(Math.abs(stats.min), Math.abs(stats.max));
|
|
143
|
+
const absValues = valuesMap.get(column);
|
|
144
|
+
if (absValues.length > 0) {
|
|
145
|
+
absValues.sort((a, b) => a - b);
|
|
146
|
+
const mid = Math.floor(absValues.length / 2);
|
|
147
|
+
stats.median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
148
|
+
}
|
|
140
149
|
statsMap.set(column, stats);
|
|
141
150
|
}
|
|
142
151
|
return statsMap;
|
|
@@ -17,12 +17,14 @@ export class ColumnStatistics {
|
|
|
17
17
|
for (const column of columns) {
|
|
18
18
|
let min = Infinity;
|
|
19
19
|
let max = -Infinity;
|
|
20
|
+
const absValues = [];
|
|
20
21
|
for (const group of data) {
|
|
21
22
|
for (const row of group) {
|
|
22
23
|
const value = this.extractValue(row, column);
|
|
23
24
|
if (value !== null && !isNaN(value)) {
|
|
24
25
|
min = Math.min(min, value);
|
|
25
26
|
max = Math.max(max, value);
|
|
27
|
+
absValues.push(Math.abs(value));
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -32,7 +34,13 @@ export class ColumnStatistics {
|
|
|
32
34
|
max = 0;
|
|
33
35
|
}
|
|
34
36
|
const absMax = Math.max(Math.abs(min), Math.abs(max));
|
|
35
|
-
|
|
37
|
+
let median = 0;
|
|
38
|
+
if (absValues.length > 0) {
|
|
39
|
+
absValues.sort((a, b) => a - b);
|
|
40
|
+
const mid = Math.floor(absValues.length / 2);
|
|
41
|
+
median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
42
|
+
}
|
|
43
|
+
statsMap.set(column, { min, max, absMax, median });
|
|
36
44
|
}
|
|
37
45
|
return statsMap;
|
|
38
46
|
}
|
|
@@ -7,7 +7,7 @@ export class Template {
|
|
|
7
7
|
this.errors = withHasError(this);
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'ef4bc925d3e711445f9533e0b1e59a8942700283' }, h("slot", { key: 'c338dd99289b256bab83240cf923b23fd62b4ef1' })));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "bn-template"; }
|
|
13
13
|
static get encapsulation() { return "shadow"; }
|
|
@@ -264,7 +264,7 @@ export class Text {
|
|
|
264
264
|
"--bn-font-color": fontStyles.color,
|
|
265
265
|
"--bn-font-background": fontStyles.background,
|
|
266
266
|
};
|
|
267
|
-
return (h(Host, { key: '
|
|
267
|
+
return (h(Host, { key: '49a4060ebb36623a64a41efbdefcdcc9060457c3', style: cssVars }, h("div", { key: '19f66b3d17d38d3c8119f9cb6b046e0d18c0f022' }, h("span", { key: '3b8cf9f75aeb668cb0c32a7a3540e0ed8f336050', class: "container", ref: (el) => {
|
|
268
268
|
this.container = el;
|
|
269
269
|
} }))));
|
|
270
270
|
}
|
|
@@ -70,14 +70,6 @@ export class Title {
|
|
|
70
70
|
*
|
|
71
71
|
*/
|
|
72
72
|
this.dateLink = "none";
|
|
73
|
-
this.scopedEval = (scope, script) => {
|
|
74
|
-
try {
|
|
75
|
-
return Function(`"use strict"; try { return ${script} } catch { return ""}`).bind(scope)();
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
console.error("bn-text", e);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
73
|
withStyled(this);
|
|
82
74
|
withComponentStatus(this);
|
|
83
75
|
this.t = withTranslation(this).t;
|
|
@@ -294,7 +286,7 @@ export class Title {
|
|
|
294
286
|
}
|
|
295
287
|
render() {
|
|
296
288
|
const fontStyles = this.getFontStyles();
|
|
297
|
-
return (h(Host, { key: '
|
|
289
|
+
return (h(Host, { key: '029abd8096c5274f94123da2dc1c1e88e76be922', style: fontStyles }, h("ibcs-title", { key: 'c8b128a6ea36d44d8a0730898b35fa3f944e23ae', businessUnit: this.prepareBusinessUnit(), scenarios: this.prepareScenarios(), measures: this.prepareMeasures(), timeperiod: this.prepareTitleTimePeriod(), order: this.prepareTitleOrder(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode() })));
|
|
298
290
|
}
|
|
299
291
|
static get is() { return "bn-title"; }
|
|
300
292
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,7 +36,7 @@ export class IbcsTitle {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return (h("div", { key: '
|
|
39
|
+
return (h("div", { key: '08439c867ae47a9ee17ef8280801896a823c8826' }, h("div", { key: 'bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9' }, this.title.unit), h("div", { key: '3edb730c95280ca0c47db70e32dd8e471747d989' }, this.title.measures.map((measure, index) => (h("span", null, this.isFirstElement(index) ? this.title.i18n.get("SEPERATOR_WS") : "", h("span", { class: "measure" }, measure.name), " ", measure.unit ? this.title.i18n.get("in") : "", " ", measure.unit)))), h("div", { key: '3bae51f2fddef6b2195d1c24915512b6255c9a75' }, this.title.dimension)));
|
|
40
40
|
}
|
|
41
41
|
componentWillLoad() {
|
|
42
42
|
const config = this.prepareConfig();
|
|
@@ -39,7 +39,7 @@ export class EditorCompanion {
|
|
|
39
39
|
return Promise.resolve(result);
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return h(Fragment, { key: '
|
|
42
|
+
return h(Fragment, { key: 'ee282c29dd433c77fddae8e99e844bf299ebfa29' });
|
|
43
43
|
}
|
|
44
44
|
distinct(data, key) {
|
|
45
45
|
return [...new Set(data.map((d) => d[key]))].filter((v) => v !== null && v !== undefined);
|
|
@@ -198,7 +198,6 @@ export class DateStringFactory {
|
|
|
198
198
|
let span = toDate.diff(fromDate).as(unit);
|
|
199
199
|
const days = [];
|
|
200
200
|
if (span >= spanLimit) {
|
|
201
|
-
console.warn("Clip Span from", span, "to spanLimit", spanLimit);
|
|
202
201
|
span = spanLimit;
|
|
203
202
|
}
|
|
204
203
|
let currentDate = fromDate;
|
|
@@ -82,6 +82,33 @@ export var TableCategoryWidth;
|
|
|
82
82
|
TableCategoryWidth["W10"] = "w10";
|
|
83
83
|
TableCategoryWidth["W5"] = "w5";
|
|
84
84
|
})(TableCategoryWidth || (TableCategoryWidth = {}));
|
|
85
|
+
/** Width preset for inline bar/pin chart columns. Value = max bar width in em. */
|
|
86
|
+
export var TableBarColumnWidth;
|
|
87
|
+
(function (TableBarColumnWidth) {
|
|
88
|
+
TableBarColumnWidth["W5"] = "w5";
|
|
89
|
+
TableBarColumnWidth["W10"] = "w10";
|
|
90
|
+
TableBarColumnWidth["W15"] = "w15";
|
|
91
|
+
TableBarColumnWidth["W20"] = "w20";
|
|
92
|
+
TableBarColumnWidth["W25"] = "w25";
|
|
93
|
+
TableBarColumnWidth["W30"] = "w30";
|
|
94
|
+
TableBarColumnWidth["W40"] = "w40";
|
|
95
|
+
TableBarColumnWidth["W60"] = "w60";
|
|
96
|
+
TableBarColumnWidth["W80"] = "w80";
|
|
97
|
+
TableBarColumnWidth["W100"] = "w100";
|
|
98
|
+
})(TableBarColumnWidth || (TableBarColumnWidth = {}));
|
|
99
|
+
/** Maps TableBarColumnWidth presets to max bar width in em. */
|
|
100
|
+
export const BAR_COLUMN_WIDTH_EM = {
|
|
101
|
+
[TableBarColumnWidth.W5]: 5,
|
|
102
|
+
[TableBarColumnWidth.W10]: 10,
|
|
103
|
+
[TableBarColumnWidth.W15]: 15,
|
|
104
|
+
[TableBarColumnWidth.W20]: 20,
|
|
105
|
+
[TableBarColumnWidth.W25]: 25,
|
|
106
|
+
[TableBarColumnWidth.W30]: 30,
|
|
107
|
+
[TableBarColumnWidth.W40]: 40,
|
|
108
|
+
[TableBarColumnWidth.W60]: 60,
|
|
109
|
+
[TableBarColumnWidth.W80]: 80,
|
|
110
|
+
[TableBarColumnWidth.W100]: 100,
|
|
111
|
+
};
|
|
85
112
|
/**
|
|
86
113
|
* Three-level row hierarchy for grouping and drill-down: rowGroup > category > subCategory.
|
|
87
114
|
* Index variants (e.g. ROWGROUPINDEX) provide stable numeric sort keys that preserve
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These are used in component @Watch methods to warn about malformed attribute values
|
|
6
6
|
* without crashing the component.
|
|
7
7
|
*/
|
|
8
|
-
import { AggregationLevel, AxisLabelsMode, DataFormat, I18nMode, MeasureType, Scenarios, Sentiments, TableCategoryWidth, TableType, } from "./constants";
|
|
8
|
+
import { AggregationLevel, AxisLabelsMode, DataFormat, I18nMode, MeasureType, Scenarios, Sentiments, TableBarColumnWidth, TableCategoryWidth, TableType, } from "./constants";
|
|
9
9
|
import { DateDistance, DateLink } from "./DateStringFactory";
|
|
10
10
|
import { OrderColumn, OrderDirection } from "./model/Order";
|
|
11
11
|
/**
|
|
@@ -264,6 +264,9 @@ export function validateStylesString(value) {
|
|
|
264
264
|
export function isTableCategoryWidth(value) {
|
|
265
265
|
return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in TableCategoryWidth;
|
|
266
266
|
}
|
|
267
|
+
export function isTableBarColumnWidth(value) {
|
|
268
|
+
return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in TableBarColumnWidth;
|
|
269
|
+
}
|
|
267
270
|
export function validateColumnThereOfJsonStr(value) {
|
|
268
271
|
if (isBlankInput(value)) {
|
|
269
272
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./alasql.min.js";import{
|
|
1
|
+
import{a as e}from"./alasql.min.js";import{i as t}from"./Order.js";class a{constructor(e="",t=1){this.prefix=e,this.value=t}}var s;!function(e){e[e.Y=1e24]="Y",e[e.Z=1e21]="Z",e[e.E=1e18]="E",e[e.P=1e15]="P",e[e.T=1e12]="T",e[e.G=1e9]="G",e[e.M=1e6]="M",e[e.k=1e3]="k",e[e.h=100]="h",e[e.da=10]="da",e[e.d=.1]="d",e[e.c=.01]="c",e[e.m=.001]="m",e[e.my=1e-6]="my",e[e.n=1e-9]="n",e[e.p=1e-12]="p",e[e.f=1e-15]="f",e[e.a=1e-18]="a",e[e.z=1e-21]="z",e[e.y=1e-24]="y"}(s||(s={}));class r{static calculateMeasureScale(t,s,r){var n;if("_"===r)return new a;if(null!=r&&[...this.unitsLeast,...this.unitsGreat].includes(r))return this.lookupPrefix(r);if(0===s.length)return new a;const i=`SELECT MAX(GREATEST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`,u=`SELECT MIN(LEAST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`;let c=i;"LEAST"===(null==r?void 0:r.toUpperCase())&&(c=u);const l=null===(n=e(c,[t])[0])||void 0===n?void 0:n.prefixvalue;return this.determinePrefix(Math.abs(l))}static determinePrefix(e){if(e>=1e3){const t=Math.floor(Math.floor(Math.abs(e)).toString().length/3),s=+Math.pow(1e3,t);return new a(this.unitsGreat[t-1],s)}if(e<=.001){const t=Math.floor(Math.abs(e).toString().length/3),s=1/Math.pow(1e3,t);return new a(this.unitsLeast[t-1],s)}return new a}static lookupPrefix(e){return new a(e,s[e])}}r.unitsGreat=["k","M","G","T","P","E","Z","Y"],r.unitsLeast=["m","my","n","p","P","f","a","z","y"];class n{constructor(e=2,t=1){this.percent=e,this.decimal=t}}class i{adapt(e){const a=new n;return t.isNumber(e.percent)&&(a.percent=e.percent),t.isNumber(e.decimal)&&(a.decimal=e.decimal),a}default(){return new n}}export{r as D,a as S,n as a,i as b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as t}from"./Order.js";var e,r;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(e||(e={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(r||(r={}));class s{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,r){switch(r){case e.DAY:return this.getFormatedDayDate(t);case e.MONTH:return this.getFormatedMonthDate(t);case e.QUARTER:return this.getFormatedQuarterDate(t);case e.WEEK:return this.getFormatedWeekDate(t);case e.HOUR:return this.getFormatedHourDate(t);case e.MINUTE:return this.getFormatedMinuteDate(t);case e.SECOND:return this.getFormatedSecondDate(t);case e.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,r)}}calculateDistanceType(r,s,i=32){if(null==s)return e.DAY;const a="number"==typeof r?t.fromMillis(r):r,n="number"==typeof s?t.fromMillis(s):s;return 0===n.diff(a).as("milliseconds")?e.DAY:n.diff(a).as("milliseconds")<i?e.MILLISECOND:n.diff(a).as("seconds")<i?e.SECOND:n.diff(a).as("minutes")<i?e.MINUTE:n.diff(a).as("hours")<i?e.HOUR:n.diff(a).as("days")<i?e.DAY:n.diff(a).as("weeks")<i?e.WEEK:n.diff(a).as("months")<i?e.MONTH:n.diff(a).as("quarters")<i?e.QUARTER:e.YEAR}datesBetween(t,e,r,s){const i=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(i),n=e.endOf(i);let h=n.diff(a).as(i);const u=[];h>=s&&(h=s);let o=a;do{u.push(o),o=o.plus(this.createDiratonLike(i,1))}while(o<=n&&u.length<h);return u}getDateLinkString(s,i,a,n,h){if(null==s&&null==i)return"";if(null==s&&a!==r.END&&a!==r.YTD)return"";if(null==i&&(r.INTERVAL===a||r.CUM===a||r.END===a||r.YTD===a))return"";const u=s||t.now(),o=i;n===e.AUTO&&(n=this.calculateDistanceType(u,o,h));let c=this.getDateString(u,n),l="",d=r.NONE;return null!=o&&(l=this.getDateString(o,n),d=r.INTERVAL,c===l&&a===r.INTERVAL&&(a=r.NONE),c===l&&a===r.AVG&&(d=r.NONE),r.END!==a&&r.YTD!==a||(c=l),(a===r.INTERVAL||a===r.CUM||r.AVG)&&(n===e.QUARTER?u.quarter===o.quarter&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,"")):n===e.MONTH?u.month===o.month&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,"")):n===e.WEEK&&(u.weekNumber===o.weekNumber&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,""))))),this.dateLinkFormat[a].replace("[LINK]",this.dateLinkFormat[d]).replace("[DATE]",c).replace("[DATE2]",l)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let r;switch(t){case e.YEAR:r="year";break;case e.MONTH:r="month";break;case e.QUARTER:r="quarter";break;case e.WEEK:r="week";break;case e.DAY:r="day";break;case e.HOUR:r="hour";break;case e.MINUTE:r="minute";break;case e.SECOND:r="second";break;case e.MILLISECOND:r="millisecond";break;default:r="day"}return r}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}export{e as D,r as a,s as b}
|