@panoboard/core 1.1.5
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/cache/cache.d.ts +11 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/cache/cache.js +42 -0
- package/dist/cache/cache.js.map +1 -0
- package/dist/cache/client.d.ts +9 -0
- package/dist/cache/client.d.ts.map +1 -0
- package/dist/cache/client.js +63 -0
- package/dist/cache/client.js.map +1 -0
- package/dist/cache/index.d.ts +4 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +17 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/keys.d.ts +2 -0
- package/dist/cache/keys.d.ts.map +1 -0
- package/dist/cache/keys.js +26 -0
- package/dist/cache/keys.js.map +1 -0
- package/dist/components/DashboardCard.d.ts +15 -0
- package/dist/components/DashboardCard.d.ts.map +1 -0
- package/dist/components/DashboardCard.js +80 -0
- package/dist/components/DashboardCard.js.map +1 -0
- package/dist/components/DashboardShell.d.ts +11 -0
- package/dist/components/DashboardShell.d.ts.map +1 -0
- package/dist/components/DashboardShell.js +115 -0
- package/dist/components/DashboardShell.js.map +1 -0
- package/dist/components/EmptyState.d.ts +6 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState.js +29 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/ErrorPage.d.ts +14 -0
- package/dist/components/ErrorPage.d.ts.map +1 -0
- package/dist/components/ErrorPage.js +132 -0
- package/dist/components/ErrorPage.js.map +1 -0
- package/dist/components/FilterBar.d.ts +8 -0
- package/dist/components/FilterBar.d.ts.map +1 -0
- package/dist/components/FilterBar.js +70 -0
- package/dist/components/FilterBar.js.map +1 -0
- package/dist/components/PanelGrid.d.ts +9 -0
- package/dist/components/PanelGrid.d.ts.map +1 -0
- package/dist/components/PanelGrid.js +26 -0
- package/dist/components/PanelGrid.js.map +1 -0
- package/dist/components/PanelWrapper.d.ts +8 -0
- package/dist/components/PanelWrapper.d.ts.map +1 -0
- package/dist/components/PanelWrapper.js +154 -0
- package/dist/components/PanelWrapper.js.map +1 -0
- package/dist/components/filters/BooleanFilter.d.ts +8 -0
- package/dist/components/filters/BooleanFilter.d.ts.map +1 -0
- package/dist/components/filters/BooleanFilter.js +36 -0
- package/dist/components/filters/BooleanFilter.js.map +1 -0
- package/dist/components/filters/CalendarGrid.d.ts +8 -0
- package/dist/components/filters/CalendarGrid.d.ts.map +1 -0
- package/dist/components/filters/CalendarGrid.js +159 -0
- package/dist/components/filters/CalendarGrid.js.map +1 -0
- package/dist/components/filters/DateRangeFilter.d.ts +10 -0
- package/dist/components/filters/DateRangeFilter.d.ts.map +1 -0
- package/dist/components/filters/DateRangeFilter.js +80 -0
- package/dist/components/filters/DateRangeFilter.js.map +1 -0
- package/dist/components/filters/FilterChips.d.ts +8 -0
- package/dist/components/filters/FilterChips.d.ts.map +1 -0
- package/dist/components/filters/FilterChips.js +94 -0
- package/dist/components/filters/FilterChips.js.map +1 -0
- package/dist/components/filters/MultiSelectFilter.d.ts +17 -0
- package/dist/components/filters/MultiSelectFilter.d.ts.map +1 -0
- package/dist/components/filters/MultiSelectFilter.js +80 -0
- package/dist/components/filters/MultiSelectFilter.js.map +1 -0
- package/dist/components/filters/NumberFilter.d.ts +10 -0
- package/dist/components/filters/NumberFilter.d.ts.map +1 -0
- package/dist/components/filters/NumberFilter.js +47 -0
- package/dist/components/filters/NumberFilter.js.map +1 -0
- package/dist/components/filters/SelectFilter.d.ts +16 -0
- package/dist/components/filters/SelectFilter.d.ts.map +1 -0
- package/dist/components/filters/SelectFilter.js +71 -0
- package/dist/components/filters/SelectFilter.js.map +1 -0
- package/dist/components/filters/TextFilter.d.ts +8 -0
- package/dist/components/filters/TextFilter.d.ts.map +1 -0
- package/dist/components/filters/TextFilter.js +57 -0
- package/dist/components/filters/TextFilter.js.map +1 -0
- package/dist/components/filters/useDropdown.d.ts +7 -0
- package/dist/components/filters/useDropdown.d.ts.map +1 -0
- package/dist/components/filters/useDropdown.js +41 -0
- package/dist/components/filters/useDropdown.js.map +1 -0
- package/dist/components/filters/useFilterUpdate.d.ts +2 -0
- package/dist/components/filters/useFilterUpdate.d.ts.map +1 -0
- package/dist/components/filters/useFilterUpdate.js +30 -0
- package/dist/components/filters/useFilterUpdate.js.map +1 -0
- package/dist/components/index.d.ts +59 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +75 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/panels/AreaChart.d.ts +7 -0
- package/dist/components/panels/AreaChart.d.ts.map +1 -0
- package/dist/components/panels/AreaChart.js +88 -0
- package/dist/components/panels/AreaChart.js.map +1 -0
- package/dist/components/panels/BarChart.d.ts +7 -0
- package/dist/components/panels/BarChart.d.ts.map +1 -0
- package/dist/components/panels/BarChart.js +99 -0
- package/dist/components/panels/BarChart.js.map +1 -0
- package/dist/components/panels/BoxPlotChart.d.ts +7 -0
- package/dist/components/panels/BoxPlotChart.d.ts.map +1 -0
- package/dist/components/panels/BoxPlotChart.js +41 -0
- package/dist/components/panels/BoxPlotChart.js.map +1 -0
- package/dist/components/panels/BulletChart.d.ts +7 -0
- package/dist/components/panels/BulletChart.d.ts.map +1 -0
- package/dist/components/panels/BulletChart.js +46 -0
- package/dist/components/panels/BulletChart.js.map +1 -0
- package/dist/components/panels/BumpChart.d.ts +7 -0
- package/dist/components/panels/BumpChart.d.ts.map +1 -0
- package/dist/components/panels/BumpChart.js +38 -0
- package/dist/components/panels/BumpChart.js.map +1 -0
- package/dist/components/panels/CalendarHeatmap.d.ts +7 -0
- package/dist/components/panels/CalendarHeatmap.d.ts.map +1 -0
- package/dist/components/panels/CalendarHeatmap.js +41 -0
- package/dist/components/panels/CalendarHeatmap.js.map +1 -0
- package/dist/components/panels/ChartTooltip.d.ts +48 -0
- package/dist/components/panels/ChartTooltip.d.ts.map +1 -0
- package/dist/components/panels/ChartTooltip.js +129 -0
- package/dist/components/panels/ChartTooltip.js.map +1 -0
- package/dist/components/panels/DonutChart.d.ts +7 -0
- package/dist/components/panels/DonutChart.d.ts.map +1 -0
- package/dist/components/panels/DonutChart.js +40 -0
- package/dist/components/panels/DonutChart.js.map +1 -0
- package/dist/components/panels/FunnelChart.d.ts +7 -0
- package/dist/components/panels/FunnelChart.d.ts.map +1 -0
- package/dist/components/panels/FunnelChart.js +32 -0
- package/dist/components/panels/FunnelChart.js.map +1 -0
- package/dist/components/panels/HeatmapChart.d.ts +7 -0
- package/dist/components/panels/HeatmapChart.d.ts.map +1 -0
- package/dist/components/panels/HeatmapChart.js +41 -0
- package/dist/components/panels/HeatmapChart.js.map +1 -0
- package/dist/components/panels/IframePanel.d.ts +6 -0
- package/dist/components/panels/IframePanel.d.ts.map +1 -0
- package/dist/components/panels/IframePanel.js +5 -0
- package/dist/components/panels/IframePanel.js.map +1 -0
- package/dist/components/panels/ImagePanel.d.ts +7 -0
- package/dist/components/panels/ImagePanel.d.ts.map +1 -0
- package/dist/components/panels/ImagePanel.js +9 -0
- package/dist/components/panels/ImagePanel.js.map +1 -0
- package/dist/components/panels/LineChart.d.ts +7 -0
- package/dist/components/panels/LineChart.d.ts.map +1 -0
- package/dist/components/panels/LineChart.js +87 -0
- package/dist/components/panels/LineChart.js.map +1 -0
- package/dist/components/panels/ListPanel.d.ts +7 -0
- package/dist/components/panels/ListPanel.d.ts.map +1 -0
- package/dist/components/panels/ListPanel.js +24 -0
- package/dist/components/panels/ListPanel.js.map +1 -0
- package/dist/components/panels/MarkdownPanel.d.ts +7 -0
- package/dist/components/panels/MarkdownPanel.d.ts.map +1 -0
- package/dist/components/panels/MarkdownPanel.js +39 -0
- package/dist/components/panels/MarkdownPanel.js.map +1 -0
- package/dist/components/panels/MetricPanel.d.ts +7 -0
- package/dist/components/panels/MetricPanel.d.ts.map +1 -0
- package/dist/components/panels/MetricPanel.js +23 -0
- package/dist/components/panels/MetricPanel.js.map +1 -0
- package/dist/components/panels/PanelEmpty.d.ts +2 -0
- package/dist/components/panels/PanelEmpty.d.ts.map +1 -0
- package/dist/components/panels/PanelEmpty.js +27 -0
- package/dist/components/panels/PanelEmpty.js.map +1 -0
- package/dist/components/panels/PanelError.d.ts +7 -0
- package/dist/components/panels/PanelError.d.ts.map +1 -0
- package/dist/components/panels/PanelError.js +21 -0
- package/dist/components/panels/PanelError.js.map +1 -0
- package/dist/components/panels/PanelSkeleton.d.ts +6 -0
- package/dist/components/panels/PanelSkeleton.d.ts.map +1 -0
- package/dist/components/panels/PanelSkeleton.js +24 -0
- package/dist/components/panels/PanelSkeleton.js.map +1 -0
- package/dist/components/panels/PieChart.d.ts +7 -0
- package/dist/components/panels/PieChart.d.ts.map +1 -0
- package/dist/components/panels/PieChart.js +40 -0
- package/dist/components/panels/PieChart.js.map +1 -0
- package/dist/components/panels/RadarChart.d.ts +7 -0
- package/dist/components/panels/RadarChart.d.ts.map +1 -0
- package/dist/components/panels/RadarChart.js +50 -0
- package/dist/components/panels/RadarChart.js.map +1 -0
- package/dist/components/panels/RadialBarChart.d.ts +7 -0
- package/dist/components/panels/RadialBarChart.d.ts.map +1 -0
- package/dist/components/panels/RadialBarChart.js +49 -0
- package/dist/components/panels/RadialBarChart.js.map +1 -0
- package/dist/components/panels/SankeyChart.d.ts +7 -0
- package/dist/components/panels/SankeyChart.d.ts.map +1 -0
- package/dist/components/panels/SankeyChart.js +39 -0
- package/dist/components/panels/SankeyChart.js.map +1 -0
- package/dist/components/panels/ScatterChart.d.ts +7 -0
- package/dist/components/panels/ScatterChart.d.ts.map +1 -0
- package/dist/components/panels/ScatterChart.js +54 -0
- package/dist/components/panels/ScatterChart.js.map +1 -0
- package/dist/components/panels/StatPanel.d.ts +8 -0
- package/dist/components/panels/StatPanel.d.ts.map +1 -0
- package/dist/components/panels/StatPanel.js +40 -0
- package/dist/components/panels/StatPanel.js.map +1 -0
- package/dist/components/panels/StreamChart.d.ts +7 -0
- package/dist/components/panels/StreamChart.d.ts.map +1 -0
- package/dist/components/panels/StreamChart.js +54 -0
- package/dist/components/panels/StreamChart.js.map +1 -0
- package/dist/components/panels/SunburstChart.d.ts +7 -0
- package/dist/components/panels/SunburstChart.d.ts.map +1 -0
- package/dist/components/panels/SunburstChart.js +60 -0
- package/dist/components/panels/SunburstChart.js.map +1 -0
- package/dist/components/panels/TablePanel.d.ts +7 -0
- package/dist/components/panels/TablePanel.d.ts.map +1 -0
- package/dist/components/panels/TablePanel.js +79 -0
- package/dist/components/panels/TablePanel.js.map +1 -0
- package/dist/components/panels/TreemapChart.d.ts +7 -0
- package/dist/components/panels/TreemapChart.d.ts.map +1 -0
- package/dist/components/panels/TreemapChart.js +59 -0
- package/dist/components/panels/TreemapChart.js.map +1 -0
- package/dist/components/panels/VideoPanel.d.ts +15 -0
- package/dist/components/panels/VideoPanel.d.ts.map +1 -0
- package/dist/components/panels/VideoPanel.js +25 -0
- package/dist/components/panels/VideoPanel.js.map +1 -0
- package/dist/components/panels/WaffleChart.d.ts +7 -0
- package/dist/components/panels/WaffleChart.d.ts.map +1 -0
- package/dist/components/panels/WaffleChart.js +46 -0
- package/dist/components/panels/WaffleChart.js.map +1 -0
- package/dist/components/panels/index.d.ts +3 -0
- package/dist/components/panels/index.d.ts.map +1 -0
- package/dist/components/panels/index.js +60 -0
- package/dist/components/panels/index.js.map +1 -0
- package/dist/components/panels/nivo-theme.d.ts +95 -0
- package/dist/components/panels/nivo-theme.d.ts.map +1 -0
- package/dist/components/panels/nivo-theme.js +140 -0
- package/dist/components/panels/nivo-theme.js.map +1 -0
- package/dist/components/panels/semantic-colors.d.ts +7 -0
- package/dist/components/panels/semantic-colors.d.ts.map +1 -0
- package/dist/components/panels/semantic-colors.js +100 -0
- package/dist/components/panels/semantic-colors.js.map +1 -0
- package/dist/components/ui/Button.d.ts +9 -0
- package/dist/components/ui/Button.d.ts.map +1 -0
- package/dist/components/ui/Button.js +40 -0
- package/dist/components/ui/Button.js.map +1 -0
- package/dist/components/ui/Tabs.d.ts +11 -0
- package/dist/components/ui/Tabs.d.ts.map +1 -0
- package/dist/components/ui/Tabs.js +28 -0
- package/dist/components/ui/Tabs.js.map +1 -0
- package/dist/connectors/bigquery.d.ts +26 -0
- package/dist/connectors/bigquery.d.ts.map +1 -0
- package/dist/connectors/bigquery.js +113 -0
- package/dist/connectors/bigquery.js.map +1 -0
- package/dist/connectors/index.d.ts +17 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +23 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/params.d.ts +15 -0
- package/dist/connectors/params.d.ts.map +1 -0
- package/dist/connectors/params.js +46 -0
- package/dist/connectors/params.js.map +1 -0
- package/dist/connectors/postgres.d.ts +29 -0
- package/dist/connectors/postgres.d.ts.map +1 -0
- package/dist/connectors/postgres.js +130 -0
- package/dist/connectors/postgres.js.map +1 -0
- package/dist/connectors/redshift-data.d.ts +25 -0
- package/dist/connectors/redshift-data.d.ts.map +1 -0
- package/dist/connectors/redshift-data.js +237 -0
- package/dist/connectors/redshift-data.js.map +1 -0
- package/dist/connectors/redshift.d.ts +29 -0
- package/dist/connectors/redshift.d.ts.map +1 -0
- package/dist/connectors/redshift.js +138 -0
- package/dist/connectors/redshift.js.map +1 -0
- package/dist/connectors/registry.d.ts +7 -0
- package/dist/connectors/registry.d.ts.map +1 -0
- package/dist/connectors/registry.js +30 -0
- package/dist/connectors/registry.js.map +1 -0
- package/dist/connectors/snowflake.d.ts +37 -0
- package/dist/connectors/snowflake.d.ts.map +1 -0
- package/dist/connectors/snowflake.js +181 -0
- package/dist/connectors/snowflake.js.map +1 -0
- package/dist/connectors/types.d.ts +41 -0
- package/dist/connectors/types.d.ts.map +1 -0
- package/dist/connectors/types.js +15 -0
- package/dist/connectors/types.js.map +1 -0
- package/dist/connectors/url-parsers.d.ts +13 -0
- package/dist/connectors/url-parsers.d.ts.map +1 -0
- package/dist/connectors/url-parsers.js +95 -0
- package/dist/connectors/url-parsers.js.map +1 -0
- package/dist/connectors/url.d.ts +36 -0
- package/dist/connectors/url.d.ts.map +1 -0
- package/dist/connectors/url.js +139 -0
- package/dist/connectors/url.js.map +1 -0
- package/dist/filters/cascade.d.ts +13 -0
- package/dist/filters/cascade.d.ts.map +1 -0
- package/dist/filters/cascade.js +32 -0
- package/dist/filters/cascade.js.map +1 -0
- package/dist/filters/daterange.d.ts +8 -0
- package/dist/filters/daterange.d.ts.map +1 -0
- package/dist/filters/daterange.js +119 -0
- package/dist/filters/daterange.js.map +1 -0
- package/dist/filters/index.d.ts +7 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/index.js +18 -0
- package/dist/filters/index.js.map +1 -0
- package/dist/filters/resolver.d.ts +3 -0
- package/dist/filters/resolver.d.ts.map +1 -0
- package/dist/filters/resolver.js +122 -0
- package/dist/filters/resolver.js.map +1 -0
- package/dist/filters/validation.d.ts +17 -0
- package/dist/filters/validation.d.ts.map +1 -0
- package/dist/filters/validation.js +84 -0
- package/dist/filters/validation.js.map +1 -0
- package/dist/formats.d.ts +4 -0
- package/dist/formats.d.ts.map +1 -0
- package/dist/formats.js +127 -0
- package/dist/formats.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/auth-provider.d.ts +22 -0
- package/dist/interfaces/auth-provider.d.ts.map +1 -0
- package/dist/interfaces/auth-provider.js +15 -0
- package/dist/interfaces/auth-provider.js.map +1 -0
- package/dist/interfaces/dashboard-store.d.ts +17 -0
- package/dist/interfaces/dashboard-store.d.ts.map +1 -0
- package/dist/interfaces/dashboard-store.js +15 -0
- package/dist/interfaces/dashboard-store.js.map +1 -0
- package/dist/interfaces/datasource-store.d.ts +6 -0
- package/dist/interfaces/datasource-store.d.ts.map +1 -0
- package/dist/interfaces/datasource-store.js +15 -0
- package/dist/interfaces/datasource-store.js.map +1 -0
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +15 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/locale/context.d.ts +6 -0
- package/dist/locale/context.d.ts.map +1 -0
- package/dist/locale/context.js +23 -0
- package/dist/locale/context.js.map +1 -0
- package/dist/locale/index.d.ts +2 -0
- package/dist/locale/index.d.ts.map +1 -0
- package/dist/locale/index.js +15 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/query/array-expansion.d.ts +5 -0
- package/dist/query/array-expansion.d.ts.map +1 -0
- package/dist/query/array-expansion.js +39 -0
- package/dist/query/array-expansion.js.map +1 -0
- package/dist/query/index.d.ts +8 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +20 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/pipeline.d.ts +27 -0
- package/dist/query/pipeline.d.ts.map +1 -0
- package/dist/query/pipeline.js +49 -0
- package/dist/query/pipeline.js.map +1 -0
- package/dist/query/strategy/http.d.ts +7 -0
- package/dist/query/strategy/http.d.ts.map +1 -0
- package/dist/query/strategy/http.js +26 -0
- package/dist/query/strategy/http.js.map +1 -0
- package/dist/query/strategy/index.d.ts +4 -0
- package/dist/query/strategy/index.d.ts.map +1 -0
- package/dist/query/strategy/index.js +32 -0
- package/dist/query/strategy/index.js.map +1 -0
- package/dist/query/strategy/sql.d.ts +7 -0
- package/dist/query/strategy/sql.d.ts.map +1 -0
- package/dist/query/strategy/sql.js +40 -0
- package/dist/query/strategy/sql.js.map +1 -0
- package/dist/query/strategy/types.d.ts +6 -0
- package/dist/query/strategy/types.d.ts.map +1 -0
- package/dist/query/strategy/types.js +15 -0
- package/dist/query/strategy/types.js.map +1 -0
- package/dist/query/template.d.ts +7 -0
- package/dist/query/template.d.ts.map +1 -0
- package/dist/query/template.js +36 -0
- package/dist/query/template.js.map +1 -0
- package/dist/schemas/config.d.ts +74 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +129 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/dashboard.d.ts +716 -0
- package/dist/schemas/dashboard.d.ts.map +1 -0
- package/dist/schemas/dashboard.js +314 -0
- package/dist/schemas/dashboard.js.map +1 -0
- package/dist/schemas/datasource.d.ts +252 -0
- package/dist/schemas/datasource.d.ts.map +1 -0
- package/dist/schemas/datasource.js +186 -0
- package/dist/schemas/datasource.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +18 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/theme.d.ts +36 -0
- package/dist/schemas/theme.d.ts.map +1 -0
- package/dist/schemas/theme.js +48 -0
- package/dist/schemas/theme.js.map +1 -0
- package/dist/startup/index.d.ts +3 -0
- package/dist/startup/index.d.ts.map +1 -0
- package/dist/startup/index.js +15 -0
- package/dist/startup/index.js.map +1 -0
- package/dist/startup/sql-lint.d.ts +13 -0
- package/dist/startup/sql-lint.d.ts.map +1 -0
- package/dist/startup/sql-lint.js +86 -0
- package/dist/startup/sql-lint.js.map +1 -0
- package/dist/theme/builtin.d.ts +5 -0
- package/dist/theme/builtin.d.ts.map +1 -0
- package/dist/theme/builtin.js +102 -0
- package/dist/theme/builtin.js.map +1 -0
- package/dist/theme/context.d.ts +7 -0
- package/dist/theme/context.d.ts.map +1 -0
- package/dist/theme/context.js +26 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +16 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/loader-export.d.ts +2 -0
- package/dist/theme/loader-export.d.ts.map +1 -0
- package/dist/theme/loader-export.js +15 -0
- package/dist/theme/loader-export.js.map +1 -0
- package/dist/theme/loader.d.ts +11 -0
- package/dist/theme/loader.d.ts.map +1 -0
- package/dist/theme/loader.js +60 -0
- package/dist/theme/loader.js.map +1 -0
- package/package.json +148 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsiveBar } from "@nivo/bar";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
import { ChartTooltip } from "./ChartTooltip";
|
|
19
|
+
import { formatValue, formatValueShort } from "../../formats";
|
|
20
|
+
import { useLocale } from "../../locale/context";
|
|
21
|
+
import { extractSemanticColor } from "./semantic-colors";
|
|
22
|
+
export function BarChart({ data, config }) {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
25
|
+
const palette = getChartPalette(theme);
|
|
26
|
+
const xKey = config.x ?? "x";
|
|
27
|
+
const yKey = config.y ?? "y";
|
|
28
|
+
const yFormat = config.y_format;
|
|
29
|
+
const seriesKey = config.series;
|
|
30
|
+
const stacked = config.stacked ?? false;
|
|
31
|
+
// Build color map: explicit series_colors > semantic theme colors > palette
|
|
32
|
+
const seriesColorMap = {};
|
|
33
|
+
if (config.series_colors) {
|
|
34
|
+
Object.assign(seriesColorMap, config.series_colors);
|
|
35
|
+
}
|
|
36
|
+
const locale = useLocale();
|
|
37
|
+
const fmt = (v) => yFormat
|
|
38
|
+
? formatValue(v, yFormat, locale)
|
|
39
|
+
: v.toLocaleString(locale, { maximumFractionDigits: 2 });
|
|
40
|
+
let chartData;
|
|
41
|
+
let keys;
|
|
42
|
+
if (seriesKey) {
|
|
43
|
+
const seriesValues = Array.from(new Set(data.map((r) => String(r[seriesKey]))));
|
|
44
|
+
keys = seriesValues;
|
|
45
|
+
const grouped = {};
|
|
46
|
+
for (const row of data) {
|
|
47
|
+
const xVal = String(row[xKey]);
|
|
48
|
+
if (!grouped[xVal])
|
|
49
|
+
grouped[xVal] = { [xKey]: xVal };
|
|
50
|
+
grouped[xVal][String(row[seriesKey])] = Number(row[yKey]) || 0;
|
|
51
|
+
}
|
|
52
|
+
chartData = Object.values(grouped);
|
|
53
|
+
// Auto-map semantic colors for series values not already in seriesColorMap
|
|
54
|
+
for (const sv of seriesValues) {
|
|
55
|
+
if (!seriesColorMap[sv]) {
|
|
56
|
+
const semantic = extractSemanticColor(sv, theme);
|
|
57
|
+
if (semantic)
|
|
58
|
+
seriesColorMap[sv] = semantic;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
keys = [yKey];
|
|
64
|
+
chartData = data.map((row) => ({ ...row }));
|
|
65
|
+
}
|
|
66
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsiveBar, { data: chartData, keys: keys, indexBy: xKey, groupMode: stacked ? "stacked" : "grouped", colors: Object.keys(seriesColorMap).length > 0
|
|
67
|
+
? ({ id }) => seriesColorMap[String(id)] ??
|
|
68
|
+
palette[keys.indexOf(String(id)) % palette.length]
|
|
69
|
+
: config.color
|
|
70
|
+
? [config.color]
|
|
71
|
+
: palette, theme: nivoTheme, margin: { top: 16, right: 16, bottom: 48, left: 56 }, padding: 0.3, tooltip: ({ id, value, indexValue }) => {
|
|
72
|
+
const hasMultipleSeries = keys.length > 1;
|
|
73
|
+
const formatted = fmt(typeof value === "number" ? value : Number(value));
|
|
74
|
+
return (_jsx(ChartTooltip, { label: String(indexValue), value: hasMultipleSeries ? `${id}: ${formatted}` : formatted }));
|
|
75
|
+
}, axisBottom: {
|
|
76
|
+
tickSize: 4,
|
|
77
|
+
tickPadding: 4,
|
|
78
|
+
tickRotation: -30,
|
|
79
|
+
}, axisLeft: {
|
|
80
|
+
tickSize: 4,
|
|
81
|
+
tickPadding: 4,
|
|
82
|
+
format: (v) => yFormat
|
|
83
|
+
? formatValueShort(v, yFormat, locale)
|
|
84
|
+
: Number(v).toLocaleString(locale),
|
|
85
|
+
}, labelSkipWidth: 12, labelSkipHeight: 12, labelTextColor: { from: "color", modifiers: [["brighter", 3]] }, legends: seriesKey
|
|
86
|
+
? [
|
|
87
|
+
{
|
|
88
|
+
dataFrom: "keys",
|
|
89
|
+
anchor: "bottom-right",
|
|
90
|
+
direction: "column",
|
|
91
|
+
translateX: 120,
|
|
92
|
+
itemWidth: 100,
|
|
93
|
+
itemHeight: 20,
|
|
94
|
+
symbolSize: 12,
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
: [] }) }));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../src/components/panels/BarChart.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAs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QAAQ,EAAE,CAAC;gBACX,WAAW,EAAE,CAAC;gBACd,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CACZ,OAAO;oBACL,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC;oBACtC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;aACvC,EACD,cAAc,EAAE,EAAE,EAClB,eAAe,EAAE,EAAE,EACnB,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAC/D,OAAO,EACL,SAAS;gBACP,CAAC,CAAC;oBACE;wBACE,QAAQ,EAAE,MAAM;wBAChB,MAAM,EAAE,cAAc;wBACtB,SAAS,EAAE,QAAQ;wBACnB,UAAU,EAAE,GAAG;wBACf,SAAS,EAAE,GAAG;wBACd,UAAU,EAAE,EAAE;wBACd,UAAU,EAAE,EAAE;qBACf;iBACF;gBACH,CAAC,CAAC,EAAE,GAER,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoxPlotChart.d.ts","sourceRoot":"","sources":["../../../src/components/panels/BoxPlotChart.tsx"],"names":[],"mappings":"AAkBA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;CACb;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CA6C7D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsiveBoxPlot } from "@nivo/boxplot";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
export function BoxPlotChart({ data, config }) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
21
|
+
const palette = getChartPalette(theme);
|
|
22
|
+
const groupKey = config.group ?? "group";
|
|
23
|
+
const subGroupKey = config.subGroup;
|
|
24
|
+
const valueKey = config.value ?? config.y ?? "value";
|
|
25
|
+
// Pass raw data — Nivo BoxPlot computes statistics internally
|
|
26
|
+
// Each row needs: group, subGroup (optional), value
|
|
27
|
+
const chartData = data.map((row) => {
|
|
28
|
+
const entry = {
|
|
29
|
+
group: String(row[groupKey]),
|
|
30
|
+
value: Number(row[valueKey]) || 0,
|
|
31
|
+
};
|
|
32
|
+
if (subGroupKey && row[subGroupKey] !== undefined) {
|
|
33
|
+
entry.subGroup = String(row[subGroupKey]);
|
|
34
|
+
}
|
|
35
|
+
return entry;
|
|
36
|
+
});
|
|
37
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsiveBoxPlot, { data: chartData, groups: Array.from(new Set(data.map((r) => String(r[groupKey])))), subGroups: subGroupKey
|
|
38
|
+
? Array.from(new Set(data.map((r) => String(r[subGroupKey]))))
|
|
39
|
+
: undefined, value: valueKey, groupBy: "group", colors: palette, theme: nivoTheme, margin: { top: 16, right: 16, bottom: 48, left: 56 }, padding: 0.3, axisBottom: { tickSize: 4, tickPadding: 4 }, axisLeft: { tickSize: 4, tickPadding: 4 }, medianWidth: 2, whiskerEndSize: 0.6 }) }));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=BoxPlotChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoxPlotChart.js","sourceRoot":"","sources":["../../../src/components/panels/BoxPlotChart.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmB;IAC5D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAW,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC;IACjD,MAAM,WAAW,GAAuB,MAAM,CAAC,QAAQ,CAAC;IACxD,MAAM,QAAQ,GAAW,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC;IAE7D,8DAA8D;IAC9D,oDAAoD;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACjC,MAAM,KAAK,GAA4B;YACrC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5B,KAAK,EAAE,MAA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ACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulletChart.d.ts","sourceRoot":"","sources":["../../../src/components/panels/BulletChart.tsx"],"names":[],"mappings":"AAkBA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;CACb;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CA6C5D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsiveBullet } from "@nivo/bullet";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
export function BulletChart({ data, config }) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
21
|
+
const palette = getChartPalette(theme);
|
|
22
|
+
const idKey = config.id ?? "id";
|
|
23
|
+
const rangesKey = config.ranges ?? "ranges";
|
|
24
|
+
const measuresKey = config.measures ?? "measures";
|
|
25
|
+
const markersKey = config.markers ?? "markers";
|
|
26
|
+
// Rows should have id, ranges (comma-sep or array), measures, markers
|
|
27
|
+
const chartData = data.map((row) => {
|
|
28
|
+
const parseList = (val) => {
|
|
29
|
+
if (Array.isArray(val))
|
|
30
|
+
return val.map(Number);
|
|
31
|
+
if (typeof val === "string")
|
|
32
|
+
return val.split(",").map((v) => Number(v.trim()));
|
|
33
|
+
if (typeof val === "number")
|
|
34
|
+
return [val];
|
|
35
|
+
return [];
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
id: String(row[idKey]),
|
|
39
|
+
ranges: parseList(row[rangesKey]),
|
|
40
|
+
measures: parseList(row[measuresKey]),
|
|
41
|
+
markers: parseList(row[markersKey]),
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsiveBullet, { data: chartData, theme: nivoTheme, margin: { top: 40, right: 32, bottom: 40, left: 120 }, spacing: 32, titleAlign: "start", titleOffsetX: -100, measureSize: 0.4, markerSize: 0.6, rangeColors: ["#1e293b", "#334155", "#475569"], measureColors: palette, markerColors: ["#fb7185"] }) }));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=BulletChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulletChart.js","sourceRoot":"","sources":["../../../src/components/panels/BulletChart.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmB;IAC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IAEH,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC5B,KAAC,gBAAgB,IACf,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EACrD,OAAO,EAAE,EAAE,EACX,UAAU,EAAC,OAAO,EAClB,YAAY,EAAE,CAAC,GAAG,EAClB,WAAW,EAAE,GAAG,EAChB,UAAU,EAAE,GAAG,EACf,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EAC9C,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,CAAC,SAAS,CAAC,GACzB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BumpChart.d.ts","sourceRoot":"","sources":["../../../src/components/panels/BumpChart.tsx"],"names":[],"mappings":"AAkBA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;CACb;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CAyC1D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsiveBump } from "@nivo/bump";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
export function BumpChart({ data, config }) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
21
|
+
const palette = getChartPalette(theme);
|
|
22
|
+
const xKey = config.x ?? "x";
|
|
23
|
+
const yKey = config.y ?? "y";
|
|
24
|
+
const seriesKey = config.series ?? config.id ?? "id";
|
|
25
|
+
const seriesMap = new Map();
|
|
26
|
+
for (const row of data) {
|
|
27
|
+
const id = String(row[seriesKey]);
|
|
28
|
+
if (!seriesMap.has(id))
|
|
29
|
+
seriesMap.set(id, []);
|
|
30
|
+
seriesMap.get(id).push({ x: row[xKey], y: Number(row[yKey]) || 0 });
|
|
31
|
+
}
|
|
32
|
+
const chartData = Array.from(seriesMap.entries()).map(([id, points]) => ({
|
|
33
|
+
id,
|
|
34
|
+
data: points,
|
|
35
|
+
}));
|
|
36
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsiveBump, { data: chartData, colors: palette, theme: nivoTheme, margin: { top: 40, right: 100, bottom: 40, left: 60 }, lineWidth: 3, activeLineWidth: 6, inactiveLineWidth: 3, inactiveOpacity: 0.15, pointSize: 10, activePointSize: 16, inactivePointSize: 0, pointBorderWidth: 3, activePointBorderWidth: 3, axisBottom: { tickSize: 4, tickPadding: 4 }, axisLeft: { tickSize: 4, tickPadding: 4 } }) }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=BumpChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BumpChart.js","sourceRoot":"","sources":["../../../src/components/panels/BumpChart.tsx"],"names":[],"mappings":";AAAA,iCA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ChE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsiveCalendar } from "@nivo/calendar";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
export function CalendarHeatmap({ data, config }) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
21
|
+
const palette = getChartPalette(theme);
|
|
22
|
+
const dayKey = config.day ?? "day";
|
|
23
|
+
const valueKey = config.value ?? "value";
|
|
24
|
+
const chartData = data.map((row) => ({
|
|
25
|
+
day: String(row[dayKey]),
|
|
26
|
+
value: Number(row[valueKey]) || 0,
|
|
27
|
+
}));
|
|
28
|
+
// Derive date range from data
|
|
29
|
+
const days = chartData.map((d) => d.day).sort();
|
|
30
|
+
const from = config.from ?? days[0] ?? new Date().getFullYear() + "-01-01";
|
|
31
|
+
const to = config.to ?? days[days.length - 1] ?? new Date().getFullYear() + "-12-31";
|
|
32
|
+
// Use first 4 palette colors for the calendar gradient, or fall back to defaults
|
|
33
|
+
const calendarColors = palette.length >= 4
|
|
34
|
+
? [palette[0], palette[1], palette[2], palette[3]]
|
|
35
|
+
: ["#164e63", "#0e7490", "#06b6d4", "#22d3ee"];
|
|
36
|
+
// Extract background-like colors from theme for empty/border
|
|
37
|
+
const emptyColor = nivoTheme.grid.line.stroke;
|
|
38
|
+
const borderColor = nivoTheme.grid.line.stroke;
|
|
39
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsiveCalendar, { data: chartData, from: from, to: to, theme: nivoTheme, margin: { top: 24, right: 24, bottom: 8, left: 24 }, emptyColor: emptyColor, colors: calendarColors, yearSpacing: 40, monthBorderColor: borderColor, dayBorderWidth: 2, dayBorderColor: borderColor }) }));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=CalendarHeatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarHeatmap.js","sourceRoot":"","sources":["../../../src/components/panels/CalendarHeatmap.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmB;IAC/D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEvC,MAAM,MAAM,GAAW,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC;IAC3C,MAAM,QAAQ,GAAW,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC;IAEjD,MAAM,SAAS,GA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AAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EACnD,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,EAAE,EACf,gBAAgB,EAAE,WAAW,EAC7B,cAAc,EAAE,CAAC,EACjB,cAAc,EAAE,WAAW,GAC3B,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ChartTooltipProps {
|
|
2
|
+
/** Label describing the data point (x-axis value, category, etc.) */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Formatted value string */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Optional series color dot */
|
|
7
|
+
color?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Themed tooltip for single-series Nivo charts.
|
|
11
|
+
* Uses inline styles because it renders inside an SVG foreign-object context.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ChartTooltip({ label, value, color }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export interface MultiSeriesPoint {
|
|
15
|
+
id: string;
|
|
16
|
+
value: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface MultiSeriesChartTooltipProps {
|
|
20
|
+
/** X-axis label / shared label for all series */
|
|
21
|
+
label: string;
|
|
22
|
+
points: MultiSeriesPoint[];
|
|
23
|
+
}
|
|
24
|
+
export declare function MultiSeriesChartTooltip({ label, points, }: MultiSeriesChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a Nivo-compatible tooltip component for bar charts.
|
|
27
|
+
* Usage: <ResponsiveBar tooltip={barTooltip} ... />
|
|
28
|
+
*/
|
|
29
|
+
export declare function useBarTooltip(): ({ id, value, indexValue, }: {
|
|
30
|
+
id: string | number;
|
|
31
|
+
value: number;
|
|
32
|
+
indexValue: string | number;
|
|
33
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a Nivo-compatible tooltip component for line / area charts.
|
|
36
|
+
* Usage: <ResponsiveLine tooltip={lineTooltip} ... />
|
|
37
|
+
*/
|
|
38
|
+
export declare function useLineTooltip(): ({ point, }: {
|
|
39
|
+
point: {
|
|
40
|
+
seriesId: string | number;
|
|
41
|
+
data: {
|
|
42
|
+
xFormatted: string | number;
|
|
43
|
+
yFormatted: string | number;
|
|
44
|
+
};
|
|
45
|
+
color: string;
|
|
46
|
+
};
|
|
47
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=ChartTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/panels/ChartTooltip.tsx"],"names":[],"mappings":"AA2DA,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CA4CtE;AAID,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B;IAC3C,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,MAAM,GACP,EAAE,4BAA4B,2CA6D9B;AAID;;;GAGG;AACH,wBAAgB,aAAa,KACnB,4BAIL;IACD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,6CACF;AAED;;;GAGG;AACH,wBAAgB,cAAc,KACpB,YAEL;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;QAC1B,IAAI,EAAE;YAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QACnE,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,6CAOF"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { useTheme } from "../../theme/context";
|
|
16
|
+
/**
|
|
17
|
+
* Extracts a hex color from a Tailwind class string (same logic as nivo-theme).
|
|
18
|
+
* Duplicated here to keep this file self-contained and avoid circular deps.
|
|
19
|
+
*/
|
|
20
|
+
function extractHex(twClass, fallback) {
|
|
21
|
+
const match = twClass.match(/#[0-9a-fA-F]{3,8}/);
|
|
22
|
+
if (match)
|
|
23
|
+
return match[0];
|
|
24
|
+
const namedColors = {
|
|
25
|
+
"slate-50": "#f8fafc",
|
|
26
|
+
"slate-100": "#f1f5f9",
|
|
27
|
+
"slate-200": "#e2e8f0",
|
|
28
|
+
"slate-300": "#cbd5e1",
|
|
29
|
+
"slate-400": "#94a3b8",
|
|
30
|
+
"slate-500": "#64748b",
|
|
31
|
+
"slate-600": "#475569",
|
|
32
|
+
"slate-700": "#334155",
|
|
33
|
+
"slate-800": "#1e293b",
|
|
34
|
+
"slate-900": "#0f172a",
|
|
35
|
+
"slate-950": "#020617",
|
|
36
|
+
"gray-800": "#1f2937",
|
|
37
|
+
"gray-900": "#111827",
|
|
38
|
+
"zinc-800": "#27272a",
|
|
39
|
+
"zinc-900": "#18181b",
|
|
40
|
+
white: "#ffffff",
|
|
41
|
+
black: "#000000",
|
|
42
|
+
"indigo-300": "#a5b4fc",
|
|
43
|
+
"indigo-400": "#818cf8",
|
|
44
|
+
"indigo-500": "#6366f1",
|
|
45
|
+
"emerald-400": "#34d399",
|
|
46
|
+
"red-400": "#f87171",
|
|
47
|
+
"amber-400": "#fbbf24",
|
|
48
|
+
};
|
|
49
|
+
for (const [name, hex] of Object.entries(namedColors)) {
|
|
50
|
+
if (twClass.includes(name))
|
|
51
|
+
return hex;
|
|
52
|
+
}
|
|
53
|
+
return fallback;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Themed tooltip for single-series Nivo charts.
|
|
57
|
+
* Uses inline styles because it renders inside an SVG foreign-object context.
|
|
58
|
+
*/
|
|
59
|
+
export function ChartTooltip({ label, value, color }) {
|
|
60
|
+
const theme = useTheme();
|
|
61
|
+
const bg = extractHex(theme.surfaces.panel, "#0f172a");
|
|
62
|
+
const border = extractHex(theme.surfaces.panelBorder, "#334155");
|
|
63
|
+
const textMain = extractHex(theme.typography.panelTitle, "#f1f5f9");
|
|
64
|
+
const textMuted = extractHex(theme.typography.muted, "#64748b");
|
|
65
|
+
return (_jsxs("div", { style: {
|
|
66
|
+
background: bg,
|
|
67
|
+
border: `1px solid ${border}`,
|
|
68
|
+
borderRadius: 10,
|
|
69
|
+
padding: "8px 12px",
|
|
70
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.45)",
|
|
71
|
+
backdropFilter: "blur(8px)",
|
|
72
|
+
display: "flex",
|
|
73
|
+
flexDirection: "column",
|
|
74
|
+
gap: 4,
|
|
75
|
+
minWidth: 120,
|
|
76
|
+
}, children: [_jsx("span", { style: { fontSize: 11, color: textMuted, fontWeight: 500 }, children: label }), _jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [color && (_jsx("span", { style: {
|
|
77
|
+
width: 10,
|
|
78
|
+
height: 10,
|
|
79
|
+
borderRadius: "50%",
|
|
80
|
+
background: color,
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
} })), _jsx("span", { style: { fontSize: 14, color: textMain, fontWeight: 600 }, children: value })] })] }));
|
|
83
|
+
}
|
|
84
|
+
export function MultiSeriesChartTooltip({ label, points, }) {
|
|
85
|
+
const theme = useTheme();
|
|
86
|
+
const bg = extractHex(theme.surfaces.panel, "#0f172a");
|
|
87
|
+
const border = extractHex(theme.surfaces.panelBorder, "#334155");
|
|
88
|
+
const textMain = extractHex(theme.typography.panelTitle, "#f1f5f9");
|
|
89
|
+
const textMuted = extractHex(theme.typography.muted, "#64748b");
|
|
90
|
+
const divider = extractHex(theme.surfaces.panelBorder, "#334155");
|
|
91
|
+
return (_jsxs("div", { style: {
|
|
92
|
+
background: bg,
|
|
93
|
+
border: `1px solid ${border}`,
|
|
94
|
+
borderRadius: 10,
|
|
95
|
+
padding: "10px 14px",
|
|
96
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.45)",
|
|
97
|
+
backdropFilter: "blur(8px)",
|
|
98
|
+
minWidth: 160,
|
|
99
|
+
}, children: [_jsx("div", { style: {
|
|
100
|
+
fontSize: 11,
|
|
101
|
+
color: textMuted,
|
|
102
|
+
fontWeight: 500,
|
|
103
|
+
marginBottom: 8,
|
|
104
|
+
paddingBottom: 6,
|
|
105
|
+
borderBottom: `1px solid ${divider}`,
|
|
106
|
+
}, children: label }), _jsx("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: points.map((point) => (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [point.color && (_jsx("span", { style: {
|
|
107
|
+
width: 8,
|
|
108
|
+
height: 8,
|
|
109
|
+
borderRadius: "50%",
|
|
110
|
+
background: point.color,
|
|
111
|
+
flexShrink: 0,
|
|
112
|
+
} })), _jsx("span", { style: { fontSize: 12, color: textMuted, flex: 1 }, children: point.id }), _jsx("span", { style: { fontSize: 12, color: textMain, fontWeight: 600 }, children: point.value })] }, point.id))) })] }));
|
|
113
|
+
}
|
|
114
|
+
// ─── Nivo-compatible tooltip factory helpers ──────────────────────────────────
|
|
115
|
+
/**
|
|
116
|
+
* Returns a Nivo-compatible tooltip component for bar charts.
|
|
117
|
+
* Usage: <ResponsiveBar tooltip={barTooltip} ... />
|
|
118
|
+
*/
|
|
119
|
+
export function useBarTooltip() {
|
|
120
|
+
return ({ id, value, indexValue, }) => _jsx(ChartTooltip, { label: String(indexValue), value: `${id}: ${value}` });
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns a Nivo-compatible tooltip component for line / area charts.
|
|
124
|
+
* Usage: <ResponsiveLine tooltip={lineTooltip} ... />
|
|
125
|
+
*/
|
|
126
|
+
export function useLineTooltip() {
|
|
127
|
+
return ({ point, }) => (_jsx(ChartTooltip, { label: String(point.data.xFormatted), value: `${point.seriesId}: ${point.data.yFormatted}`, color: point.color }));
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=ChartTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTooltip.js","sourceRoot":"","sources":["../../../src/components/panels/ChartTooltip.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/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
|
+
data: Record<string, unknown>[];
|
|
3
|
+
config: Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
export declare function DonutChart({ data, config }: ChartPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../src/components/panels/DonutChart.tsx"],"names":[],"mappings":"AAqBA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CAgD3D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { ResponsivePie } from "@nivo/pie";
|
|
16
|
+
import { buildNivoTheme, getChartPalette } from "./nivo-theme";
|
|
17
|
+
import { useTheme } from "../../theme/context";
|
|
18
|
+
import { ChartTooltip } from "./ChartTooltip";
|
|
19
|
+
import { formatValue } from "../../formats";
|
|
20
|
+
import { useLocale } from "../../locale/context";
|
|
21
|
+
export function DonutChart({ data, config }) {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const nivoTheme = buildNivoTheme(theme);
|
|
24
|
+
const palette = getChartPalette(theme);
|
|
25
|
+
const idKey = config.id ?? config.x ?? "id";
|
|
26
|
+
const valueKey = config.value ?? config.y ?? "value";
|
|
27
|
+
const labelKey = config.label ?? idKey;
|
|
28
|
+
const yFormat = config.y_format;
|
|
29
|
+
const locale = useLocale();
|
|
30
|
+
const fmt = (v) => yFormat
|
|
31
|
+
? formatValue(v, yFormat, locale)
|
|
32
|
+
: v.toLocaleString(locale, { maximumFractionDigits: 0 });
|
|
33
|
+
const chartData = data.map((row) => ({
|
|
34
|
+
id: String(row[idKey]),
|
|
35
|
+
value: Number(row[valueKey]) || 0,
|
|
36
|
+
label: String(row[labelKey]),
|
|
37
|
+
}));
|
|
38
|
+
return (_jsx("div", { style: { height: "100%" }, children: _jsx(ResponsivePie, { data: chartData, colors: palette, theme: nivoTheme, margin: { top: 16, right: 100, bottom: 16, left: 100 }, innerRadius: 0.6, padAngle: 0.7, cornerRadius: 3, activeOuterRadiusOffset: 8, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsThickness: 2, arcLabelsSkipAngle: 10, arcLabelsTextColor: { from: "color", modifiers: [["brighter", 3]] }, valueFormat: (v) => fmt(v), tooltip: ({ datum }) => (_jsx(ChartTooltip, { label: datum.label, value: fmt(datum.value), color: datum.color })) }) }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=DonutChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.js","sourceRoot":"","sources":["../../../src/components/panels/DonutChart.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACt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