drizzle-cube 0.5.4 → 0.5.6
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/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +4 -4
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +4 -4
- package/dist/adapters/{handler-CNn3q29F.cjs → handler-C0nUppAK.cjs} +3 -3
- package/dist/adapters/{handler-_TKfigrZ.js → handler-Odsi9_Rd.js} +125 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +4 -4
- package/dist/adapters/{locale-Dl_3R6hP.cjs → locale-Dv6bl_eU.cjs} +2 -2
- package/dist/adapters/{locale-BQQrZYhz.js → locale-Dy3LcTwN.js} +4 -2
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +8 -3
- package/dist/adapters/mcp-transport-BCtjU0lC.cjs +40 -0
- package/dist/adapters/mcp-transport-DW_Uks-O.js +579 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +4 -4
- package/dist/adapters/{utils-DG8ti3FT.js → utils-Bd5mzZfk.js} +44 -18
- package/dist/adapters/utils-DklqMBHn.cjs +128 -0
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.d.ts +6 -1
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts/chartConfigs.d.ts +34 -0
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{DashboardEditModal-BBcB0E2g.js → DashboardEditModal-BiJwVv0b.js} +11 -11
- package/dist/client/chunks/DashboardEditModal-BiJwVv0b.js.map +1 -0
- package/dist/client/chunks/{FieldSearchModal-CisOov-_.js → FieldSearchModal-DdcbCwAi.js} +21 -5
- package/dist/client/chunks/{FieldSearchModal-CisOov-_.js.map → FieldSearchModal-DdcbCwAi.js.map} +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-DiyZwiPv.js → RetentionCombinedChart-CivIny9P.js} +3 -3
- package/dist/client/chunks/{RetentionCombinedChart-DiyZwiPv.js.map → RetentionCombinedChart-CivIny9P.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-usGF7BCo.js → RetentionHeatmap-BHCgwZmB.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-usGF7BCo.js.map → RetentionHeatmap-BHCgwZmB.js.map} +1 -1
- package/dist/client/chunks/{af-ZA-xDmO5F0s.js → af-ZA-BdL6DOWy.js} +10 -3
- package/dist/client/chunks/af-ZA-BdL6DOWy.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-0o1W-k3K.js → analysis-builder-MoGvbMRe.js} +245 -255
- package/dist/client/chunks/analysis-builder-MoGvbMRe.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-Cz4KAlIC.js → analysis-builder-shared-DmyRh2O3.js} +391 -459
- package/dist/client/chunks/analysis-builder-shared-DmyRh2O3.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-VFFm85hC.js → chart-activity-grid-Bdb8U_NC.js} +14 -7
- package/dist/client/chunks/chart-activity-grid-Bdb8U_NC.js.map +1 -0
- package/dist/client/chunks/{chart-area-CwwIHTmK.js → chart-area-BZEnT-tf.js} +39 -38
- package/dist/client/chunks/chart-area-BZEnT-tf.js.map +1 -0
- package/dist/client/chunks/{chart-bar-Bmny922L.js → chart-bar-CTmdv_v0.js} +53 -52
- package/dist/client/chunks/chart-bar-CTmdv_v0.js.map +1 -0
- package/dist/client/chunks/{chart-box-plot-DM7GwtCV.js → chart-box-plot-CYObdFtp.js} +3 -3
- package/dist/client/chunks/{chart-box-plot-DM7GwtCV.js.map → chart-box-plot-CYObdFtp.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-DJOq4IpT.js → chart-bubble-CjFprySz.js} +3 -3
- package/dist/client/chunks/{chart-bubble-DJOq4IpT.js.map → chart-bubble-CjFprySz.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-C2nzVCv1.js → chart-candlestick-D2HoM3B5.js} +3 -3
- package/dist/client/chunks/{chart-candlestick-C2nzVCv1.js.map → chart-candlestick-D2HoM3B5.js.map} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-C-EkgYoa.js → chart-config-activity-grid-Bom99j9m.js} +9 -2
- package/dist/client/chunks/chart-config-activity-grid-Bom99j9m.js.map +1 -0
- package/dist/client/chunks/{chart-config-area-CMZpbIah.js → chart-config-area-DtYTKZxS.js} +10 -2
- package/dist/client/chunks/chart-config-area-DtYTKZxS.js.map +1 -0
- package/dist/client/chunks/{chart-config-bar-B8_V4YLg.js → chart-config-bar-7v5JVY2y.js} +10 -2
- package/dist/client/chunks/chart-config-bar-7v5JVY2y.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-Dwj7sEbU.js → chart-config-box-plot-BHGv-wqu.js} +9 -2
- package/dist/client/chunks/chart-config-box-plot-BHGv-wqu.js.map +1 -0
- package/dist/client/chunks/{chart-config-bubble-B0w0ZVp4.js → chart-config-bubble-BkHm-mfu.js} +9 -2
- package/dist/client/chunks/chart-config-bubble-BkHm-mfu.js.map +1 -0
- package/dist/client/chunks/{chart-config-candlestick-Bvo3zeIn.js → chart-config-candlestick-D1aaHvTe.js} +9 -2
- package/dist/client/chunks/chart-config-candlestick-D1aaHvTe.js.map +1 -0
- package/dist/client/chunks/{chart-config-data-table-BQXSn4b_.js → chart-config-data-table-B_Hw8w2J.js} +2 -2
- package/dist/client/chunks/{chart-config-data-table-BQXSn4b_.js.map → chart-config-data-table-B_Hw8w2J.js.map} +1 -1
- package/dist/client/chunks/{chart-config-funnel-BzEsHmjR.js → chart-config-funnel-DL8PSGuL.js} +2 -2
- package/dist/client/chunks/{chart-config-funnel-BzEsHmjR.js.map → chart-config-funnel-DL8PSGuL.js.map} +1 -1
- package/dist/client/chunks/{chart-config-gauge-C5ZiyZy7.js → chart-config-gauge-BVLxuA3f.js} +6 -2
- package/dist/client/chunks/chart-config-gauge-BVLxuA3f.js.map +1 -0
- package/dist/client/chunks/{chart-config-heat-map-Cv8qNnVP.js → chart-config-heat-map-CjudGdui.js} +9 -2
- package/dist/client/chunks/chart-config-heat-map-CjudGdui.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-BraHQc2E.js → chart-config-kpi-delta-Bf47hGqD.js} +9 -2
- package/dist/client/chunks/chart-config-kpi-delta-Bf47hGqD.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-CeCkx7mC.js → chart-config-kpi-number-QTQRNgOi.js} +6 -2
- package/dist/client/chunks/chart-config-kpi-number-QTQRNgOi.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-CImM3SvH.js → chart-config-kpi-text-BRze2eyh.js} +6 -2
- package/dist/client/chunks/chart-config-kpi-text-BRze2eyh.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-BVKapAQK.js → chart-config-line-BFeCqmKH.js} +10 -2
- package/dist/client/chunks/chart-config-line-BFeCqmKH.js.map +1 -0
- package/dist/client/chunks/{chart-config-markdown-C-_g_8te.js → chart-config-markdown-EWYckwXv.js} +2 -2
- package/dist/client/chunks/{chart-config-markdown-C-_g_8te.js.map → chart-config-markdown-EWYckwXv.js.map} +1 -1
- package/dist/client/chunks/{chart-config-measure-profile-KTVV1gO3.js → chart-config-measure-profile-B9nIhqKR.js} +6 -2
- package/dist/client/chunks/chart-config-measure-profile-B9nIhqKR.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-BZxVl25X.js → chart-config-pie-6LHtEyMM.js} +9 -2
- package/dist/client/chunks/chart-config-pie-6LHtEyMM.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-B7FByX3t.js → chart-config-radar-BuLS6Inn.js} +9 -2
- package/dist/client/chunks/chart-config-radar-BuLS6Inn.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-UfW_3yyX.js → chart-config-radial-bar-BP0eMohx.js} +9 -2
- package/dist/client/chunks/chart-config-radial-bar-BP0eMohx.js.map +1 -0
- package/dist/client/chunks/{chart-config-sankey-DGAThN9i.js → chart-config-sankey-CT8oGIGP.js} +2 -2
- package/dist/client/chunks/{chart-config-sankey-DGAThN9i.js.map → chart-config-sankey-CT8oGIGP.js.map} +1 -1
- package/dist/client/chunks/{chart-config-scatter-BVVJuOnt.js → chart-config-scatter-DOSpN07Z.js} +9 -2
- package/dist/client/chunks/chart-config-scatter-DOSpN07Z.js.map +1 -0
- package/dist/client/chunks/{chart-config-sunburst-utejM2YS.js → chart-config-sunburst-BSUX_YoB.js} +2 -2
- package/dist/client/chunks/{chart-config-sunburst-utejM2YS.js.map → chart-config-sunburst-BSUX_YoB.js.map} +1 -1
- package/dist/client/chunks/{chart-config-tree-map-IHp97OyV.js → chart-config-tree-map-D8GuAgVB.js} +9 -2
- package/dist/client/chunks/chart-config-tree-map-D8GuAgVB.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-BdqG1V-x.js → chart-config-waterfall-BDi7BoJP.js} +9 -2
- package/dist/client/chunks/chart-config-waterfall-BDi7BoJP.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-zZtwLf55.js → chart-data-table-DT4uBZaq.js} +92 -90
- package/dist/client/chunks/{chart-data-table-zZtwLf55.js.map → chart-data-table-DT4uBZaq.js.map} +1 -1
- package/dist/client/chunks/{chart-funnel-COTJy8BP.js → chart-funnel-B9crR3b3.js} +3 -3
- package/dist/client/chunks/{chart-funnel-COTJy8BP.js.map → chart-funnel-B9crR3b3.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-C8lIneI0.js → chart-gauge-DAMFsicz.js} +3 -3
- package/dist/client/chunks/{chart-gauge-C8lIneI0.js.map → chart-gauge-DAMFsicz.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-BJXt3RMt.js → chart-heat-map-BxgM_X1G.js} +3 -3
- package/dist/client/chunks/{chart-heat-map-BJXt3RMt.js.map → chart-heat-map-BxgM_X1G.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-DHkNqufb.js → chart-kpi-delta-DJKL02Ut.js} +75 -73
- package/dist/client/chunks/{chart-kpi-delta-DHkNqufb.js.map → chart-kpi-delta-DJKL02Ut.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-BrXw7m-S.js → chart-kpi-number-CuNEYbRx.js} +66 -65
- package/dist/client/chunks/{chart-kpi-number-BrXw7m-S.js.map → chart-kpi-number-CuNEYbRx.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-D0plngLV.js → chart-kpi-text-u8FJaZDQ.js} +27 -26
- package/dist/client/chunks/{chart-kpi-text-D0plngLV.js.map → chart-kpi-text-u8FJaZDQ.js.map} +1 -1
- package/dist/client/chunks/{chart-line-DKvW32U-.js → chart-line-BZhzOjRl.js} +119 -118
- package/dist/client/chunks/chart-line-BZhzOjRl.js.map +1 -0
- package/dist/client/chunks/{chart-markdown-CJU2hUq3.js → chart-markdown-DEtjn8gx.js} +70 -69
- package/dist/client/chunks/chart-markdown-DEtjn8gx.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-DNT_tbh4.js → chart-measure-profile-BnpIOS4Q.js} +4 -4
- package/dist/client/chunks/{chart-measure-profile-DNT_tbh4.js.map → chart-measure-profile-BnpIOS4Q.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-CzYnncO-.js → chart-pie-CsdzxmSK.js} +4 -4
- package/dist/client/chunks/{chart-pie-CzYnncO-.js.map → chart-pie-CsdzxmSK.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-8iAt3QZl.js → chart-radar-C_9RwMKw.js} +4 -4
- package/dist/client/chunks/{chart-radar-8iAt3QZl.js.map → chart-radar-C_9RwMKw.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-CJbG7RIe.js → chart-radial-bar-CewRelyQ.js} +4 -4
- package/dist/client/chunks/{chart-radial-bar-CJbG7RIe.js.map → chart-radial-bar-CewRelyQ.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-C-wLBUmb.js → chart-sankey-ItraHWH1.js} +3 -3
- package/dist/client/chunks/{chart-sankey-C-wLBUmb.js.map → chart-sankey-ItraHWH1.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-NMjD1lbW.js → chart-scatter-k2IJbO2Y.js} +4 -4
- package/dist/client/chunks/{chart-scatter-NMjD1lbW.js.map → chart-scatter-k2IJbO2Y.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-HtJ-LJ7n.js → chart-sunburst-NsFRuqi9.js} +4 -4
- package/dist/client/chunks/{chart-sunburst-HtJ-LJ7n.js.map → chart-sunburst-NsFRuqi9.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-CetaLMt8.js → chart-tree-map-Cj_ewpwJ.js} +4 -4
- package/dist/client/chunks/{chart-tree-map-CetaLMt8.js.map → chart-tree-map-Cj_ewpwJ.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-ontNp1Sd.js → chart-waterfall-C-MTFcOz.js} +4 -4
- package/dist/client/chunks/{chart-waterfall-ontNp1Sd.js.map → chart-waterfall-C-MTFcOz.js.map} +1 -1
- package/dist/client/chunks/{charts-core-B5UXUg6_.js → charts-core-vZA3zPKb.js} +2 -2
- package/dist/client/chunks/{charts-core-B5UXUg6_.js.map → charts-core-vZA3zPKb.js.map} +1 -1
- package/dist/client/chunks/{core-Dk6z6kC0.js → core-Su6tIYhp.js} +5 -3
- package/dist/client/chunks/{core-Dk6z6kC0.js.map → core-Su6tIYhp.js.map} +1 -1
- package/dist/client/chunks/{dist-eZurnOde.js → dist-BTq3NoG3.js} +38 -32
- package/dist/client/chunks/dist-BTq3NoG3.js.map +1 -0
- package/dist/client/chunks/{en-US-5xPTdCXg.js → en-US-D-1JPTPv.js} +1 -1
- package/dist/client/chunks/{en-US-5xPTdCXg.js.map → en-US-D-1JPTPv.js.map} +1 -1
- package/dist/client/chunks/{exceljs.min-DaJsLlWM.js → exceljs.min-Dc1cBQ5l.js} +71 -45
- package/dist/client/chunks/{exceljs.min-DaJsLlWM.js.map → exceljs.min-Dc1cBQ5l.js.map} +1 -1
- package/dist/client/chunks/{javascript-DFvvCuoP.js → javascript-YXkoOgWa.js} +1 -1
- package/dist/client/chunks/{javascript-DFvvCuoP.js.map → javascript-YXkoOgWa.js.map} +1 -1
- package/dist/client/chunks/{json-BBm9TlrA.js → json-O7MKB_4V.js} +1 -1
- package/dist/client/chunks/{json-BBm9TlrA.js.map → json-O7MKB_4V.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-DDf0OdfW.js → nl-NL-BErZMygi.js} +10 -3
- package/dist/client/chunks/nl-NL-BErZMygi.js.map +1 -0
- package/dist/client/chunks/{rolldown-runtime-CCl2IeXn.js → rolldown-runtime-CKnJJeip.js} +1 -1
- package/dist/client/chunks/{schema-visualization-cnB2xZxn.js → schema-visualization-BY9L2nBQ.js} +294 -290
- package/dist/client/chunks/{schema-visualization-cnB2xZxn.js.map → schema-visualization-BY9L2nBQ.js.map} +1 -1
- package/dist/client/chunks/{sql-k0GA6oZ_.js → sql-r2a-9CCK.js} +1 -1
- package/dist/client/chunks/{sql-k0GA6oZ_.js.map → sql-r2a-9CCK.js.map} +1 -1
- package/dist/client/chunks/{syntaxHighlighting-D8J6Yt9j.js → syntaxHighlighting-5zHcjn27.js} +2 -2
- package/dist/client/chunks/{syntaxHighlighting-D8J6Yt9j.js.map → syntaxHighlighting-5zHcjn27.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-BOBSvhHy.js → useDebounce-DGfYXtkm.js} +4 -4
- package/dist/client/chunks/{useDebounce-BOBSvhHy.js.map → useDebounce-DGfYXtkm.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-B_Pi4eXW.js → useExplainAI-CD0KuKwY.js} +4 -4
- package/dist/client/chunks/{useExplainAI-B_Pi4eXW.js.map → useExplainAI-CD0KuKwY.js.map} +1 -1
- package/dist/client/chunks/{utils-BIuqPQuJ.js → utils-D2SCtAkZ.js} +2 -2
- package/dist/client/chunks/{utils-BIuqPQuJ.js.map → utils-D2SCtAkZ.js.map} +1 -1
- package/dist/client/chunks/{vendor-BxLCTfvm.js → vendor-CfR5hJGc.js} +3 -3
- package/dist/client/chunks/{vendor-BxLCTfvm.js.map → vendor-CfR5hJGc.js.map} +1 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +2 -2
- package/dist/client/components.js +3 -3
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +15 -15
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/shared/chartDefaults.d.ts +5 -10
- package/dist/client/types.d.ts +1 -0
- package/dist/client/utils.js +6 -6
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +48 -48
- package/dist/server/index.cjs +7 -7
- package/dist/server/index.js +159 -16
- package/package.json +2 -2
- package/dist/adapters/mcp-transport-CkyawtUT.cjs +0 -40
- package/dist/adapters/mcp-transport-DSbd6M_u.js +0 -586
- package/dist/adapters/utils-DrWvXf0G.cjs +0 -128
- package/dist/client/chunks/DashboardEditModal-BBcB0E2g.js.map +0 -1
- package/dist/client/chunks/KpiDelta-D09hA_UJ.js +0 -2
- package/dist/client/chunks/KpiNumber-B7F9F9fC.js +0 -2
- package/dist/client/chunks/KpiText-C3ZXOF8b.js +0 -2
- package/dist/client/chunks/SchemaVisualization-DP4k1fPp.js +0 -2
- package/dist/client/chunks/SchemaVisualizationLazy-Brqv_PY9.js +0 -2
- package/dist/client/chunks/af-ZA-xDmO5F0s.js.map +0 -1
- package/dist/client/chunks/analysis-builder-0o1W-k3K.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-Cz4KAlIC.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-VFFm85hC.js.map +0 -1
- package/dist/client/chunks/chart-area-CwwIHTmK.js.map +0 -1
- package/dist/client/chunks/chart-bar-Bmny922L.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js.map +0 -1
- package/dist/client/chunks/chart-config-area-CMZpbIah.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-B8_V4YLg.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js.map +0 -1
- package/dist/client/chunks/chart-config-line-BVKapAQK.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-BZxVl25X.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-B7FByX3t.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js.map +0 -1
- package/dist/client/chunks/chart-line-DKvW32U-.js.map +0 -1
- package/dist/client/chunks/chart-markdown-CJU2hUq3.js.map +0 -1
- package/dist/client/chunks/dist-eZurnOde.js.map +0 -1
- package/dist/client/chunks/nl-NL-DDf0OdfW.js.map +0 -1
package/dist/client/chunks/{chart-kpi-text-D0plngLV.js.map → chart-kpi-text-u8FJaZDQ.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-kpi-text-D0plngLV.js","names":[],"sources":["../../../src/client/components/charts/KpiText.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport { useCubeFieldLabel } from '../../hooks/useCubeFieldLabel'\nimport DataHistogram from '../DataHistogram'\nimport type { ChartProps } from '../../types'\n\nconst KpiText = React.memo(function KpiText({\n data,\n chartConfig,\n displayConfig = {},\n height = \"100%\",\n colorPalette\n}: ChartProps) {\n const { t } = useTranslation()\n const [fontSize, setFontSize] = useState(28)\n const [textWidth, setTextWidth] = useState(0)\n const containerRef = useRef<HTMLDivElement>(null)\n const textRef = useRef<HTMLDivElement>(null)\n // Use specialized hook to avoid re-renders from unrelated context changes\n const getFieldLabel = useCubeFieldLabel()\n\n // Calculate font size and text width based on container dimensions\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const container = containerRef.current\n const rect = container.getBoundingClientRect()\n const containerWidth = rect.width\n const containerHeight = rect.height\n \n if (containerWidth > 0 && containerHeight > 0) {\n // Calculate font size based on container dimensions\n // For KPI Text displays, text might be longer so use more conservative sizing\n // Also reserve space for potential statistics display\n const widthBasedSize = containerWidth / 8\n const heightBasedSize = containerHeight / 5\n const baseFontSize = Math.min(widthBasedSize, heightBasedSize)\n const clampedFontSize = Math.max(18, Math.min(baseFontSize, 80))\n setFontSize(clampedFontSize)\n }\n }\n \n // Measure the text width after font size is set\n if (textRef.current) {\n const textRect = textRef.current.getBoundingClientRect()\n setTextWidth(textRect.width)\n }\n }\n\n // Initial calculation after a short delay to ensure the container is fully rendered\n const timer = setTimeout(updateDimensions, 100)\n \n const resizeObserver = new ResizeObserver(() => {\n // Debounce the resize updates\n clearTimeout(timer)\n setTimeout(updateDimensions, 50)\n })\n \n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n return () => {\n clearTimeout(timer)\n resizeObserver.disconnect()\n }\n }, [data, chartConfig])\n\n if (!data || data.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined\n }}\n >\n <div className=\"dc:text-center text-dc-text-muted\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noData')}</div>\n <div className=\"dc:text-xs text-dc-text-secondary\">{t('chart.runtime.noDataHint.kpi')}</div>\n </div>\n </div>\n )\n }\n\n // Extract value field from chart config - handle both string and array formats\n let valueFields: string[] = []\n if (chartConfig?.yAxis) {\n // Handle both string and array formats\n if (typeof chartConfig.yAxis === 'string') {\n valueFields = [chartConfig.yAxis]\n } else if (Array.isArray(chartConfig.yAxis)) {\n valueFields = chartConfig.yAxis\n }\n }\n \n \n if (valueFields.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined,\n backgroundColor: 'var(--dc-danger-bg)',\n color: 'var(--dc-danger)',\n borderColor: 'var(--dc-danger-border)'\n }}\n >\n <div className=\"dc:text-center\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.configError')}</div>\n <div className=\"dc:text-xs\">{t('chart.runtime.configErrorHint.noMeasures')}</div>\n </div>\n </div>\n )\n }\n\n const valueField = valueFields[0] // Use first measure field\n \n // Debug logging (remove in production)\n \n // Extract values for the selected field\n const values = data\n .map(row => {\n // Try direct field access first\n if (row[valueField] !== undefined) {\n return row[valueField]\n }\n \n // If not found, try finding the first available field as fallback\n const availableFields = Object.keys(row)\n if (availableFields.length > 0) {\n // Field not found, using fallback\n return row[availableFields[0]]\n }\n \n return undefined\n })\n .filter(val => val !== null && val !== undefined)\n \n\n if (values.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined,\n backgroundColor: 'var(--dc-warning-bg)',\n color: 'var(--dc-warning)',\n borderColor: 'var(--dc-warning-border)'\n }}\n >\n <div className=\"dc:text-center\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noValidData')}</div>\n <div className=\"dc:text-xs\">{t('chart.runtime.noValidDataHint.kpiText')}</div>\n </div>\n </div>\n )\n }\n\n // Calculate statistics for numeric values\n const numericValues = values\n .map(val => Number(val))\n .filter(val => !isNaN(val))\n\n let mainValue: any\n let min: number | null = null\n let max: number | null = null\n let showStats = false\n\n if (numericValues.length > 0) {\n if (values.length === 1) {\n mainValue = values[0]\n } else {\n // Calculate average for multiple numeric values\n const sum = numericValues.reduce((acc, val) => acc + val, 0)\n const avg = sum / numericValues.length\n mainValue = avg\n min = Math.min(...numericValues)\n max = Math.max(...numericValues)\n showStats = true\n }\n } else {\n // Non-numeric values - just use the first one or concatenate if multiple\n mainValue = values.length === 1 ? values[0] : values.join(', ')\n }\n\n // Format number with appropriate units and decimals\n const formatNumber = (value: number | null | undefined): string => {\n // If custom formatValue is provided, use it exclusively\n if (displayConfig.formatValue) {\n return displayConfig.formatValue(value)\n }\n\n // Null handling: Show placeholder for missing data\n if (value === null || value === undefined) {\n return '—'\n }\n\n const decimals = displayConfig.decimals ?? 2\n\n if (Math.abs(value) >= 1e9) {\n return (value / 1e9).toFixed(decimals) + 'B'\n } else if (Math.abs(value) >= 1e6) {\n return (value / 1e6).toFixed(decimals) + 'M'\n } else if (Math.abs(value) >= 1e3) {\n return (value / 1e3).toFixed(decimals) + 'K'\n } else {\n return value.toFixed(decimals)\n }\n }\n\n // Process template string\n const processTemplate = (template: string, value: any): string => {\n try {\n // Create template variables\n const templateVars = {\n value: typeof value === 'number' ? formatNumber(value) : String(value),\n rawValue: value,\n field: valueField,\n fieldLabel: getFieldLabel(valueField),\n min: min !== null ? formatNumber(min) : '',\n max: max !== null ? formatNumber(max) : '',\n count: values.length\n }\n\n // Simple template replacement using ${variable} syntax\n return template.replace(/\\$\\{(\\w+)\\}/g, (match, varName) => {\n if (varName in templateVars) {\n return String(templateVars[varName as keyof typeof templateVars])\n }\n return match\n })\n } catch {\n // Error processing template\n return String(value)\n }\n }\n\n const template = displayConfig.template || '${fieldLabel}: ${value}'\n const displayText = processTemplate(template, mainValue)\n\n // Get color from palette by index, default to first color in palette\n const getValueColor = (): string => {\n if (displayConfig.valueColorIndex !== undefined && colorPalette?.colors) {\n const colorIndex = displayConfig.valueColorIndex\n if (colorIndex >= 0 && colorIndex < colorPalette.colors.length) {\n return colorPalette.colors[colorIndex]\n }\n }\n // Default to first color in palette if available, otherwise fallback to dark gray\n return colorPalette?.colors?.[0] || '#1f2937'\n }\n\n const valueColor = getValueColor()\n\n return (\n <div \n ref={containerRef}\n className=\"dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full dc:h-full dc:p-4\"\n style={{ \n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined\n }}\n >\n {/* Main KPI Text */}\n <div \n ref={textRef}\n className=\"dc:font-bold dc:leading-tight dc:text-center\"\n style={{ \n fontSize: `${fontSize}px`,\n color: valueColor \n }}\n >\n {displayText}\n </div>\n\n {/* Data Histogram for multiple values */}\n {showStats && min !== null && max !== null && (\n <div className=\"dc:mt-4\">\n <DataHistogram\n values={values}\n min={min}\n max={max}\n color={valueColor}\n formatValue={formatNumber}\n height={24}\n width={textWidth || 200}\n />\n </div>\n )}\n </div>\n )\n})\n\nexport default KpiText"],"mappings":";;;;;AAMA,IAAM,IAAU,EAAM,KAAK,SAAiB,EAC1C,SACA,gBACA,mBAAgB,EAAE,EAClB,YAAS,QACT,mBACa;CACb,IAAM,EAAE,SAAM,GAAgB,EACxB,CAAC,GAAU,KAAe,EAAS,GAAG,EACtC,CAAC,GAAW,KAAgB,EAAS,EAAE,EACvC,IAAe,EAAuB,KAAK,EAC3C,IAAU,EAAuB,KAAK,EAEtC,IAAgB,GAAmB;AAiDzC,KA9CA,QAAgB;EACd,IAAM,UAAyB;AAC7B,OAAI,EAAa,SAAS;IAExB,IAAM,IADY,EAAa,QACR,uBAAuB,EACxC,IAAiB,EAAK,OACtB,IAAkB,EAAK;AAE7B,QAAI,IAAiB,KAAK,I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;IACR,OAAO,KAAa;IACpB,CAAA;GACE,CAAA,CAEN;;EAER"}
|
|
1
|
+
{"version":3,"file":"chart-kpi-text-u8FJaZDQ.js","names":[],"sources":["../../../src/client/components/charts/KpiText.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport { useCubeFieldLabel } from '../../hooks/useCubeFieldLabel'\nimport DataHistogram from '../DataHistogram'\nimport type { ChartProps } from '../../types'\n\nconst KpiText = React.memo(function KpiText({\n data,\n chartConfig,\n displayConfig = {},\n height = \"100%\",\n colorPalette\n}: ChartProps) {\n const { t } = useTranslation()\n const [fontSize, setFontSize] = useState(28)\n const [textWidth, setTextWidth] = useState(0)\n const containerRef = useRef<HTMLDivElement>(null)\n const textRef = useRef<HTMLDivElement>(null)\n // Use specialized hook to avoid re-renders from unrelated context changes\n const getFieldLabel = useCubeFieldLabel()\n\n // Calculate font size and text width based on container dimensions\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const container = containerRef.current\n const rect = container.getBoundingClientRect()\n const containerWidth = rect.width\n const containerHeight = rect.height\n \n if (containerWidth > 0 && containerHeight > 0) {\n // Calculate font size based on container dimensions\n // For KPI Text displays, text might be longer so use more conservative sizing\n // Also reserve space for potential statistics display\n const widthBasedSize = containerWidth / 8\n const heightBasedSize = containerHeight / 5\n const baseFontSize = Math.min(widthBasedSize, heightBasedSize)\n const clampedFontSize = Math.max(18, Math.min(baseFontSize, 80))\n setFontSize(clampedFontSize)\n }\n }\n \n // Measure the text width after font size is set\n if (textRef.current) {\n const textRect = textRef.current.getBoundingClientRect()\n setTextWidth(textRect.width)\n }\n }\n\n // Initial calculation after a short delay to ensure the container is fully rendered\n const timer = setTimeout(updateDimensions, 100)\n \n const resizeObserver = new ResizeObserver(() => {\n // Debounce the resize updates\n clearTimeout(timer)\n setTimeout(updateDimensions, 50)\n })\n \n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n return () => {\n clearTimeout(timer)\n resizeObserver.disconnect()\n }\n }, [data, chartConfig])\n\n if (!data || data.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined\n }}\n >\n <div className=\"dc:text-center text-dc-text-muted\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noData')}</div>\n <div className=\"dc:text-xs text-dc-text-secondary\">{t('chart.runtime.noDataHint.kpi')}</div>\n </div>\n </div>\n )\n }\n\n // Extract value field from chart config - handle both string and array formats\n let valueFields: string[] = []\n if (chartConfig?.yAxis) {\n // Handle both string and array formats\n if (typeof chartConfig.yAxis === 'string') {\n valueFields = [chartConfig.yAxis]\n } else if (Array.isArray(chartConfig.yAxis)) {\n valueFields = chartConfig.yAxis\n }\n }\n \n \n if (valueFields.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined,\n backgroundColor: 'var(--dc-danger-bg)',\n color: 'var(--dc-danger)',\n borderColor: 'var(--dc-danger-border)'\n }}\n >\n <div className=\"dc:text-center\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.configError')}</div>\n <div className=\"dc:text-xs\">{t('chart.runtime.configErrorHint.noMeasures')}</div>\n </div>\n </div>\n )\n }\n\n const valueField = valueFields[0] // Use first measure field\n \n // Debug logging (remove in production)\n \n // Extract values for the selected field\n const values = data\n .map(row => {\n // Try direct field access first\n if (row[valueField] !== undefined) {\n return row[valueField]\n }\n \n // If not found, try finding the first available field as fallback\n const availableFields = Object.keys(row)\n if (availableFields.length > 0) {\n // Field not found, using fallback\n return row[availableFields[0]]\n }\n \n return undefined\n })\n .filter(val => val !== null && val !== undefined)\n \n\n if (values.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full\"\n style={{\n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined,\n backgroundColor: 'var(--dc-warning-bg)',\n color: 'var(--dc-warning)',\n borderColor: 'var(--dc-warning-border)'\n }}\n >\n <div className=\"dc:text-center\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noValidData')}</div>\n <div className=\"dc:text-xs\">{t('chart.runtime.noValidDataHint.kpiText')}</div>\n </div>\n </div>\n )\n }\n\n // Calculate statistics for numeric values\n const numericValues = values\n .map(val => Number(val))\n .filter(val => !isNaN(val))\n\n let mainValue: any\n let min: number | null = null\n let max: number | null = null\n let showStats = false\n\n if (numericValues.length > 0) {\n if (values.length === 1) {\n mainValue = values[0]\n } else {\n // Calculate average for multiple numeric values\n const sum = numericValues.reduce((acc, val) => acc + val, 0)\n const avg = sum / numericValues.length\n mainValue = avg\n min = Math.min(...numericValues)\n max = Math.max(...numericValues)\n showStats = true\n }\n } else {\n // Non-numeric values - just use the first one or concatenate if multiple\n mainValue = values.length === 1 ? values[0] : values.join(', ')\n }\n\n // Format number with appropriate units and decimals\n const formatNumber = (value: number | null | undefined): string => {\n // If custom formatValue is provided, use it exclusively\n if (displayConfig.formatValue) {\n return displayConfig.formatValue(value)\n }\n\n // Null handling: Show placeholder for missing data\n if (value === null || value === undefined) {\n return '—'\n }\n\n const decimals = displayConfig.decimals ?? 2\n\n if (Math.abs(value) >= 1e9) {\n return (value / 1e9).toFixed(decimals) + 'B'\n } else if (Math.abs(value) >= 1e6) {\n return (value / 1e6).toFixed(decimals) + 'M'\n } else if (Math.abs(value) >= 1e3) {\n return (value / 1e3).toFixed(decimals) + 'K'\n } else {\n return value.toFixed(decimals)\n }\n }\n\n // Process template string\n const processTemplate = (template: string, value: any): string => {\n try {\n // Create template variables\n const templateVars = {\n value: typeof value === 'number' ? formatNumber(value) : String(value),\n rawValue: value,\n field: valueField,\n fieldLabel: getFieldLabel(valueField),\n min: min !== null ? formatNumber(min) : '',\n max: max !== null ? formatNumber(max) : '',\n count: values.length\n }\n\n // Simple template replacement using ${variable} syntax\n return template.replace(/\\$\\{(\\w+)\\}/g, (match, varName) => {\n if (varName in templateVars) {\n return String(templateVars[varName as keyof typeof templateVars])\n }\n return match\n })\n } catch {\n // Error processing template\n return String(value)\n }\n }\n\n const template = displayConfig.template || '${fieldLabel}: ${value}'\n const displayText = processTemplate(template, mainValue)\n\n // Get color from palette by index, default to first color in palette\n const getValueColor = (): string => {\n if (displayConfig.valueColorIndex !== undefined && colorPalette?.colors) {\n const colorIndex = displayConfig.valueColorIndex\n if (colorIndex >= 0 && colorIndex < colorPalette.colors.length) {\n return colorPalette.colors[colorIndex]\n }\n }\n // Default to first color in palette if available, otherwise fallback to dark gray\n return colorPalette?.colors?.[0] || '#1f2937'\n }\n\n const valueColor = getValueColor()\n\n return (\n <div \n ref={containerRef}\n className=\"dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full dc:h-full dc:p-4\"\n style={{ \n height: height === \"100%\" ? \"100%\" : height,\n minHeight: height === \"100%\" ? '200px' : undefined\n }}\n >\n {/* Main KPI Text */}\n <div \n ref={textRef}\n className=\"dc:font-bold dc:leading-tight dc:text-center\"\n style={{ \n fontSize: `${fontSize}px`,\n color: valueColor \n }}\n >\n {displayText}\n </div>\n\n {/* Data Histogram for multiple values */}\n {showStats && min !== null && max !== null && (\n <div className=\"dc:mt-4\">\n <DataHistogram\n values={values}\n min={min}\n max={max}\n color={valueColor}\n formatValue={formatNumber}\n height={24}\n width={textWidth || 200}\n />\n </div>\n )}\n </div>\n )\n})\n\nexport default KpiText"],"mappings":";;;;;;iDAMM,IAAU,EAAM,KAAK,SAAiB,EAC1C,SACA,gBACA,mBAAgB,EAAE,EAClB,YAAS,QACT,mBACa;CACb,IAAM,EAAE,SAAM,GAAgB,EACxB,CAAC,GAAU,KAAe,EAAS,GAAG,EACtC,CAAC,GAAW,KAAgB,EAAS,EAAE,EACv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,CASI,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;GACV,OAAO;IACL,UAAU,GAAG,EAAS;IACtB,OAAO;IACR;aAEA;GACG,CAAA,EAGL,KAAa,MAAQ,QAAQ,MAAQ,QACpC,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IACU;IACH;IACA;IACL,OAAO;IACP,aAAa;IACb,QAAQ;IACR,OAAO,KAAa;IACpB,CAAA;GACE,CAAA,CAEN;;EAER"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-
|
|
2
|
-
import { D as t, S as n, _ as r, i, k as a, n as o, x as s, y as c } from "./chart-activity-grid-
|
|
3
|
-
import { a as l, c as u, l as d, o as f, s as p } from "./chart-area-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CKnJJeip.js";
|
|
2
|
+
import { D as t, S as n, _ as r, i, k as a, n as o, x as s, y as c } from "./chart-activity-grid-Bdb8U_NC.js";
|
|
3
|
+
import { a as l, c as u, l as d, o as f, s as p } from "./chart-area-BZEnT-tf.js";
|
|
4
4
|
import m, { useMemo as h, useState as g } from "react";
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { CartesianGrid as
|
|
5
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
6
|
+
import { CartesianGrid as b, Legend as ee, Line as x, LineChart as te, XAxis as S, YAxis as C } from "recharts";
|
|
7
7
|
//#region src/client/utils/comparisonUtils.ts
|
|
8
|
-
function
|
|
8
|
+
function w(e) {
|
|
9
9
|
return e.length > 0 && "__periodIndex" in e[0];
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (!
|
|
11
|
+
function T(e) {
|
|
12
|
+
if (!w(e)) return [];
|
|
13
13
|
let t = /* @__PURE__ */ new Set();
|
|
14
14
|
for (let n of e) n.__period && t.add(n.__period);
|
|
15
15
|
return Array.from(t);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
if (!
|
|
17
|
+
function E(e) {
|
|
18
|
+
if (!w(e)) return [];
|
|
19
19
|
let t = /* @__PURE__ */ new Set();
|
|
20
20
|
for (let n of e) typeof n.__periodIndex == "number" && t.add(n.__periodIndex);
|
|
21
21
|
return Array.from(t).sort((e, t) => e - t);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function D(e, t) {
|
|
24
24
|
return t === 0 ? "Current" : "Prior";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
26
|
+
function O(e, t, n) {
|
|
27
|
+
if (!w(e)) return {
|
|
28
28
|
data: e,
|
|
29
29
|
seriesKeys: t
|
|
30
30
|
};
|
|
31
|
-
let r =
|
|
31
|
+
let r = T(e), i = [];
|
|
32
32
|
for (let e of t) for (let t = 0; t < r.length; t++) {
|
|
33
|
-
let n = `${e} (${
|
|
33
|
+
let n = `${e} (${D(r[t], t)})`;
|
|
34
34
|
i.push(n);
|
|
35
35
|
}
|
|
36
36
|
return {
|
|
@@ -38,7 +38,7 @@ function k(e, t, n) {
|
|
|
38
38
|
seriesKeys: i
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function k(e, t, n) {
|
|
42
42
|
if (e.length === 0) return [];
|
|
43
43
|
let r = [
|
|
44
44
|
"__period",
|
|
@@ -48,19 +48,19 @@ function A(e, t, n) {
|
|
|
48
48
|
for (let e of Object.keys(i)) !t.includes(e) && e !== n && !r.includes(e) && a.push(e);
|
|
49
49
|
return a;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function A(e, t) {
|
|
52
52
|
let n = /* @__PURE__ */ new Map();
|
|
53
53
|
for (let e of t) n.set(e, /* @__PURE__ */ new Set());
|
|
54
54
|
for (let r of e) for (let e of t) r[e] !== void 0 && r[e] !== null && n.get(e).add(r[e]);
|
|
55
55
|
return n;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
if (!
|
|
57
|
+
function j(e, t, n, r) {
|
|
58
|
+
if (!w(e)) return {
|
|
59
59
|
data: e,
|
|
60
60
|
seriesKeys: t,
|
|
61
61
|
xAxisKey: n
|
|
62
62
|
};
|
|
63
|
-
let i =
|
|
63
|
+
let i = T(e), a = E(e), o = k(e, t, n), s = o.length > 0, c = s ? A(e, o) : null, l = /* @__PURE__ */ new Map();
|
|
64
64
|
for (let a of e) {
|
|
65
65
|
let e = a.__periodDayIndex, c = a.__periodIndex;
|
|
66
66
|
l.has(e) || l.set(e, {
|
|
@@ -74,7 +74,7 @@ function M(e, t, n, r) {
|
|
|
74
74
|
let t = a[e];
|
|
75
75
|
return r ? r(String(t)) : String(t);
|
|
76
76
|
}).join(" / "));
|
|
77
|
-
let f =
|
|
77
|
+
let f = D(i[c] || "", c);
|
|
78
78
|
for (let e of t) {
|
|
79
79
|
let t = r ? r(e) : e, n = d ? `${d} - ${t} (${f})` : `${t} (${f})`;
|
|
80
80
|
u[n] = a[e];
|
|
@@ -82,18 +82,18 @@ function M(e, t, n, r) {
|
|
|
82
82
|
}
|
|
83
83
|
let u = Array.from(l.values()).sort((e, t) => e.__periodDayIndex - t.__periodDayIndex), d = [];
|
|
84
84
|
if (s && c) {
|
|
85
|
-
let e =
|
|
85
|
+
let e = M(o, c, r);
|
|
86
86
|
for (let n of e) for (let e of t) {
|
|
87
87
|
let t = r ? r(e) : e;
|
|
88
88
|
for (let e = 0; e < a.length; e++) {
|
|
89
|
-
let r =
|
|
89
|
+
let r = D(i[e] || "", e);
|
|
90
90
|
d.push(`${n} - ${t} (${r})`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
} else for (let e of t) {
|
|
94
94
|
let t = r ? r(e) : e;
|
|
95
95
|
for (let e = 0; e < a.length; e++) {
|
|
96
|
-
let n =
|
|
96
|
+
let n = D(i[e] || "", e);
|
|
97
97
|
d.push(`${t} (${n})`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -103,7 +103,7 @@ function M(e, t, n, r) {
|
|
|
103
103
|
xAxisKey: "__periodDayIndex"
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function M(e, t, n) {
|
|
107
107
|
if (e.length === 0) return [];
|
|
108
108
|
if (e.length === 1) return Array.from(t.get(e[0]) || []).map((e) => n ? n(String(e)) : String(e));
|
|
109
109
|
let r = [], i = e.map((e) => Array.from(t.get(e) || []));
|
|
@@ -117,7 +117,7 @@ function N(e, t, n) {
|
|
|
117
117
|
}
|
|
118
118
|
return a(0, []), r;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function N(e, t, n) {
|
|
121
121
|
if (n?.showDayNumber) return `Day ${e + 1}`;
|
|
122
122
|
if (t) {
|
|
123
123
|
let e = typeof t == "string" ? new Date(t) : t;
|
|
@@ -128,15 +128,15 @@ function P(e, t, n) {
|
|
|
128
128
|
}
|
|
129
129
|
return `${e + 1}`;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function P(e, t) {
|
|
132
132
|
if (t.length < 2) return !1;
|
|
133
133
|
for (let n = 1; n < t.length; n++) {
|
|
134
|
-
let r =
|
|
134
|
+
let r = D(t[n], n);
|
|
135
135
|
if (e.includes(`(${r})`)) return !0;
|
|
136
136
|
}
|
|
137
137
|
return e.includes("(Prior");
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function F(e = "dashed") {
|
|
140
140
|
switch (e) {
|
|
141
141
|
case "solid": return;
|
|
142
142
|
case "dashed": return "5 5";
|
|
@@ -146,131 +146,132 @@ function I(e = "dashed") {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region src/client/components/charts/LineChart.tsx
|
|
149
|
-
var
|
|
150
|
-
let { t:
|
|
149
|
+
var I = /* @__PURE__ */ e({ default: () => L }), L = m.memo(function({ data: e, chartConfig: m, displayConfig: E = {}, queryObject: D, height: O = "100%", colorPalette: k, onDataPointClick: A, drillEnabled: M }) {
|
|
150
|
+
let { t: N } = a(), [I, L] = g(null), R = r(), z = h(() => m?.yAxis ? Array.isArray(m.yAxis) ? m.yAxis : [m.yAxis] : m?.y ? Array.isArray(m.y) ? m.y : [m.y] : [], [m?.yAxis, m?.y]), B = h(() => m?.yAxisAssignment || {}, [m?.yAxisAssignment]), V = h(() => {
|
|
151
151
|
let e = {};
|
|
152
|
-
return
|
|
153
|
-
let n =
|
|
152
|
+
return z.forEach((t) => {
|
|
153
|
+
let n = R(t);
|
|
154
154
|
e[n] = t;
|
|
155
155
|
}), e;
|
|
156
|
-
}, [
|
|
156
|
+
}, [z, R]);
|
|
157
157
|
try {
|
|
158
158
|
let r = {
|
|
159
|
-
showLegend:
|
|
160
|
-
showGrid:
|
|
161
|
-
showTooltip:
|
|
162
|
-
connectNulls:
|
|
163
|
-
}, a =
|
|
164
|
-
if (!e || e.length === 0) return /* @__PURE__ */
|
|
159
|
+
showLegend: E?.showLegend ?? !0,
|
|
160
|
+
showGrid: E?.showGrid ?? !0,
|
|
161
|
+
showTooltip: E?.showTooltip ?? !0,
|
|
162
|
+
connectNulls: E?.connectNulls ?? !1
|
|
163
|
+
}, a = E?.showAllXLabels ?? !0, h = E?.leftYAxisFormat, g = E?.rightYAxisFormat;
|
|
164
|
+
if (!e || e.length === 0) return /* @__PURE__ */ v("div", {
|
|
165
165
|
className: "dc:flex dc:items-center dc:justify-center dc:w-full text-dc-text-muted",
|
|
166
|
-
style: { height:
|
|
167
|
-
children: /* @__PURE__ */
|
|
166
|
+
style: { height: O },
|
|
167
|
+
children: /* @__PURE__ */ y("div", {
|
|
168
168
|
className: "dc:text-center",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ v("div", {
|
|
170
170
|
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
171
|
-
children:
|
|
172
|
-
}), /* @__PURE__ */
|
|
171
|
+
children: N("chart.runtime.noData")
|
|
172
|
+
}), /* @__PURE__ */ v("div", {
|
|
173
173
|
className: "dc:text-xs text-dc-text-secondary",
|
|
174
|
-
children:
|
|
174
|
+
children: N("chart.runtime.noDataHint.line")
|
|
175
175
|
})]
|
|
176
176
|
})
|
|
177
177
|
});
|
|
178
|
-
let
|
|
179
|
-
if (m?.xAxis && m?.yAxis)
|
|
180
|
-
else if (m?.x && m?.y)
|
|
181
|
-
else return /* @__PURE__ */
|
|
178
|
+
let H, U = [];
|
|
179
|
+
if (m?.xAxis && m?.yAxis) H = Array.isArray(m.xAxis) ? m.xAxis[0] : m.xAxis, U = m.series || [];
|
|
180
|
+
else if (m?.x && m?.y) H = m.x;
|
|
181
|
+
else return /* @__PURE__ */ v("div", {
|
|
182
182
|
className: "dc:flex dc:items-center dc:justify-center dc:w-full text-dc-warning",
|
|
183
|
-
style: { height:
|
|
184
|
-
children: /* @__PURE__ */
|
|
183
|
+
style: { height: O },
|
|
184
|
+
children: /* @__PURE__ */ y("div", {
|
|
185
185
|
className: "dc:text-center",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ v("div", {
|
|
187
187
|
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
188
|
-
children:
|
|
189
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: N("chart.runtime.configError")
|
|
189
|
+
}), /* @__PURE__ */ v("div", {
|
|
190
190
|
className: "dc:text-xs",
|
|
191
|
-
children:
|
|
191
|
+
children: N("chart.runtime.configErrorHint.axisInvalid")
|
|
192
192
|
})]
|
|
193
193
|
})
|
|
194
194
|
});
|
|
195
|
-
if (!
|
|
195
|
+
if (!H || z.length === 0) return /* @__PURE__ */ v("div", {
|
|
196
196
|
className: "dc:flex dc:items-center dc:justify-center dc:w-full text-dc-warning",
|
|
197
|
-
style: { height:
|
|
198
|
-
children: /* @__PURE__ */
|
|
197
|
+
style: { height: O },
|
|
198
|
+
children: /* @__PURE__ */ y("div", {
|
|
199
199
|
className: "dc:text-center",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ v("div", {
|
|
201
201
|
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
202
|
-
children:
|
|
203
|
-
}), /* @__PURE__ */
|
|
202
|
+
children: N("chart.runtime.configError")
|
|
203
|
+
}), /* @__PURE__ */ v("div", {
|
|
204
204
|
className: "dc:text-xs",
|
|
205
|
-
children:
|
|
205
|
+
children: N("chart.runtime.configErrorHint.axisFields")
|
|
206
206
|
})]
|
|
207
207
|
})
|
|
208
208
|
});
|
|
209
|
-
let W =
|
|
209
|
+
let W = w(e), ne = E?.priorPeriodStyle || "dashed", re = E?.priorPeriodOpacity ?? .5, ie = W ? T(e) : [], G, K, q = "name";
|
|
210
210
|
if (W) {
|
|
211
|
-
let t =
|
|
211
|
+
let t = j(e, z, H, R);
|
|
212
212
|
G = t.data, K = t.seriesKeys, q = "__periodDayIndex";
|
|
213
213
|
} else {
|
|
214
|
-
let n = t(e,
|
|
214
|
+
let n = t(e, H, z, D, U, R);
|
|
215
215
|
G = n.data, K = n.seriesKeys;
|
|
216
216
|
}
|
|
217
217
|
let J = (e) => {
|
|
218
|
-
if (
|
|
218
|
+
if (V[e]) return V[e];
|
|
219
219
|
if (e.length > 1e3) return;
|
|
220
220
|
let t = e.replace(/\s*\((Current|Prior)\)$/, "").split(" - ");
|
|
221
|
-
return
|
|
222
|
-
}, Y =
|
|
221
|
+
return V[t[t.length - 1]];
|
|
222
|
+
}, Y = z.some((e) => B[e] === "right"), X = z.filter((e) => (B[e] || "left") === "left"), Z = z.filter((e) => B[e] === "right"), ae = r.showLegend, oe = {
|
|
223
223
|
...i,
|
|
224
224
|
left: 40,
|
|
225
225
|
right: Y ? 40 : 20
|
|
226
|
-
}, Q = f(l(
|
|
226
|
+
}, Q = f(l(E?.target || ""), G.length), $ = G;
|
|
227
227
|
return Q.length > 0 && ($ = G.map((e, t) => ({
|
|
228
228
|
...e,
|
|
229
229
|
__target: Q[t] || null
|
|
230
|
-
}))), !G || G.length === 0 ? /* @__PURE__ */
|
|
230
|
+
}))), !G || G.length === 0 ? /* @__PURE__ */ v("div", {
|
|
231
231
|
className: "dc:flex dc:items-center dc:justify-center dc:w-full text-dc-text-muted",
|
|
232
|
-
style: { height:
|
|
233
|
-
children: /* @__PURE__ */
|
|
232
|
+
style: { height: O },
|
|
233
|
+
children: /* @__PURE__ */ y("div", {
|
|
234
234
|
className: "dc:text-center",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ v("div", {
|
|
236
236
|
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
237
|
-
children:
|
|
238
|
-
}), /* @__PURE__ */
|
|
237
|
+
children: N("chart.runtime.noValidData")
|
|
238
|
+
}), /* @__PURE__ */ v("div", {
|
|
239
239
|
className: "dc:text-xs text-dc-text-secondary",
|
|
240
240
|
children: "No valid data points for line chart after transformation"
|
|
241
241
|
})]
|
|
242
242
|
})
|
|
243
|
-
}) : /* @__PURE__ */
|
|
244
|
-
height:
|
|
245
|
-
children: /* @__PURE__ */
|
|
243
|
+
}) : /* @__PURE__ */ v(d, {
|
|
244
|
+
height: O,
|
|
245
|
+
children: /* @__PURE__ */ y(te, {
|
|
246
246
|
data: $,
|
|
247
|
-
margin:
|
|
247
|
+
margin: oe,
|
|
248
248
|
accessibilityLayer: !1,
|
|
249
249
|
children: [
|
|
250
|
-
r.showGrid && /* @__PURE__ */
|
|
250
|
+
r.showGrid && /* @__PURE__ */ v(b, {
|
|
251
251
|
strokeDasharray: "3 3",
|
|
252
252
|
style: { pointerEvents: "none" }
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ v(S, {
|
|
255
255
|
dataKey: q,
|
|
256
256
|
type: "category",
|
|
257
|
-
tick: /* @__PURE__ */
|
|
257
|
+
tick: /* @__PURE__ */ v(p, { tickFormatter: W ? (e, t) => {
|
|
258
258
|
let r = G[t];
|
|
259
259
|
if (r?.__displayDate) {
|
|
260
|
-
let e = n(
|
|
260
|
+
let e = n(D, H);
|
|
261
261
|
return s(r.__displayDate, e);
|
|
262
262
|
}
|
|
263
263
|
return `Period ${Number(e) + 1}`;
|
|
264
264
|
} : void 0 }),
|
|
265
|
-
height: 60
|
|
265
|
+
height: 60,
|
|
266
|
+
interval: a ? 0 : void 0
|
|
266
267
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ v(C, {
|
|
268
269
|
yAxisId: "left",
|
|
269
270
|
orientation: "left",
|
|
270
271
|
tick: { fontSize: 12 },
|
|
271
|
-
tickFormatter:
|
|
272
|
+
tickFormatter: h ? (e) => c(e, h) : void 0,
|
|
272
273
|
label: X.length > 0 ? {
|
|
273
|
-
value:
|
|
274
|
+
value: h?.label || R(X[0]),
|
|
274
275
|
angle: -90,
|
|
275
276
|
position: "left",
|
|
276
277
|
style: {
|
|
@@ -279,13 +280,13 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
279
280
|
}
|
|
280
281
|
} : void 0
|
|
281
282
|
}),
|
|
282
|
-
Y && /* @__PURE__ */
|
|
283
|
+
Y && /* @__PURE__ */ v(C, {
|
|
283
284
|
yAxisId: "right",
|
|
284
285
|
orientation: "right",
|
|
285
286
|
tick: { fontSize: 12 },
|
|
286
|
-
tickFormatter:
|
|
287
|
+
tickFormatter: g ? (e) => c(e, g) : void 0,
|
|
287
288
|
label: Z.length > 0 ? {
|
|
288
|
-
value:
|
|
289
|
+
value: g?.label || R(Z[0]),
|
|
289
290
|
angle: 90,
|
|
290
291
|
position: "right",
|
|
291
292
|
style: {
|
|
@@ -294,25 +295,25 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
294
295
|
}
|
|
295
296
|
} : void 0
|
|
296
297
|
}),
|
|
297
|
-
r.showTooltip && /* @__PURE__ */
|
|
298
|
+
r.showTooltip && /* @__PURE__ */ v(u, {
|
|
298
299
|
formatter: (e, t) => {
|
|
299
300
|
if (e == null) return ["No data", t];
|
|
300
|
-
if (t === "Target") return [c(e,
|
|
301
|
+
if (t === "Target") return [c(e, h), "Target Value"];
|
|
301
302
|
let n = J(t);
|
|
302
|
-
return [c(e, (n &&
|
|
303
|
+
return [c(e, (n && B[n] === "right" ? "right" : "left") == "right" ? g : h), t];
|
|
303
304
|
},
|
|
304
305
|
labelFormatter: W ? (e, t) => {
|
|
305
306
|
if (t && t.length > 0) {
|
|
306
307
|
let e = t[0]?.payload;
|
|
307
308
|
if (e?.__displayDate) {
|
|
308
|
-
let t = n(
|
|
309
|
+
let t = n(D, H);
|
|
309
310
|
return s(e.__displayDate, t);
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
return `Period ${Number(e) + 1}`;
|
|
313
314
|
} : void 0
|
|
314
315
|
}),
|
|
315
|
-
|
|
316
|
+
ae && /* @__PURE__ */ v(ee, {
|
|
316
317
|
wrapperStyle: {
|
|
317
318
|
fontSize: "12px",
|
|
318
319
|
paddingTop: "25px"
|
|
@@ -322,12 +323,12 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
322
323
|
layout: "horizontal",
|
|
323
324
|
align: "center",
|
|
324
325
|
verticalAlign: "bottom",
|
|
325
|
-
onMouseEnter: (e) =>
|
|
326
|
-
onMouseLeave: () =>
|
|
326
|
+
onMouseEnter: (e) => L(String(e.dataKey || "")),
|
|
327
|
+
onMouseLeave: () => L(null)
|
|
327
328
|
}),
|
|
328
329
|
K.map((e, t) => {
|
|
329
|
-
let n = J(e), i = n &&
|
|
330
|
-
return /* @__PURE__ */
|
|
330
|
+
let n = J(e), i = n && B[n] === "right" ? "right" : "left", a = W && P(e, ie), s = a ? F(ne) : void 0, c = a ? re : 1, l = k?.colors && k.colors[t % k.colors.length] || o[t % o.length];
|
|
331
|
+
return /* @__PURE__ */ v(x, {
|
|
331
332
|
type: "monotone",
|
|
332
333
|
dataKey: e,
|
|
333
334
|
yAxisId: i,
|
|
@@ -338,7 +339,7 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
338
339
|
let { cx: r, cy: i, payload: a, key: o } = t;
|
|
339
340
|
if (r === void 0 || i === void 0) return null;
|
|
340
341
|
let s = (t) => {
|
|
341
|
-
t.stopPropagation(), t.preventDefault(),
|
|
342
|
+
t.stopPropagation(), t.preventDefault(), A && A({
|
|
342
343
|
dataPoint: a,
|
|
343
344
|
clickedField: n || e,
|
|
344
345
|
xValue: a.name,
|
|
@@ -349,13 +350,13 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
349
350
|
nativeEvent: t
|
|
350
351
|
});
|
|
351
352
|
};
|
|
352
|
-
return
|
|
353
|
+
return M && A ? /* @__PURE__ */ y("g", { children: [/* @__PURE__ */ v("circle", {
|
|
353
354
|
cx: r,
|
|
354
355
|
cy: i,
|
|
355
356
|
r: 6,
|
|
356
357
|
fill: "var(--dc-surface)",
|
|
357
358
|
style: { pointerEvents: "none" }
|
|
358
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ v("circle", {
|
|
359
360
|
cx: r,
|
|
360
361
|
cy: i,
|
|
361
362
|
r: 4,
|
|
@@ -366,7 +367,7 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
366
367
|
onClick: (e) => {
|
|
367
368
|
s(e);
|
|
368
369
|
}
|
|
369
|
-
})] }, o) : /* @__PURE__ */
|
|
370
|
+
})] }, o) : /* @__PURE__ */ v("circle", {
|
|
370
371
|
cx: r,
|
|
371
372
|
cy: i,
|
|
372
373
|
r: 3,
|
|
@@ -374,11 +375,11 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
374
375
|
}, o);
|
|
375
376
|
},
|
|
376
377
|
activeDot: !1,
|
|
377
|
-
strokeOpacity:
|
|
378
|
+
strokeOpacity: I ? I === e ? 1 : .3 : c,
|
|
378
379
|
connectNulls: r.connectNulls
|
|
379
380
|
}, e);
|
|
380
381
|
}),
|
|
381
|
-
Q.length > 0 && /* @__PURE__ */
|
|
382
|
+
Q.length > 0 && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(x, {
|
|
382
383
|
type: "monotone",
|
|
383
384
|
dataKey: "__target",
|
|
384
385
|
yAxisId: "left",
|
|
@@ -387,7 +388,7 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
387
388
|
dot: !1,
|
|
388
389
|
activeDot: !1,
|
|
389
390
|
connectNulls: !1
|
|
390
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ v(x, {
|
|
391
392
|
type: "monotone",
|
|
392
393
|
dataKey: "__target",
|
|
393
394
|
yAxisId: "left",
|
|
@@ -403,23 +404,23 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
403
404
|
})
|
|
404
405
|
});
|
|
405
406
|
} catch (e) {
|
|
406
|
-
return /* @__PURE__ */
|
|
407
|
+
return /* @__PURE__ */ v("div", {
|
|
407
408
|
className: "dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full text-dc-error dc:p-4",
|
|
408
|
-
style: { height:
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
style: { height: O },
|
|
410
|
+
children: /* @__PURE__ */ y("div", {
|
|
410
411
|
className: "dc:text-center",
|
|
411
412
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ v("div", {
|
|
413
414
|
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
414
|
-
children:
|
|
415
|
+
children: N("chart.runtime.chartError", { chartType: "Line Chart" })
|
|
415
416
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ v("div", {
|
|
417
418
|
className: "dc:text-xs dc:mb-2",
|
|
418
|
-
children: e instanceof Error ? e.message :
|
|
419
|
+
children: e instanceof Error ? e.message : N("chart.runtime.unknownError")
|
|
419
420
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ v("div", {
|
|
421
422
|
className: "dc:text-xs text-dc-text-muted",
|
|
422
|
-
children:
|
|
423
|
+
children: N("chart.runtime.checkConfig")
|
|
423
424
|
})
|
|
424
425
|
]
|
|
425
426
|
})
|
|
@@ -427,6 +428,6 @@ var L = /* @__PURE__ */ e({ default: () => R }), R = m.memo(function({ data: e,
|
|
|
427
428
|
}
|
|
428
429
|
});
|
|
429
430
|
//#endregion
|
|
430
|
-
export {
|
|
431
|
+
export { E as a, w as c, O as d, D as i, P as l, I as n, T as o, N as r, F as s, L as t, j as u };
|
|
431
432
|
|
|
432
|
-
//# sourceMappingURL=chart-line-
|
|
433
|
+
//# sourceMappingURL=chart-line-BZhzOjRl.js.map
|