drizzle-cube 0.4.53 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/adapters/express/index.cjs +2 -2
  2. package/dist/adapters/express/index.js +92 -83
  3. package/dist/adapters/fastify/index.cjs +2 -2
  4. package/dist/adapters/fastify/index.js +126 -116
  5. package/dist/adapters/{handler-RItnSaEl.js → handler-3LGcjLtr.js} +617 -612
  6. package/dist/adapters/handler-BzzbVpcl.cjs +25 -0
  7. package/dist/adapters/hono/index.cjs +1 -1
  8. package/dist/adapters/hono/index.js +94 -86
  9. package/dist/adapters/{compiler-S6KHiOY6.js → locale-DTnJrxm1.js} +1700 -1563
  10. package/dist/adapters/locale-DueXjqMh.cjs +198 -0
  11. package/dist/adapters/locale.d.ts +8 -0
  12. package/dist/adapters/mcp-tools.cjs +1 -1
  13. package/dist/adapters/mcp-tools.js +14 -14
  14. package/dist/adapters/mcp-transport-45SiFcCH.cjs +39 -0
  15. package/dist/adapters/mcp-transport-Bxpc4mRy.js +553 -0
  16. package/dist/adapters/mcp-transport.d.ts +11 -0
  17. package/dist/adapters/nextjs/index.cjs +1 -1
  18. package/dist/adapters/nextjs/index.js +138 -122
  19. package/dist/adapters/utils-DNrj-ryp.cjs +17 -0
  20. package/dist/adapters/{utils-IH1ePsBd.js → utils-DOg9oGdt.js} +2341 -819
  21. package/dist/adapters/utils.cjs +1 -1
  22. package/dist/adapters/utils.d.ts +7 -0
  23. package/dist/adapters/utils.js +1 -1
  24. package/dist/client/charts.js +12 -12
  25. package/dist/client/chunks/{DashboardEditModal-BTdV528l.js → DashboardEditModal-cSSIAZGy.js} +1968 -1973
  26. package/dist/client/chunks/DashboardEditModal-cSSIAZGy.js.map +1 -0
  27. package/dist/client/chunks/{FieldSearchModal-D75vy4Wb.js → FieldSearchModal-CZNo4pNK.js} +550 -536
  28. package/dist/client/chunks/FieldSearchModal-CZNo4pNK.js.map +1 -0
  29. package/dist/client/chunks/KpiDelta-Dll_eCV1.js +2 -0
  30. package/dist/client/chunks/KpiNumber-BPlR92hI.js +2 -0
  31. package/dist/client/chunks/KpiText-BIxq7Jso.js +2 -0
  32. package/dist/client/chunks/{RetentionCombinedChart-DIhK5pD8.js → RetentionCombinedChart-BD8tGeM_.js} +96 -96
  33. package/dist/client/chunks/RetentionCombinedChart-BD8tGeM_.js.map +1 -0
  34. package/dist/client/chunks/{RetentionHeatmap-CyREolyP.js → RetentionHeatmap-B_5sewwi.js} +77 -77
  35. package/dist/client/chunks/RetentionHeatmap-B_5sewwi.js.map +1 -0
  36. package/dist/client/chunks/SchemaVisualization-CCICjhvv.js +2 -0
  37. package/dist/client/chunks/SchemaVisualizationLazy-DraGsMx6.js +2 -0
  38. package/dist/client/chunks/af-ZA-xDmO5F0s.js +1431 -0
  39. package/dist/client/chunks/af-ZA-xDmO5F0s.js.map +1 -0
  40. package/dist/client/chunks/{analysis-builder-C1CJ0c7L.js → analysis-builder-BeVZhiQ5.js} +1519 -1507
  41. package/dist/client/chunks/analysis-builder-BeVZhiQ5.js.map +1 -0
  42. package/dist/client/chunks/{analysis-builder-shared-rkjJfWLT.js → analysis-builder-shared-BWc7ZZnG.js} +925 -954
  43. package/dist/client/chunks/analysis-builder-shared-BWc7ZZnG.js.map +1 -0
  44. package/dist/client/chunks/chart-activity-grid-CWT0gLv4.js +2376 -0
  45. package/dist/client/chunks/chart-activity-grid-CWT0gLv4.js.map +1 -0
  46. package/dist/client/chunks/{chart-area-BwYaflNk.js → chart-area-D63kG8OT.js} +157 -157
  47. package/dist/client/chunks/chart-area-D63kG8OT.js.map +1 -0
  48. package/dist/client/chunks/{chart-bar-BiENfFgE.js → chart-bar-BEfsCLjl.js} +78 -78
  49. package/dist/client/chunks/chart-bar-BEfsCLjl.js.map +1 -0
  50. package/dist/client/chunks/{chart-box-plot-BJF1tBXC.js → chart-box-plot-o-h9MRX5.js} +111 -114
  51. package/dist/client/chunks/chart-box-plot-o-h9MRX5.js.map +1 -0
  52. package/dist/client/chunks/{chart-bubble-DQQhGVDJ.js → chart-bubble-CMDp4Pfm.js} +121 -121
  53. package/dist/client/chunks/chart-bubble-CMDp4Pfm.js.map +1 -0
  54. package/dist/client/chunks/chart-candlestick-WyANJ0Ky.js +303 -0
  55. package/dist/client/chunks/chart-candlestick-WyANJ0Ky.js.map +1 -0
  56. package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js +51 -0
  57. package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js.map +1 -0
  58. package/dist/client/chunks/chart-config-area-CMZpbIah.js +93 -0
  59. package/dist/client/chunks/chart-config-area-CMZpbIah.js.map +1 -0
  60. package/dist/client/chunks/chart-config-bar-B8_V4YLg.js +87 -0
  61. package/dist/client/chunks/chart-config-bar-B8_V4YLg.js.map +1 -0
  62. package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js +35 -0
  63. package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js.map +1 -0
  64. package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js +82 -0
  65. package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js.map +1 -0
  66. package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js +72 -0
  67. package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js.map +1 -0
  68. package/dist/client/chunks/{chart-config-data-table-Bhdx5Hem.js → chart-config-data-table-BQXSn4b_.js} +9 -9
  69. package/dist/client/chunks/chart-config-data-table-BQXSn4b_.js.map +1 -0
  70. package/dist/client/chunks/chart-config-funnel-BzEsHmjR.js +93 -0
  71. package/dist/client/chunks/chart-config-funnel-BzEsHmjR.js.map +1 -0
  72. package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js +64 -0
  73. package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js.map +1 -0
  74. package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js +91 -0
  75. package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js.map +1 -0
  76. package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js +94 -0
  77. package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js.map +1 -0
  78. package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js +75 -0
  79. package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js.map +1 -0
  80. package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js +47 -0
  81. package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js.map +1 -0
  82. package/dist/client/chunks/chart-config-line-BVKapAQK.js +104 -0
  83. package/dist/client/chunks/chart-config-line-BVKapAQK.js.map +1 -0
  84. package/dist/client/chunks/chart-config-markdown-C-_g_8te.js +117 -0
  85. package/dist/client/chunks/chart-config-markdown-C-_g_8te.js.map +1 -0
  86. package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js +82 -0
  87. package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js.map +1 -0
  88. package/dist/client/chunks/chart-config-pie-BZxVl25X.js +68 -0
  89. package/dist/client/chunks/chart-config-pie-BZxVl25X.js.map +1 -0
  90. package/dist/client/chunks/chart-config-radar-B7FByX3t.js +49 -0
  91. package/dist/client/chunks/chart-config-radar-B7FByX3t.js.map +1 -0
  92. package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js +38 -0
  93. package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js.map +1 -0
  94. package/dist/client/chunks/chart-config-sankey-DGAThN9i.js +66 -0
  95. package/dist/client/chunks/chart-config-sankey-DGAThN9i.js.map +1 -0
  96. package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js +61 -0
  97. package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js.map +1 -0
  98. package/dist/client/chunks/chart-config-sunburst-utejM2YS.js +45 -0
  99. package/dist/client/chunks/chart-config-sunburst-utejM2YS.js.map +1 -0
  100. package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js +51 -0
  101. package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js.map +1 -0
  102. package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js +59 -0
  103. package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js.map +1 -0
  104. package/dist/client/chunks/{chart-data-table-2iCsn0CF.js → chart-data-table-C3Xh9jwL.js} +1083 -1086
  105. package/dist/client/chunks/chart-data-table-C3Xh9jwL.js.map +1 -0
  106. package/dist/client/chunks/{chart-funnel-poyOf7-e.js → chart-funnel-C7pgktN5.js} +132 -132
  107. package/dist/client/chunks/chart-funnel-C7pgktN5.js.map +1 -0
  108. package/dist/client/chunks/{chart-gauge-D5J4gRky.js → chart-gauge-D2r2B_AR.js} +150 -150
  109. package/dist/client/chunks/chart-gauge-D2r2B_AR.js.map +1 -0
  110. package/dist/client/chunks/{chart-heat-map-BAMVhLGG.js → chart-heat-map-Dw2yjwfO.js} +75 -80
  111. package/dist/client/chunks/chart-heat-map-Dw2yjwfO.js.map +1 -0
  112. package/dist/client/chunks/{chart-kpi-delta-KQjUIeal.js → chart-kpi-delta-CYE0S1x_.js} +117 -117
  113. package/dist/client/chunks/chart-kpi-delta-CYE0S1x_.js.map +1 -0
  114. package/dist/client/chunks/chart-kpi-number-BlZ79xHW.js +321 -0
  115. package/dist/client/chunks/chart-kpi-number-BlZ79xHW.js.map +1 -0
  116. package/dist/client/chunks/chart-kpi-text-DY1BnxPe.js +148 -0
  117. package/dist/client/chunks/chart-kpi-text-DY1BnxPe.js.map +1 -0
  118. package/dist/client/chunks/{chart-line-B5_WntY5.js → chart-line-CBsTThTv.js} +123 -123
  119. package/dist/client/chunks/chart-line-CBsTThTv.js.map +1 -0
  120. package/dist/client/chunks/chart-markdown-BWaWVkuz.js +3474 -0
  121. package/dist/client/chunks/chart-markdown-BWaWVkuz.js.map +1 -0
  122. package/dist/client/chunks/chart-measure-profile-B41qCTBG.js +179 -0
  123. package/dist/client/chunks/chart-measure-profile-B41qCTBG.js.map +1 -0
  124. package/dist/client/chunks/chart-pie-Djbu8x2v.js +172 -0
  125. package/dist/client/chunks/chart-pie-Djbu8x2v.js.map +1 -0
  126. package/dist/client/chunks/chart-radar-BsTcKV0K.js +154 -0
  127. package/dist/client/chunks/chart-radar-BsTcKV0K.js.map +1 -0
  128. package/dist/client/chunks/chart-radial-bar-Du7XNnwE.js +148 -0
  129. package/dist/client/chunks/chart-radial-bar-Du7XNnwE.js.map +1 -0
  130. package/dist/client/chunks/{chart-sankey-BOyxfG1Q.js → chart-sankey-WwkZAhLy.js} +73 -73
  131. package/dist/client/chunks/chart-sankey-WwkZAhLy.js.map +1 -0
  132. package/dist/client/chunks/chart-scatter-D8krEYsA.js +255 -0
  133. package/dist/client/chunks/chart-scatter-D8krEYsA.js.map +1 -0
  134. package/dist/client/chunks/{chart-sunburst-D9lGEOCc.js → chart-sunburst-CIDB_pTl.js} +66 -66
  135. package/dist/client/chunks/chart-sunburst-CIDB_pTl.js.map +1 -0
  136. package/dist/client/chunks/chart-tree-map-C5C2iaWM.js +298 -0
  137. package/dist/client/chunks/chart-tree-map-C5C2iaWM.js.map +1 -0
  138. package/dist/client/chunks/{chart-waterfall-BCdUx4DC.js → chart-waterfall-BGdPrJ5Y.js} +80 -80
  139. package/dist/client/chunks/chart-waterfall-BGdPrJ5Y.js.map +1 -0
  140. package/dist/client/chunks/{charts-core-C5Yokk-x.js → charts-core-BXOqaYFn.js} +92 -92
  141. package/dist/client/chunks/charts-core-BXOqaYFn.js.map +1 -0
  142. package/dist/client/chunks/en-US-5xPTdCXg.js +35 -0
  143. package/dist/client/chunks/en-US-5xPTdCXg.js.map +1 -0
  144. package/dist/client/chunks/nl-NL-vCifBijs.js +1491 -0
  145. package/dist/client/chunks/nl-NL-vCifBijs.js.map +1 -0
  146. package/dist/client/chunks/{schema-visualization-t1KiOORo.js → schema-visualization-Xp60Ff2W.js} +352 -364
  147. package/dist/client/chunks/schema-visualization-Xp60Ff2W.js.map +1 -0
  148. package/dist/client/chunks/{useDebounce-CKqkM42n.js → useDebounce-CfmUMFau.js} +85 -85
  149. package/dist/client/chunks/useDebounce-CfmUMFau.js.map +1 -0
  150. package/dist/client/chunks/{useExplainAI-DBIfYwz-.js → useExplainAI-BKGmejIj.js} +4 -4
  151. package/dist/client/chunks/{useExplainAI-DBIfYwz-.js.map → useExplainAI-BKGmejIj.js.map} +1 -1
  152. package/dist/client/chunks/{utils--qCr8Yn5.js → utils-BldkcRHv.js} +2 -2
  153. package/dist/client/chunks/{utils--qCr8Yn5.js.map → utils-BldkcRHv.js.map} +1 -1
  154. package/dist/client/chunks/{vendor-BRlsCGnK.js → vendor-ClXpIiea.js} +2 -2
  155. package/dist/client/chunks/{vendor-BRlsCGnK.js.map → vendor-ClXpIiea.js.map} +1 -1
  156. package/dist/client/components/AnalysisBuilder/types.d.ts +6 -6
  157. package/dist/client/components.js +3 -3
  158. package/dist/client/hooks/useTranslation.d.ts +21 -0
  159. package/dist/client/hooks.js +3 -3
  160. package/dist/client/icons.js +1 -1
  161. package/dist/client/index.js +493 -488
  162. package/dist/client/index.js.map +1 -1
  163. package/dist/client/providers/CubeApiProvider.d.ts +2 -1
  164. package/dist/client/providers/CubeProvider.d.ts +7 -1
  165. package/dist/client/providers/I18nProvider.d.ts +18 -0
  166. package/dist/client/providers.js +1 -1
  167. package/dist/client/schema.js +1 -1
  168. package/dist/client/shared/types.d.ts +5 -20
  169. package/dist/client/styles.css +1 -1
  170. package/dist/client/utils.js +5 -5
  171. package/dist/client-bundle-stats.html +1 -1
  172. package/dist/mcp-app/mcp-app.html +26 -24
  173. package/dist/server/index.cjs +42 -40
  174. package/dist/server/index.js +3311 -1672
  175. package/package.json +5 -2
  176. package/dist/adapters/compiler-CRgLzmSn.cjs +0 -198
  177. package/dist/adapters/handler-DumFgnNM.cjs +0 -25
  178. package/dist/adapters/mcp-transport-C6bsIOSV.js +0 -545
  179. package/dist/adapters/mcp-transport-DMhuYmFp.cjs +0 -39
  180. package/dist/adapters/utils-CyBt-as9.cjs +0 -15
  181. package/dist/client/chunks/DashboardEditModal-BTdV528l.js.map +0 -1
  182. package/dist/client/chunks/FieldSearchModal-D75vy4Wb.js.map +0 -1
  183. package/dist/client/chunks/KpiDelta-Bk8bzKYM.js +0 -2
  184. package/dist/client/chunks/KpiNumber-CKF-8e_T.js +0 -2
  185. package/dist/client/chunks/KpiText-Iz1vIvu_.js +0 -2
  186. package/dist/client/chunks/RetentionCombinedChart-DIhK5pD8.js.map +0 -1
  187. package/dist/client/chunks/RetentionHeatmap-CyREolyP.js.map +0 -1
  188. package/dist/client/chunks/SchemaVisualization-B1GUT-FM.js +0 -2
  189. package/dist/client/chunks/SchemaVisualizationLazy-DymwT34e.js +0 -2
  190. package/dist/client/chunks/analysis-builder-C1CJ0c7L.js.map +0 -1
  191. package/dist/client/chunks/analysis-builder-shared-rkjJfWLT.js.map +0 -1
  192. package/dist/client/chunks/chart-activity-grid-DLktOINm.js +0 -806
  193. package/dist/client/chunks/chart-activity-grid-DLktOINm.js.map +0 -1
  194. package/dist/client/chunks/chart-area-BwYaflNk.js.map +0 -1
  195. package/dist/client/chunks/chart-bar-BiENfFgE.js.map +0 -1
  196. package/dist/client/chunks/chart-box-plot-BJF1tBXC.js.map +0 -1
  197. package/dist/client/chunks/chart-bubble-DQQhGVDJ.js.map +0 -1
  198. package/dist/client/chunks/chart-candlestick-C2UuXbLe.js +0 -306
  199. package/dist/client/chunks/chart-candlestick-C2UuXbLe.js.map +0 -1
  200. package/dist/client/chunks/chart-config-activity-grid-DJOU3TEz.js +0 -51
  201. package/dist/client/chunks/chart-config-activity-grid-DJOU3TEz.js.map +0 -1
  202. package/dist/client/chunks/chart-config-area-CWnWVT6a.js +0 -93
  203. package/dist/client/chunks/chart-config-area-CWnWVT6a.js.map +0 -1
  204. package/dist/client/chunks/chart-config-bar-C-7Dr1Ho.js +0 -87
  205. package/dist/client/chunks/chart-config-bar-C-7Dr1Ho.js.map +0 -1
  206. package/dist/client/chunks/chart-config-box-plot-mVOwmLdu.js +0 -35
  207. package/dist/client/chunks/chart-config-box-plot-mVOwmLdu.js.map +0 -1
  208. package/dist/client/chunks/chart-config-bubble-BPE2CeiD.js +0 -82
  209. package/dist/client/chunks/chart-config-bubble-BPE2CeiD.js.map +0 -1
  210. package/dist/client/chunks/chart-config-candlestick-BSB9DRy2.js +0 -72
  211. package/dist/client/chunks/chart-config-candlestick-BSB9DRy2.js.map +0 -1
  212. package/dist/client/chunks/chart-config-data-table-Bhdx5Hem.js.map +0 -1
  213. package/dist/client/chunks/chart-config-funnel-Cl-v-bm1.js +0 -93
  214. package/dist/client/chunks/chart-config-funnel-Cl-v-bm1.js.map +0 -1
  215. package/dist/client/chunks/chart-config-gauge-CdrUTJMJ.js +0 -64
  216. package/dist/client/chunks/chart-config-gauge-CdrUTJMJ.js.map +0 -1
  217. package/dist/client/chunks/chart-config-heat-map-DGE3NzoF.js +0 -91
  218. package/dist/client/chunks/chart-config-heat-map-DGE3NzoF.js.map +0 -1
  219. package/dist/client/chunks/chart-config-kpi-delta-DMrQerUW.js +0 -94
  220. package/dist/client/chunks/chart-config-kpi-delta-DMrQerUW.js.map +0 -1
  221. package/dist/client/chunks/chart-config-kpi-number-DCytCytn.js +0 -75
  222. package/dist/client/chunks/chart-config-kpi-number-DCytCytn.js.map +0 -1
  223. package/dist/client/chunks/chart-config-kpi-text-KdKQUvHo.js +0 -47
  224. package/dist/client/chunks/chart-config-kpi-text-KdKQUvHo.js.map +0 -1
  225. package/dist/client/chunks/chart-config-line-Bl9VDAdz.js +0 -104
  226. package/dist/client/chunks/chart-config-line-Bl9VDAdz.js.map +0 -1
  227. package/dist/client/chunks/chart-config-markdown-BX26b94i.js +0 -117
  228. package/dist/client/chunks/chart-config-markdown-BX26b94i.js.map +0 -1
  229. package/dist/client/chunks/chart-config-measure-profile-DwtRhEFh.js +0 -82
  230. package/dist/client/chunks/chart-config-measure-profile-DwtRhEFh.js.map +0 -1
  231. package/dist/client/chunks/chart-config-pie-BzBcqPMJ.js +0 -68
  232. package/dist/client/chunks/chart-config-pie-BzBcqPMJ.js.map +0 -1
  233. package/dist/client/chunks/chart-config-radar-6ZOgt__z.js +0 -49
  234. package/dist/client/chunks/chart-config-radar-6ZOgt__z.js.map +0 -1
  235. package/dist/client/chunks/chart-config-radial-bar-Df6Eta7N.js +0 -38
  236. package/dist/client/chunks/chart-config-radial-bar-Df6Eta7N.js.map +0 -1
  237. package/dist/client/chunks/chart-config-sankey-DgqKBFvN.js +0 -66
  238. package/dist/client/chunks/chart-config-sankey-DgqKBFvN.js.map +0 -1
  239. package/dist/client/chunks/chart-config-scatter-D5nVLDvi.js +0 -61
  240. package/dist/client/chunks/chart-config-scatter-D5nVLDvi.js.map +0 -1
  241. package/dist/client/chunks/chart-config-sunburst-Ca3FX9nW.js +0 -45
  242. package/dist/client/chunks/chart-config-sunburst-Ca3FX9nW.js.map +0 -1
  243. package/dist/client/chunks/chart-config-tree-map-Bjy4QNa3.js +0 -51
  244. package/dist/client/chunks/chart-config-tree-map-Bjy4QNa3.js.map +0 -1
  245. package/dist/client/chunks/chart-config-waterfall-C5K2eqR7.js +0 -59
  246. package/dist/client/chunks/chart-config-waterfall-C5K2eqR7.js.map +0 -1
  247. package/dist/client/chunks/chart-data-table-2iCsn0CF.js.map +0 -1
  248. package/dist/client/chunks/chart-funnel-poyOf7-e.js.map +0 -1
  249. package/dist/client/chunks/chart-gauge-D5J4gRky.js.map +0 -1
  250. package/dist/client/chunks/chart-heat-map-BAMVhLGG.js.map +0 -1
  251. package/dist/client/chunks/chart-kpi-delta-KQjUIeal.js.map +0 -1
  252. package/dist/client/chunks/chart-kpi-number-CsQgV_x3.js +0 -325
  253. package/dist/client/chunks/chart-kpi-number-CsQgV_x3.js.map +0 -1
  254. package/dist/client/chunks/chart-kpi-text-BR0IyeUU.js +0 -148
  255. package/dist/client/chunks/chart-kpi-text-BR0IyeUU.js.map +0 -1
  256. package/dist/client/chunks/chart-line-B5_WntY5.js.map +0 -1
  257. package/dist/client/chunks/chart-markdown-B6bENbel.js +0 -3473
  258. package/dist/client/chunks/chart-markdown-B6bENbel.js.map +0 -1
  259. package/dist/client/chunks/chart-measure-profile-yWk-obNb.js +0 -179
  260. package/dist/client/chunks/chart-measure-profile-yWk-obNb.js.map +0 -1
  261. package/dist/client/chunks/chart-pie-BodrUoHv.js +0 -172
  262. package/dist/client/chunks/chart-pie-BodrUoHv.js.map +0 -1
  263. package/dist/client/chunks/chart-radar-gG3zfLud.js +0 -154
  264. package/dist/client/chunks/chart-radar-gG3zfLud.js.map +0 -1
  265. package/dist/client/chunks/chart-radial-bar-C2IPCV8c.js +0 -148
  266. package/dist/client/chunks/chart-radial-bar-C2IPCV8c.js.map +0 -1
  267. package/dist/client/chunks/chart-sankey-BOyxfG1Q.js.map +0 -1
  268. package/dist/client/chunks/chart-scatter-B8OwlsAX.js +0 -255
  269. package/dist/client/chunks/chart-scatter-B8OwlsAX.js.map +0 -1
  270. package/dist/client/chunks/chart-sunburst-D9lGEOCc.js.map +0 -1
  271. package/dist/client/chunks/chart-tree-map-DZaKy9he.js +0 -298
  272. package/dist/client/chunks/chart-tree-map-DZaKy9he.js.map +0 -1
  273. package/dist/client/chunks/chart-waterfall-BCdUx4DC.js.map +0 -1
  274. package/dist/client/chunks/charts-core-C5Yokk-x.js.map +0 -1
  275. package/dist/client/chunks/schema-visualization-t1KiOORo.js.map +0 -1
  276. package/dist/client/chunks/useDebounce-CKqkM42n.js.map +0 -1
@@ -1,806 +0,0 @@
1
- import { n as e } from "./rolldown-runtime-CCl2IeXn.js";
2
- import t, { createContext as n, useCallback as r, useContext as i, useEffect as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
- import { max as f, min as p, scaleQuantize as m, select as h } from "d3";
5
- //#region src/client/providers/CubeMetaContext.tsx
6
- var g = n(null);
7
- function _() {
8
- let e = i(g);
9
- if (!e) throw Error("useCubeMeta must be used within CubeMetaProvider");
10
- return e;
11
- }
12
- //#endregion
13
- //#region src/client/utils/chartUtils.ts
14
- function v(e) {
15
- return e != null && !isNaN(Number(e));
16
- }
17
- function y(e) {
18
- if (e == null) return null;
19
- let t = typeof e == "string" ? parseFloat(e) : Number(e);
20
- return isNaN(t) ? null : t;
21
- }
22
- function b(e) {
23
- if (e == null) return "No data";
24
- let t = typeof e == "number" ? e : parseFloat(e);
25
- return isNaN(t) ? String(e) : Number.isInteger(t) ? t.toLocaleString() : parseFloat(t.toFixed(2)).toLocaleString();
26
- }
27
- function x(e, t, n) {
28
- if (e == null) return "No data";
29
- let r = typeof e == "number" ? e : parseFloat(String(e));
30
- if (isNaN(r)) return String(e);
31
- if (!isFinite(r)) return r > 0 ? "∞" : "-∞";
32
- let i = n || (typeof navigator < "u" ? navigator.language : "en-US");
33
- if (!t) return b(e);
34
- let { unit: a, abbreviate: o = !0, decimals: s, customPrefix: c, customSuffix: l } = t, u = r, d = "";
35
- if (o) {
36
- let e = Math.abs(r);
37
- e >= 1e9 ? (u = r / 1e9, d = "B") : e >= 1e6 ? (u = r / 1e6, d = "M") : e >= 1e3 && (u = r / 1e3, d = "K");
38
- }
39
- let f = s === void 0 ? Number.isInteger(u) ? 0 : 2 : s;
40
- switch (a) {
41
- case "currency": {
42
- let e = S(i);
43
- if (o && d) {
44
- let t = new Intl.NumberFormat(i, {
45
- style: "currency",
46
- currency: e,
47
- minimumFractionDigits: f,
48
- maximumFractionDigits: f
49
- }).format(u), n = new Intl.NumberFormat(i, {
50
- style: "currency",
51
- currency: e
52
- }).formatToParts(u);
53
- return n[n.length - 1]?.type === "currency" ? t.replace(/(\s*[^\d\s]+)$/, d + "$1") : t + d;
54
- }
55
- return new Intl.NumberFormat(i, {
56
- style: "currency",
57
- currency: e,
58
- minimumFractionDigits: f,
59
- maximumFractionDigits: f
60
- }).format(u);
61
- }
62
- case "percent": {
63
- let e = Math.abs(u) <= 1 && !o ? u * 100 : u;
64
- return new Intl.NumberFormat(i, {
65
- minimumFractionDigits: f,
66
- maximumFractionDigits: f
67
- }).format(e) + d + "%";
68
- }
69
- case "custom": {
70
- let e = c || "", t = l || "";
71
- return e + new Intl.NumberFormat(i, {
72
- minimumFractionDigits: f,
73
- maximumFractionDigits: f
74
- }).format(u) + d + t;
75
- }
76
- default: return new Intl.NumberFormat(i, {
77
- minimumFractionDigits: f,
78
- maximumFractionDigits: f
79
- }).format(u) + d;
80
- }
81
- }
82
- function S(e) {
83
- return {
84
- US: "USD",
85
- CA: "CAD",
86
- GB: "GBP",
87
- UK: "GBP",
88
- AU: "AUD",
89
- NZ: "NZD",
90
- EU: "EUR",
91
- DE: "EUR",
92
- FR: "EUR",
93
- IT: "EUR",
94
- ES: "EUR",
95
- NL: "EUR",
96
- BE: "EUR",
97
- AT: "EUR",
98
- IE: "EUR",
99
- PT: "EUR",
100
- FI: "EUR",
101
- JP: "JPY",
102
- CN: "CNY",
103
- KR: "KRW",
104
- IN: "INR",
105
- BR: "BRL",
106
- MX: "MXN",
107
- CH: "CHF",
108
- SE: "SEK",
109
- NO: "NOK",
110
- DK: "DKK",
111
- PL: "PLN",
112
- RU: "RUB",
113
- ZA: "ZAR",
114
- SG: "SGD",
115
- HK: "HKD",
116
- TW: "TWD",
117
- TH: "THB",
118
- MY: "MYR",
119
- PH: "PHP",
120
- ID: "IDR",
121
- VN: "VND",
122
- AE: "AED",
123
- SA: "SAR",
124
- IL: "ILS",
125
- TR: "TRY"
126
- }[e.split("-")[1]?.toUpperCase()] || "USD";
127
- }
128
- function C(e) {
129
- return (t) => x(t, e);
130
- }
131
- function w(e, t) {
132
- return t[e] || e;
133
- }
134
- function T(e, t) {
135
- return e.map((e) => w(e, t));
136
- }
137
- function E(e, t) {
138
- if (!e) return "Unknown";
139
- let n = String(e);
140
- if (n.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
141
- let e = n;
142
- n.includes(" ") && (e = n.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !e.endsWith("Z") && !e.includes("+") && (e += "Z");
143
- let r = new Date(e);
144
- if (isNaN(r.getTime())) return n;
145
- let i = r.getUTCFullYear(), a = String(r.getUTCMonth() + 1).padStart(2, "0"), o = String(r.getUTCDate()).padStart(2, "0"), s = r.getUTCHours(), c = r.getUTCMinutes();
146
- if (t) switch (t.toLowerCase()) {
147
- case "year": return `${i}`;
148
- case "quarter": return `${i}-Q${Math.floor(r.getUTCMonth() / 3) + 1}`;
149
- case "month": return `${i}-${a}`;
150
- case "week": return `${i}-${a}-${o}`;
151
- case "day": return `${i}-${a}-${o}`;
152
- case "hour": return `${i}-${a}-${o} ${String(s).padStart(2, "0")}:00`;
153
- case "minute": return `${i}-${a}-${o} ${String(s).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
154
- default: break;
155
- }
156
- let l = r.getUTCSeconds(), u = r.getUTCMilliseconds();
157
- return o === "01" && s === 0 && c === 0 && l === 0 && u === 0 ? a === "01" || a === "04" || a === "07" || a === "10" ? `${i}-Q${Math.floor(r.getUTCMonth() / 3) + 1}` : `${i}-${a}` : s === 0 && c === 0 && l === 0 && u === 0 ? `${i}-${a}-${o}` : c === 0 && l === 0 && u === 0 ? `${i}-${a}-${o} ${String(s).padStart(2, "0")}:00` : `${i}-${a}-${o} ${String(s).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
158
- }
159
- return n;
160
- }
161
- function D(e, t) {
162
- try {
163
- if (e?.timeDimensions) {
164
- let n = e.timeDimensions.find((e) => t === e.dimension || t.startsWith(e.dimension.replace(".", "_")) || t === `${e.dimension}_${e.granularity}`);
165
- if (n?.granularity) return n.granularity;
166
- }
167
- let n = t.match(/_([a-z]+)$/);
168
- if (n) {
169
- let e = n[1];
170
- if ([
171
- "year",
172
- "quarter",
173
- "month",
174
- "week",
175
- "day",
176
- "hour",
177
- "minute",
178
- "second"
179
- ].includes(e)) return e;
180
- }
181
- return;
182
- } catch {
183
- return;
184
- }
185
- }
186
- function O(e, t, n, r, i = (e) => e) {
187
- if (!e || e.length === 0) return [];
188
- let a = D(r, t);
189
- return e.map((e) => {
190
- let r = { name: E(e[t], a) || e[t] || "Unknown" };
191
- return n.forEach((t) => {
192
- let n = i(t);
193
- n === "__proto__" || n === "constructor" || n === "prototype" || (r[n] = y(e[t]));
194
- }), r;
195
- });
196
- }
197
- function k(e, t, n, r, i, a = (e) => e) {
198
- if (!e || e.length === 0) return {
199
- data: [],
200
- seriesKeys: [],
201
- hasDimensions: !1
202
- };
203
- let o = r || {}, s = [...o.dimensions || [], ...o.timeDimensions?.map((e) => e.dimension) || []], c = o.measures || [], l = n.filter((e) => c.includes(e)), u = (i || []).filter((e) => s.includes(e));
204
- if (u.length > 0) {
205
- let n = {};
206
- return e.forEach((e) => {
207
- let i = D(r, t), o = E(e[t], i) || e[t] || "Unknown";
208
- o === "__proto__" || o === "constructor" || o === "prototype" || (n[o] || (n[o] = { name: String(o) }), l.forEach((t) => {
209
- let r = a(t);
210
- if (r === "__proto__" || r === "constructor" || r === "prototype") return;
211
- let i = y(e[t]);
212
- if (i !== null) {
213
- let e = n[o][r];
214
- n[o][r] = e == null ? i : e + i;
215
- } else r in n[o] || (n[o][r] = null);
216
- }), u.forEach((t) => {
217
- let r = e[t];
218
- if (r != null) {
219
- let t = String(r), i = l[0] || c.find((e) => e.includes("totalCost") || e.includes("count") || e.includes("sum")) || c[0];
220
- if (i) {
221
- if (t === "__proto__" || t === "constructor" || t === "prototype") return;
222
- let r = y(e[i]);
223
- if (r !== null) {
224
- let e = n[o][t];
225
- n[o][t] = e == null ? r : e + r;
226
- } else t in n[o] || (n[o][t] = null);
227
- }
228
- }
229
- }));
230
- }), {
231
- data: Object.values(n),
232
- seriesKeys: Array.from(new Set(e.flatMap((e) => u.map((t) => {
233
- let n = e[t];
234
- return n == null ? null : String(n);
235
- }).filter((e) => e !== null)))),
236
- hasDimensions: !0
237
- };
238
- }
239
- return {
240
- data: O(e, t, n, r, a),
241
- seriesKeys: n.map((e) => a(e)),
242
- hasDimensions: !1
243
- };
244
- }
245
- //#endregion
246
- //#region src/client/hooks/useCubeFieldLabel.ts
247
- function A() {
248
- let e = i(g);
249
- if (!e) throw Error("useCubeFieldLabel must be used within CubeProvider");
250
- return s(() => e.getFieldLabel, [e.getFieldLabel]);
251
- }
252
- //#endregion
253
- //#region src/client/theme/index.ts
254
- function j(e) {
255
- return typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(`--dc-${e}`).trim();
256
- }
257
- function M(e, t) {
258
- typeof window > "u" || document.documentElement.style.setProperty(`--dc-${e}`, t);
259
- }
260
- function N(e) {
261
- typeof window > "u" || Object.entries(e.colors).forEach(([e, t]) => {
262
- t && M(e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), t);
263
- });
264
- }
265
- function P() {
266
- if (typeof window > "u") return;
267
- let e = document.documentElement.style;
268
- Array.from(e).forEach((t) => {
269
- t.startsWith("--dc-") && e.removeProperty(t);
270
- });
271
- }
272
- function F() {
273
- if (typeof window > "u") return "light";
274
- let e = localStorage.getItem("theme");
275
- if (e === "dark" || e === "neon" || e === "light") return e;
276
- let t = document.documentElement.getAttribute("data-theme");
277
- return t === "dark" || t === "neon" ? t : document.documentElement.classList.contains("dark") || document.body.classList.contains("dark") ? "dark" : document.documentElement.classList.contains("neon") || document.body.classList.contains("neon") ? "neon" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
278
- }
279
- function I(e) {
280
- typeof window > "u" || (document.documentElement.classList.remove("dark", "neon"), document.documentElement.setAttribute("data-theme", e), (e === "dark" || e === "neon") && document.documentElement.classList.add(e), localStorage.setItem("theme", e));
281
- }
282
- function L() {
283
- let e = F();
284
- return e === "dark" || e === "neon";
285
- }
286
- function R(e) {
287
- if (typeof window > "u") return () => {};
288
- let t = new MutationObserver(() => {
289
- e(F());
290
- });
291
- t.observe(document.documentElement, {
292
- attributes: !0,
293
- attributeFilter: ["class", "data-theme"]
294
- });
295
- let n = window.matchMedia("(prefers-color-scheme: dark)"), r = () => e(F());
296
- return n.addEventListener("change", r), () => {
297
- t.disconnect(), n.removeEventListener("change", r);
298
- };
299
- }
300
- var z = {
301
- light: {
302
- name: "light",
303
- colors: {
304
- surface: "#ffffff",
305
- surfaceSecondary: "#f9fafb",
306
- text: "#111827",
307
- textSecondary: "#374151",
308
- textMuted: "#6b7280",
309
- border: "#e5e7eb",
310
- primary: "#3b82f6",
311
- primaryHover: "#2563eb"
312
- }
313
- },
314
- dark: {
315
- name: "dark",
316
- colors: {
317
- surface: "#1e293b",
318
- surfaceSecondary: "#334155",
319
- text: "#f1f5f9",
320
- textSecondary: "#e2e8f0",
321
- textMuted: "#cbd5e1",
322
- border: "#475569",
323
- primary: "#60a5fa",
324
- primaryHover: "#3b82f6"
325
- }
326
- },
327
- neon: {
328
- name: "neon",
329
- colors: {
330
- surface: "#0a0118",
331
- surfaceSecondary: "#1a0f2e",
332
- surfaceTertiary: "#2a1f3e",
333
- text: "#ffffff",
334
- textSecondary: "#e0e0ff",
335
- textMuted: "#b0b0d0",
336
- border: "#ff00ff",
337
- borderSecondary: "#00ffff",
338
- primary: "#00ffff",
339
- primaryHover: "#00cccc",
340
- primaryContent: "#000000",
341
- success: "#00ff00",
342
- warning: "#ffff00",
343
- error: "#ff0066",
344
- info: "#00ffff",
345
- danger: "#ff1493"
346
- }
347
- }
348
- }, B = [
349
- "#3b82f6",
350
- "#10b981",
351
- "#f59e0b",
352
- "#ef4444",
353
- "#8b5cf6",
354
- "#f97316",
355
- "#06b6d4",
356
- "#84cc16"
357
- ], V = [
358
- "#440154",
359
- "#414487",
360
- "#2a788e",
361
- "#22a884",
362
- "#7ad151",
363
- "#fde725"
364
- ], H = "#10b981", U = "#ef4444", W = {
365
- top: 5,
366
- right: 30,
367
- left: 20,
368
- bottom: 5
369
- }, G = {
370
- top: 5,
371
- right: 30,
372
- left: 20,
373
- bottom: 60
374
- }, K = /* @__PURE__ */ e({ default: () => q }), q = t.memo(function({ data: e, chartConfig: t, displayConfig: n = {}, queryObject: i, height: g = "100%", colorPalette: _, onDataPointClick: v, drillEnabled: y }) {
375
- let b = c(null), x = c(null), [S, C] = l({
376
- width: 0,
377
- height: 0
378
- }), [w, T] = l(!1), [D, O] = l("light"), k = A();
379
- a(() => (O(F()), R((e) => {
380
- O(e);
381
- })), []);
382
- let j = s(() => ({
383
- showTooltip: n?.showTooltip ?? !0,
384
- showLabels: n?.showLabels ?? !0,
385
- fitToWidth: n?.fitToWidth ?? !1
386
- }), [
387
- n?.showTooltip,
388
- n?.showLabels,
389
- n?.fitToWidth
390
- ]);
391
- o(() => {
392
- let e = 0, t, n, r = () => {
393
- if (x.current) {
394
- let { width: e, height: t } = x.current.getBoundingClientRect();
395
- if (e > 0 && t > 0) return C({
396
- width: e,
397
- height: t
398
- }), T(!0), !0;
399
- }
400
- return !1;
401
- };
402
- if (!r() && e < 10) {
403
- let i = () => {
404
- !r() && e < 10 && (e++, n = setTimeout(() => {
405
- t = requestAnimationFrame(i);
406
- }, 50 * e));
407
- };
408
- t = requestAnimationFrame(i);
409
- }
410
- return () => {
411
- t && cancelAnimationFrame(t), n && clearTimeout(n);
412
- };
413
- }, []), a(() => {
414
- let e = null, t = () => {
415
- if (x.current) {
416
- let { width: e, height: t } = x.current.getBoundingClientRect();
417
- e > 0 && t > 0 && (C({
418
- width: e,
419
- height: t
420
- }), w || T(!0));
421
- }
422
- };
423
- return x.current && (e = new ResizeObserver(() => t()), e.observe(x.current), t()), window.addEventListener("resize", t), () => {
424
- e && e.disconnect(), window.removeEventListener("resize", t);
425
- };
426
- }, [w]);
427
- let M = (e) => Math.floor(e.getMonth() / 3) + 1, N = (e) => e.getMonth() % 3 + 1, P = (e) => {
428
- let t = e.getDate();
429
- return Math.floor((t - 1) / 7) + 1;
430
- }, I = r((e) => {
431
- switch (e?.toLowerCase()) {
432
- case "year": return null;
433
- case "quarter": return {
434
- extractX: (e) => e.getFullYear(),
435
- extractY: (e) => M(e) - 1,
436
- xLabels: [],
437
- yLabels: [
438
- "Q1",
439
- "Q2",
440
- "Q3",
441
- "Q4"
442
- ],
443
- xFormat: (e) => `'${e.toString().slice(-2)}`,
444
- yFormat: (e) => [
445
- "Q1",
446
- "Q2",
447
- "Q3",
448
- "Q4"
449
- ][e] || "",
450
- cellWidth: 16,
451
- cellHeight: 16
452
- };
453
- case "month": return {
454
- extractX: (e) => {
455
- let t = e.getFullYear(), n = M(e);
456
- return t * 10 + n;
457
- },
458
- extractY: (e) => N(e) - 1,
459
- xLabels: [],
460
- yLabels: [
461
- "Month 1",
462
- "Month 2",
463
- "Month 3"
464
- ],
465
- xFormat: (e) => `Q${e % 10}`,
466
- yFormat: (e) => [
467
- "Month 1",
468
- "Month 2",
469
- "Month 3"
470
- ][e] || "",
471
- cellWidth: 16,
472
- cellHeight: 16,
473
- hasHierarchicalLabels: !0,
474
- getYearFromX: (e) => Math.floor(e / 10)
475
- };
476
- case "week": return {
477
- extractX: (e) => {
478
- let t = e.getFullYear(), n = e.getMonth() + 1;
479
- return t * 100 + n;
480
- },
481
- extractY: (e) => P(e) - 1,
482
- xLabels: [],
483
- yLabels: [
484
- "Week 1",
485
- "Week 2",
486
- "Week 3",
487
- "Week 4",
488
- "Week 5"
489
- ],
490
- xFormat: (e) => [
491
- "J",
492
- "F",
493
- "M",
494
- "A",
495
- "M",
496
- "J",
497
- "J",
498
- "A",
499
- "S",
500
- "O",
501
- "N",
502
- "D"
503
- ][e % 100 - 1] || "",
504
- yFormat: (e) => [
505
- "Week 1",
506
- "Week 2",
507
- "Week 3",
508
- "Week 4",
509
- "Week 5"
510
- ][e] || "",
511
- cellWidth: 16,
512
- cellHeight: 16,
513
- hasHierarchicalLabels: !0,
514
- getYearFromX: (e) => Math.floor(e / 100)
515
- };
516
- case "day": return {
517
- extractX: (e) => {
518
- let { year: t, week: n } = L(e);
519
- return t * 100 + n;
520
- },
521
- extractY: (e) => e.getDay(),
522
- xLabels: [],
523
- yLabels: [
524
- "Sun",
525
- "Mon",
526
- "Tue",
527
- "Wed",
528
- "Thu",
529
- "Fri",
530
- "Sat"
531
- ],
532
- xFormat: (e) => `${e % 100}`,
533
- yFormat: (e) => [
534
- "Sun",
535
- "Mon",
536
- "Tue",
537
- "Wed",
538
- "Thu",
539
- "Fri",
540
- "Sat"
541
- ][e] || "",
542
- cellWidth: 16,
543
- cellHeight: 16,
544
- hasHierarchicalLabels: !0,
545
- getYearFromX: (e) => Math.floor(e / 100)
546
- };
547
- case "hour": return {
548
- extractX: (e) => {
549
- let t = e.getFullYear(), n = e.getMonth() + 1, r = e.getDate();
550
- return t * 1e4 + n * 100 + r;
551
- },
552
- extractY: (e) => Math.floor(e.getHours() / 3),
553
- xLabels: [],
554
- yLabels: [
555
- "00-03",
556
- "03-06",
557
- "06-09",
558
- "09-12",
559
- "12-15",
560
- "15-18",
561
- "18-21",
562
- "21-00"
563
- ],
564
- xFormat: (e) => `${e % 100}`,
565
- yFormat: (e) => [
566
- "00-03",
567
- "03-06",
568
- "06-09",
569
- "09-12",
570
- "12-15",
571
- "15-18",
572
- "18-21",
573
- "21-00"
574
- ][e] || "",
575
- cellWidth: 16,
576
- cellHeight: 16,
577
- hasHierarchicalLabels: !0,
578
- getYearFromX: (e) => Math.floor(e / 100)
579
- };
580
- default: return null;
581
- }
582
- }, []), L = (e) => {
583
- let t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), n = t.getUTCDay() || 7;
584
- t.setUTCDate(t.getUTCDate() + 4 - n);
585
- let r = t.getUTCFullYear(), i = new Date(Date.UTC(r, 0, 1));
586
- return {
587
- year: r,
588
- week: Math.ceil(((t.getTime() - i.getTime()) / 864e5 + 1) / 7)
589
- };
590
- };
591
- if (a(() => {
592
- if (!e || e.length === 0 || !b.current || !w || S.width === 0 || (h(b.current).selectAll("*").remove(), !t?.dateField || !t?.valueField)) return;
593
- let n = Array.isArray(t.dateField) ? t.dateField[0] : t.dateField, r = Array.isArray(t.valueField) ? t.valueField[0] : t.valueField;
594
- if (!n || !r) return;
595
- let a = (() => {
596
- if (!i?.timeDimensions || i.timeDimensions.length === 0) return "day";
597
- let e = i.timeDimensions.find((e) => e.dimension === n || e.dimension.includes(n));
598
- if (e && e.granularity) return e.granularity;
599
- let t = i.timeDimensions[0];
600
- return t && t.granularity ? t.granularity : "day";
601
- })(), o = I(a);
602
- if (!o) return;
603
- let s = e.map((e) => {
604
- let t = e[n], i = typeof e[r] == "string" ? parseFloat(e[r]) : e[r] || 0, s;
605
- if (typeof t == "string") {
606
- let e = t;
607
- t.includes(" ") && (e = t.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !e.endsWith("Z") && !e.includes("+") && (e += "Z"), s = new Date(e);
608
- } else s = new Date(t);
609
- return isNaN(s.getTime()) ? null : {
610
- x: o.extractX(s),
611
- y: o.extractY(s),
612
- value: i,
613
- date: s,
614
- label: E(t, a)
615
- };
616
- }).filter((e) => e !== null);
617
- if (s.length === 0) return;
618
- let c = f(s, (e) => e.y) || 0, l = p(s, (e) => e.y) || 0, u = [...new Set(s.map((e) => e.x))].sort(), d = u.length * o.cellWidth + (u.length - 1) * 4, g = (c - l + 1) * o.cellHeight + (c - l) * 4, x = {
619
- ...W,
620
- left: 60,
621
- bottom: 10,
622
- top: o.hasHierarchicalLabels ? 40 : 25,
623
- right: 10
624
- }, C = S.width - x.left - x.right, T = S.height - x.top - x.bottom, O, A;
625
- if (j.fitToWidth) {
626
- let e = C / d, t = T / g, n = Math.min(e, t);
627
- O = o.cellWidth * n, A = o.cellHeight * n;
628
- } else {
629
- let e = {
630
- width: 16,
631
- height: 16
632
- }, t = C / d, n = T / g, r = Math.min(t, n);
633
- O = Math.max(e.width, Math.min(24, o.cellWidth * r)), A = Math.max(e.height, Math.min(24, o.cellHeight * r)), a === "week" && O < e.width && (O = e.width);
634
- }
635
- let M = u.length * O + (u.length - 1) * 4, N = M > C ? M + x.left + x.right : S.width, P = h(b.current).attr("width", N).attr("height", S.height).append("g").attr("transform", `translate(${x.left},${x.top})`), F = s.map((e) => e.value), L = p(F) || 0, R = f(F) || 1, z = m().domain([L, R]).range(_?.gradient || V), B = /* @__PURE__ */ new Map();
636
- s.forEach((e) => {
637
- let t = `${e.x}-${e.y}`;
638
- B.set(t, e);
639
- });
640
- let H = (e, t) => getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t, U = D !== "light", G = U ? H("--dc-text-muted", "#cbd5e1") : H("--dc-text-secondary", "#374151"), K = H("--dc-border", "#e5e7eb"), q = U ? H("--dc-bg-secondary", "#1e293b") : H("--dc-bg-secondary", "#f3f4f6"), J = U ? H("--dc-border", "#334155") : H("--dc-bg", "#ffffff"), Y = h("body").append("div").attr("class", "activity-grid-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), X = /* @__PURE__ */ new Map();
641
- u.forEach((e, t) => {
642
- X.set(e, t);
643
- });
644
- for (let e of u) for (let t = l; t <= c; t++) {
645
- let i = `${e}-${t}`, a = B.get(i), o = X.get(e) || 0, s = P.append("rect").attr("x", o * (O + 4)).attr("y", (t - l) * (A + 4)).attr("width", O).attr("height", A).attr("rx", 2).attr("ry", 2).style("fill", a ? z(a.value) : q).style("stroke", J).style("stroke-width", 1);
646
- j.showTooltip ? s.style("cursor", y ? "pointer" : "default").on("mouseover", function(e) {
647
- if (h(this).style("stroke", "#000").style("stroke-width", 2), a) {
648
- let t = [`<strong>${a.label}</strong>`, `${k(r)}: ${a.value}`].join("<br>");
649
- Y.html(t).style("left", e.pageX + 10 + "px").style("top", e.pageY - 10 + "px").transition().duration(200).style("opacity", 1);
650
- }
651
- }).on("mousemove", function(e) {
652
- Y.style("left", e.pageX + 10 + "px").style("top", e.pageY - 10 + "px");
653
- }).on("mouseout", function() {
654
- h(this).style("stroke", J).style("stroke-width", 1), Y.transition().duration(200).style("opacity", 0);
655
- }) : y && s.style("cursor", "pointer"), y && v && a && s.on("click", function(e) {
656
- v({
657
- dataPoint: {
658
- [r]: a.value,
659
- [n]: a.date
660
- },
661
- clickedField: r,
662
- xValue: a.label,
663
- position: {
664
- x: e.pageX,
665
- y: e.pageY
666
- },
667
- nativeEvent: e
668
- });
669
- });
670
- }
671
- if (j.showLabels) {
672
- if (o.hasHierarchicalLabels && o.getYearFromX) {
673
- let e = /* @__PURE__ */ new Map();
674
- for (let t of u) {
675
- let n = o.getYearFromX(t);
676
- e.has(n) || e.set(n, []), e.get(n).push(t);
677
- }
678
- for (let e of u) {
679
- let t = X.get(e) || 0;
680
- P.append("text").attr("x", t * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", G).text(o.xFormat(e));
681
- }
682
- for (let [t, n] of e) if (n.length > 0) {
683
- let e = Math.min(...n.map((e) => X.get(e) || 0)), r = Math.max(...n.map((e) => X.get(e) || 0)), i = (e + r) / 2, a;
684
- if (t > 9999) {
685
- let e = Math.floor(t / 100);
686
- a = `${[
687
- "Jan",
688
- "Feb",
689
- "Mar",
690
- "Apr",
691
- "May",
692
- "Jun",
693
- "Jul",
694
- "Aug",
695
- "Sep",
696
- "Oct",
697
- "Nov",
698
- "Dec"
699
- ][t % 100 - 1]} '${e.toString().slice(-2)}`;
700
- } else a = `'${t.toString().slice(-2)}`;
701
- P.append("text").attr("x", i * (O + 4) + O / 2).attr("y", -25).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", G).text(a), n.length > 1 && P.append("line").attr("x1", e * (O + 4)).attr("x2", r * (O + 4) + O).attr("y1", -20).attr("y2", -20).style("stroke", K).style("stroke-width", 1).style("opacity", .3);
702
- }
703
- } else {
704
- let e = Math.max(1, Math.floor(u.length / 10));
705
- for (let t = 0; t < u.length; t += e) {
706
- let e = u[t];
707
- P.append("text").attr("x", t * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", G).text(o.xFormat(e));
708
- }
709
- }
710
- for (let e = l; e <= c; e++) P.append("text").attr("x", -8).attr("y", (e - l) * (A + 4) + A / 2).attr("text-anchor", "end").attr("dy", ".35em").style("font-size", "10px").style("fill", G).text(o.yFormat(e));
711
- }
712
- return () => {
713
- Y.remove();
714
- };
715
- }, [
716
- e,
717
- t,
718
- n,
719
- i,
720
- S,
721
- w,
722
- j,
723
- _,
724
- D,
725
- k,
726
- I,
727
- y,
728
- v
729
- ]), !e || e.length === 0) return /* @__PURE__ */ u("div", {
730
- className: "dc:flex dc:items-center dc:justify-center dc:w-full",
731
- style: { height: g },
732
- children: /* @__PURE__ */ d("div", {
733
- className: "dc:text-center text-dc-text-muted",
734
- children: [/* @__PURE__ */ u("div", {
735
- className: "dc:text-sm dc:font-semibold dc:mb-1",
736
- children: "No data available"
737
- }), /* @__PURE__ */ u("div", {
738
- className: "dc:text-xs text-dc-text-secondary",
739
- children: "No data points to display in activity grid"
740
- })]
741
- })
742
- });
743
- if (!(t?.dateField && t?.valueField)) return /* @__PURE__ */ u("div", {
744
- className: "dc:flex dc:items-center dc:justify-center dc:w-full",
745
- style: { height: g },
746
- children: /* @__PURE__ */ d("div", {
747
- className: "dc:text-center text-dc-text-muted",
748
- children: [/* @__PURE__ */ u("div", {
749
- className: "dc:text-sm dc:font-semibold dc:mb-1",
750
- children: "Configuration Required"
751
- }), /* @__PURE__ */ u("div", {
752
- className: "dc:text-xs text-dc-text-secondary",
753
- children: "Activity grid requires a time dimension and a measure"
754
- })]
755
- })
756
- });
757
- let z = Array.isArray(t.dateField) ? t.dateField[0] : t.dateField;
758
- return (i?.timeDimensions?.find((e) => e.dimension === z || e.dimension.includes(z))?.granularity || "day")?.toLowerCase() === "year" ? /* @__PURE__ */ u("div", {
759
- className: "dc:flex dc:items-center dc:justify-center dc:w-full",
760
- style: { height: g },
761
- children: /* @__PURE__ */ d("div", {
762
- className: "dc:text-center text-dc-text-muted",
763
- children: [
764
- /* @__PURE__ */ u("div", {
765
- className: "dc:text-sm dc:font-semibold dc:mb-1",
766
- children: "Granularity Too High"
767
- }),
768
- /* @__PURE__ */ u("div", {
769
- className: "dc:text-xs text-dc-text-secondary",
770
- children: "Activity grids work best with hour, day, week, month, or quarter granularity"
771
- }),
772
- /* @__PURE__ */ u("div", {
773
- className: "dc:text-xs text-dc-text-secondary dc:mt-1",
774
- children: "Please choose a lower granularity for your time dimension"
775
- })
776
- ]
777
- })
778
- }) : /* @__PURE__ */ u("div", {
779
- className: "dc:w-full dc:flex dc:flex-col dc:relative",
780
- style: {
781
- height: g,
782
- minHeight: "250px",
783
- overflow: "hidden",
784
- width: "100%"
785
- },
786
- children: /* @__PURE__ */ d("div", {
787
- ref: x,
788
- className: "dc:w-full dc:h-full dc:relative dc:overflow-x-auto",
789
- style: { width: "100%" },
790
- children: [/* @__PURE__ */ u("svg", {
791
- ref: b,
792
- className: "dc:h-full"
793
- }), !w && /* @__PURE__ */ u("div", {
794
- className: "dc:absolute dc:inset-0 dc:flex dc:items-center dc:justify-center",
795
- children: /* @__PURE__ */ u("div", {
796
- className: "text-dc-text-muted dc:text-sm",
797
- children: "Measuring chart dimensions..."
798
- })
799
- })]
800
- })
801
- });
802
- });
803
- //#endregion
804
- export { _ as A, w as C, k as D, O as E, T as O, D as S, y as T, A as _, U as a, b, z as c, j as d, L as f, R as g, M as h, W as i, g as k, N as l, I as m, B as n, H as o, P as p, V as r, G as s, K as t, F as u, C as v, v as w, E as x, x as y };
805
-
806
- //# sourceMappingURL=chart-activity-grid-DLktOINm.js.map