@plenustech/design-system 0.2.2 → 0.2.4
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/components/actions/ButtonTile/ButtonTile.cjs +2 -0
- package/dist/components/actions/ButtonTile/ButtonTile.cjs.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.js +23 -0
- package/dist/components/actions/ButtonTile/ButtonTile.js.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs +2 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js +16 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.cjs +2 -0
- package/dist/components/actions/Toolbar/Toolbar.cjs.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.js +118 -0
- package/dist/components/actions/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.cjs +2 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.cjs.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.js +20 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.js.map +1 -0
- package/dist/components/charts/ChartArea/ChartArea.cjs +1 -1
- package/dist/components/charts/ChartArea/ChartArea.cjs.map +1 -1
- package/dist/components/charts/ChartArea/ChartArea.js +196 -148
- package/dist/components/charts/ChartArea/ChartArea.js.map +1 -1
- package/dist/components/charts/ChartArea/ChartArea.module.css.cjs +1 -1
- package/dist/components/charts/ChartArea/ChartArea.module.css.js +12 -10
- package/dist/components/charts/ChartArea/ChartArea.module.css.js.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.cjs +1 -1
- package/dist/components/charts/ChartBar/ChartBar.cjs.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.js +168 -145
- package/dist/components/charts/ChartBar/ChartBar.js.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.module.css.cjs +1 -1
- package/dist/components/charts/ChartBar/ChartBar.module.css.js +12 -10
- package/dist/components/charts/ChartBar/ChartBar.module.css.js.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.cjs +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.cjs.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.js +179 -154
- package/dist/components/charts/ChartCombo/ChartCombo.js.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.cjs +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.js +16 -14
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.js.map +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.cjs +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.cjs.map +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.js +72 -61
- package/dist/components/charts/ChartDonut/ChartDonut.js.map +1 -1
- package/dist/components/charts/ChartGauge/ChartGauge.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js +307 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js +76 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js +107 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js +112 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js +57 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js.map +1 -0
- package/dist/components/charts/ChartLine/ChartLine.cjs +1 -1
- package/dist/components/charts/ChartLine/ChartLine.cjs.map +1 -1
- package/dist/components/charts/ChartLine/ChartLine.js +196 -143
- package/dist/components/charts/ChartLine/ChartLine.js.map +1 -1
- package/dist/components/charts/ChartLine/ChartLine.module.css.cjs +1 -1
- package/dist/components/charts/ChartLine/ChartLine.module.css.js +16 -14
- package/dist/components/charts/ChartLine/ChartLine.module.css.js.map +1 -1
- package/dist/components/charts/ChartMap/ChartMap.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.js +523 -0
- package/dist/components/charts/ChartMap/ChartMap.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js +124 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js +102 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js +118 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs +2 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.js +113 -0
- package/dist/components/charts/ChartMap/mapGeometry.js.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs +2 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.js +80 -0
- package/dist/components/charts/ChartMap/mapLabels.js.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.cjs +2 -0
- package/dist/components/charts/ChartMap/mapScales.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.js +131 -0
- package/dist/components/charts/ChartMap/mapScales.js.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.cjs +2 -0
- package/dist/components/charts/ChartMap/polylabel.cjs.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.js +50 -0
- package/dist/components/charts/ChartMap/polylabel.js.map +1 -0
- package/dist/components/charts/ChartPie/ChartPie.cjs +1 -1
- package/dist/components/charts/ChartPie/ChartPie.cjs.map +1 -1
- package/dist/components/charts/ChartPie/ChartPie.js +71 -60
- package/dist/components/charts/ChartPie/ChartPie.js.map +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.cjs +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.cjs.map +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.js +101 -84
- package/dist/components/charts/ChartRadial/ChartRadial.js.map +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.cjs +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.cjs.map +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.js +148 -125
- package/dist/components/charts/ChartSankey/ChartSankey.js.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.cjs +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.cjs.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.js +138 -106
- package/dist/components/charts/ChartScatter/ChartScatter.js.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.module.css.cjs +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.module.css.js +3 -3
- package/dist/components/charts/ChartSunburst/ChartSunburst.cjs +1 -1
- package/dist/components/charts/ChartSunburst/ChartSunburst.cjs.map +1 -1
- package/dist/components/charts/ChartSunburst/ChartSunburst.js +115 -100
- package/dist/components/charts/ChartSunburst/ChartSunburst.js.map +1 -1
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js +703 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js +124 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js +42 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js +109 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js +91 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js +77 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js.map +1 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.cjs +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.cjs.map +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.js +100 -89
- package/dist/components/charts/ChartTreemap/ChartTreemap.js.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.js +125 -105
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.js.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.cjs +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js +8 -6
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js.map +1 -1
- package/dist/components/charts/core/CartesianFrame.cjs +1 -1
- package/dist/components/charts/core/CartesianFrame.cjs.map +1 -1
- package/dist/components/charts/core/CartesianFrame.js +61 -96
- package/dist/components/charts/core/CartesianFrame.js.map +1 -1
- package/dist/components/charts/core/Chart.module.css.cjs +1 -1
- package/dist/components/charts/core/Chart.module.css.js +52 -54
- package/dist/components/charts/core/Chart.module.css.js.map +1 -1
- package/dist/components/charts/core/ChartFrame.cjs +1 -1
- package/dist/components/charts/core/ChartFrame.cjs.map +1 -1
- package/dist/components/charts/core/ChartFrame.js +53 -47
- package/dist/components/charts/core/ChartFrame.js.map +1 -1
- package/dist/components/charts/core/ChartLegend.cjs +1 -1
- package/dist/components/charts/core/ChartLegend.cjs.map +1 -1
- package/dist/components/charts/core/ChartLegend.js +37 -25
- package/dist/components/charts/core/ChartLegend.js.map +1 -1
- package/dist/components/charts/core/PointBands.cjs +2 -0
- package/dist/components/charts/core/PointBands.cjs.map +1 -0
- package/dist/components/charts/core/PointBands.js +41 -0
- package/dist/components/charts/core/PointBands.js.map +1 -0
- package/dist/components/charts/core/cartesianLayout.cjs +1 -1
- package/dist/components/charts/core/cartesianLayout.cjs.map +1 -1
- package/dist/components/charts/core/cartesianLayout.js +49 -41
- package/dist/components/charts/core/cartesianLayout.js.map +1 -1
- package/dist/components/charts/core/hoverPath.cjs +2 -0
- package/dist/components/charts/core/hoverPath.cjs.map +1 -0
- package/dist/components/charts/core/hoverPath.js +7 -0
- package/dist/components/charts/core/hoverPath.js.map +1 -0
- package/dist/components/charts/core/pointLabels.cjs +2 -0
- package/dist/components/charts/core/pointLabels.cjs.map +1 -0
- package/dist/components/charts/core/pointLabels.js +12 -0
- package/dist/components/charts/core/pointLabels.js.map +1 -0
- package/dist/components/charts/core/tooltips.cjs +2 -0
- package/dist/components/charts/core/tooltips.cjs.map +1 -0
- package/dist/components/charts/core/tooltips.js +48 -0
- package/dist/components/charts/core/tooltips.js.map +1 -0
- package/dist/components/charts/core/useCartesianLayout.cjs +2 -0
- package/dist/components/charts/core/useCartesianLayout.cjs.map +1 -0
- package/dist/components/charts/core/useCartesianLayout.js +38 -0
- package/dist/components/charts/core/useCartesianLayout.js.map +1 -0
- package/dist/components/charts/core/useChartMetrics.cjs +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs.map +1 -1
- package/dist/components/charts/core/useChartMetrics.js +20 -25
- package/dist/components/charts/core/useChartMetrics.js.map +1 -1
- package/dist/components/charts/core/useSeriesToggle.cjs +1 -1
- package/dist/components/charts/core/useSeriesToggle.cjs.map +1 -1
- package/dist/components/charts/core/useSeriesToggle.js +19 -12
- package/dist/components/charts/core/useSeriesToggle.js.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.js +56 -46
- package/dist/components/data-display/Accordion/Accordion.js.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.module.css.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.module.css.js +16 -16
- package/dist/components/data-display/List/List.cjs.map +1 -1
- package/dist/components/data-display/List/List.js.map +1 -1
- package/dist/components/data-display/List/List.module.css.cjs +1 -1
- package/dist/components/data-display/List/List.module.css.js +34 -24
- package/dist/components/data-display/List/List.module.css.js.map +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs.map +1 -1
- package/dist/components/data-display/List/ListingOptions.js +98 -74
- package/dist/components/data-display/List/ListingOptions.js.map +1 -1
- package/dist/components/data-display/List/useListing.cjs.map +1 -1
- package/dist/components/data-display/List/useListing.js.map +1 -1
- package/dist/components/data-display/SortableList/SortableList.cjs +2 -0
- package/dist/components/data-display/SortableList/SortableList.cjs.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.js +168 -0
- package/dist/components/data-display/SortableList/SortableList.js.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.cjs +2 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.cjs.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.js +34 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.js.map +1 -0
- package/dist/components/data-display/Table/Table.cjs +1 -1
- package/dist/components/data-display/Table/Table.cjs.map +1 -1
- package/dist/components/data-display/Table/Table.js +86 -85
- package/dist/components/data-display/Table/Table.js.map +1 -1
- package/dist/components/data-display/Table/Table.module.css.cjs +1 -1
- package/dist/components/data-display/Table/Table.module.css.js +50 -51
- package/dist/components/data-display/Table/Table.module.css.js.map +1 -1
- package/dist/components/data-display/Tag/Tag.cjs +2 -0
- package/dist/components/data-display/Tag/Tag.cjs.map +1 -0
- package/dist/components/data-display/Tag/Tag.js +50 -0
- package/dist/components/data-display/Tag/Tag.js.map +1 -0
- package/dist/components/data-display/Tag/Tag.module.css.cjs +2 -0
- package/dist/components/data-display/Tag/Tag.module.css.cjs.map +1 -0
- package/dist/components/data-display/Tag/Tag.module.css.js +22 -0
- package/dist/components/data-display/Tag/Tag.module.css.js.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.cjs +2 -0
- package/dist/components/data-display/Timeline/Timeline.cjs.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.js +31 -0
- package/dist/components/data-display/Timeline/Timeline.js.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs +2 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.js +30 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.js.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.cjs +2 -0
- package/dist/components/feedback/Skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.js +17 -0
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs +2 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.js +15 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/components/feedback/Toast/Toast.module.css.cjs +2 -0
- package/dist/components/feedback/Toast/Toast.module.css.cjs.map +1 -0
- package/dist/components/feedback/Toast/Toast.module.css.js +31 -0
- package/dist/components/feedback/Toast/Toast.module.css.js.map +1 -0
- package/dist/components/feedback/Toast/ToastRegion.cjs +2 -0
- package/dist/components/feedback/Toast/ToastRegion.cjs.map +1 -0
- package/dist/components/feedback/Toast/ToastRegion.js +62 -0
- package/dist/components/feedback/Toast/ToastRegion.js.map +1 -0
- package/dist/components/feedback/Toast/toastStore.cjs +2 -0
- package/dist/components/feedback/Toast/toastStore.cjs.map +1 -0
- package/dist/components/feedback/Toast/toastStore.js +33 -0
- package/dist/components/feedback/Toast/toastStore.js.map +1 -0
- package/dist/components/forms/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.js +43 -31
- package/dist/components/forms/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.js +1 -1
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs +2 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.js +54 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs +2 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js +22 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.cjs +2 -0
- package/dist/components/forms/ColorPicker/ColorPicker.cjs.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.js +57 -0
- package/dist/components/forms/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs +2 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.js +22 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.js.map +1 -0
- package/dist/components/forms/ComboBox/ComboBox.cjs.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.module.css.cjs +1 -1
- package/dist/components/forms/ComboBox/ComboBox.module.css.js +20 -20
- package/dist/components/forms/Field/Field.cjs +1 -1
- package/dist/components/forms/Field/Field.cjs.map +1 -1
- package/dist/components/forms/Field/Field.js +21 -20
- package/dist/components/forms/Field/Field.js.map +1 -1
- package/dist/components/forms/Field/Field.module.css.cjs +1 -1
- package/dist/components/forms/Field/Field.module.css.js +18 -12
- package/dist/components/forms/Field/Field.module.css.js.map +1 -1
- package/dist/components/forms/FileUpload/FileUpload.cjs +2 -0
- package/dist/components/forms/FileUpload/FileUpload.cjs.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.js +142 -0
- package/dist/components/forms/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.cjs +2 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.cjs.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.js +46 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.js.map +1 -0
- package/dist/components/forms/InputPassword/InputPassword.module.css.cjs +1 -1
- package/dist/components/forms/InputPassword/InputPassword.module.css.js +12 -12
- package/dist/components/forms/InputText/InputText.cjs +1 -1
- package/dist/components/forms/InputText/InputText.cjs.map +1 -1
- package/dist/components/forms/InputText/InputText.js +55 -47
- package/dist/components/forms/InputText/InputText.js.map +1 -1
- package/dist/components/forms/InputText/InputText.module.css.cjs +1 -1
- package/dist/components/forms/InputText/InputText.module.css.js +10 -10
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.cjs +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.js +4 -4
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs +2 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.js +52 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs +2 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js +22 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js.map +1 -0
- package/dist/components/forms/Select/Select.module.css.cjs +1 -1
- package/dist/components/forms/Select/Select.module.css.js +13 -13
- package/dist/components/forms/Switch/Switch.module.css.cjs +1 -1
- package/dist/components/forms/Switch/Switch.module.css.js +2 -2
- package/dist/components/icons/icons.cjs +1 -1
- package/dist/components/icons/icons.cjs.map +1 -1
- package/dist/components/icons/icons.js +198 -40
- package/dist/components/icons/icons.js.map +1 -1
- package/dist/components/navigation/SkipLink/SkipLink.cjs +2 -0
- package/dist/components/navigation/SkipLink/SkipLink.cjs.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.js +9 -0
- package/dist/components/navigation/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs +2 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.js +8 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.js.map +1 -0
- package/dist/components/navigation/Steps/Steps.cjs +2 -0
- package/dist/components/navigation/Steps/Steps.cjs.map +1 -0
- package/dist/components/navigation/Steps/Steps.js +30 -0
- package/dist/components/navigation/Steps/Steps.js.map +1 -0
- package/dist/components/navigation/Steps/Steps.module.css.cjs +2 -0
- package/dist/components/navigation/Steps/Steps.module.css.cjs.map +1 -0
- package/dist/components/navigation/Steps/Steps.module.css.js +26 -0
- package/dist/components/navigation/Steps/Steps.module.css.js.map +1 -0
- package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.cjs.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +88 -79
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.module.css.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.module.css.js +18 -14
- package/dist/components/navigation/Tabs/Tabs.module.css.js.map +1 -1
- package/dist/components/navigation/TabsNav/TabsNav.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.js +21 -0
- package/dist/components/navigation/TabsNav/TabsNav.js.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js +18 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js.map +1 -0
- package/dist/components/overlays/Dialog/Dialog.cjs +1 -1
- package/dist/components/overlays/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +11 -58
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs +2 -0
- package/dist/components/overlays/Dialog/DialogFrame.cjs.map +1 -0
- package/dist/components/overlays/Dialog/DialogFrame.js +65 -0
- package/dist/components/overlays/Dialog/DialogFrame.js.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.cjs +2 -0
- package/dist/components/overlays/Drawer/Drawer.cjs.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.js +17 -0
- package/dist/components/overlays/Drawer/Drawer.js.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.cjs +2 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.cjs.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.js +23 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.js.map +1 -0
- package/dist/components/overlays/Menu/Menu.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.cjs.map +1 -1
- package/dist/components/overlays/Menu/Menu.js +105 -86
- package/dist/components/overlays/Menu/Menu.js.map +1 -1
- package/dist/components/overlays/Menu/Menu.module.css.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.module.css.js +24 -6
- package/dist/components/overlays/Menu/Menu.module.css.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +190 -118
- package/dist/index.js.map +1 -1
- package/dist/types/components/actions/ButtonTile/ButtonTile.d.ts +14 -0
- package/dist/types/components/actions/ButtonTile/index.d.ts +2 -0
- package/dist/types/components/actions/Toolbar/Toolbar.d.ts +27 -0
- package/dist/types/components/actions/Toolbar/index.d.ts +2 -0
- package/dist/types/components/charts/ChartArea/ChartArea.d.ts +15 -4
- package/dist/types/components/charts/ChartBar/ChartBar.d.ts +11 -4
- package/dist/types/components/charts/ChartCombo/ChartCombo.d.ts +16 -4
- package/dist/types/components/charts/ChartDonut/ChartDonut.d.ts +5 -1
- package/dist/types/components/charts/ChartGauge/ChartGauge.d.ts +83 -0
- package/dist/types/components/charts/ChartGauge/gaugeLayout.d.ts +64 -0
- package/dist/types/components/charts/ChartGauge/gaugeReading.d.ts +97 -0
- package/dist/types/components/charts/ChartGauge/gaugeScale.d.ts +38 -0
- package/dist/types/components/charts/ChartGauge/index.d.ts +2 -0
- package/dist/types/components/charts/ChartLine/ChartLine.d.ts +15 -4
- package/dist/types/components/charts/ChartMap/ChartMap.d.ts +104 -0
- package/dist/types/components/charts/ChartMap/ChartMapLegend.d.ts +44 -0
- package/dist/types/components/charts/ChartMap/ChartMapTable.d.ts +38 -0
- package/dist/types/components/charts/ChartMap/index.d.ts +4 -0
- package/dist/types/components/charts/ChartMap/mapGeometry.d.ts +56 -0
- package/dist/types/components/charts/ChartMap/mapLabels.d.ts +51 -0
- package/dist/types/components/charts/ChartMap/mapScales.d.ts +76 -0
- package/dist/types/components/charts/ChartMap/polylabel.d.ts +9 -0
- package/dist/types/components/charts/ChartPie/ChartPie.d.ts +5 -1
- package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +5 -1
- package/dist/types/components/charts/ChartSankey/ChartSankey.d.ts +5 -1
- package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +7 -1
- package/dist/types/components/charts/ChartSunburst/ChartSunburst.d.ts +11 -2
- package/dist/types/components/charts/ChartTimeline/ChartTimeline.d.ts +137 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimelineTable.d.ts +25 -0
- package/dist/types/components/charts/ChartTimeline/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTimeline/timelineLayout.d.ts +70 -0
- package/dist/types/components/charts/ChartTimeline/timelineTime.d.ts +16 -0
- package/dist/types/components/charts/ChartTimeline/timelineTooltip.d.ts +45 -0
- package/dist/types/components/charts/ChartTooltip/ChartTooltip.d.ts +2 -0
- package/dist/types/components/charts/ChartTreemap/ChartTreemap.d.ts +11 -2
- package/dist/types/components/charts/ChartWaterfall/ChartWaterfall.d.ts +8 -3
- package/dist/types/components/charts/core/CartesianFrame.d.ts +6 -1
- package/dist/types/components/charts/core/ChartFrame.d.ts +7 -1
- package/dist/types/components/charts/core/ChartLegend.d.ts +3 -1
- package/dist/types/components/charts/core/PointBands.d.ts +22 -0
- package/dist/types/components/charts/core/cartesianLayout.d.ts +10 -4
- package/dist/types/components/charts/core/hoverPath.d.ts +10 -0
- package/dist/types/components/charts/core/index.d.ts +13 -3
- package/dist/types/components/charts/core/pointLabels.d.ts +13 -0
- package/dist/types/components/charts/core/tooltips.d.ts +49 -0
- package/dist/types/components/charts/core/useCartesianLayout.d.ts +20 -0
- package/dist/types/components/charts/core/useSeriesToggle.d.ts +15 -1
- package/dist/types/components/data-display/Accordion/Accordion.d.ts +6 -1
- package/dist/types/components/data-display/Accordion/index.d.ts +1 -1
- package/dist/types/components/data-display/List/List.d.ts +1 -1
- package/dist/types/components/data-display/List/useListing.d.ts +7 -1
- package/dist/types/components/data-display/SortableList/SortableList.d.ts +22 -0
- package/dist/types/components/data-display/SortableList/index.d.ts +2 -0
- package/dist/types/components/data-display/Tag/Tag.d.ts +13 -0
- package/dist/types/components/data-display/Tag/index.d.ts +2 -0
- package/dist/types/components/data-display/Timeline/Timeline.d.ts +15 -0
- package/dist/types/components/data-display/Timeline/index.d.ts +2 -0
- package/dist/types/components/feedback/Skeleton/Skeleton.d.ts +13 -0
- package/dist/types/components/feedback/Skeleton/index.d.ts +2 -0
- package/dist/types/components/feedback/Toast/ToastRegion.d.ts +2 -0
- package/dist/types/components/feedback/Toast/index.d.ts +3 -0
- package/dist/types/components/feedback/Toast/toastStore.d.ts +24 -0
- package/dist/types/components/forms/CheckboxGroup/CheckboxGroup.d.ts +28 -0
- package/dist/types/components/forms/CheckboxGroup/index.d.ts +2 -0
- package/dist/types/components/forms/ColorPicker/ColorPicker.d.ts +26 -0
- package/dist/types/components/forms/ColorPicker/index.d.ts +2 -0
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
- package/dist/types/components/forms/Field/Field.d.ts +6 -2
- package/dist/types/components/forms/Field/index.d.ts +1 -1
- package/dist/types/components/forms/FileUpload/FileUpload.d.ts +37 -0
- package/dist/types/components/forms/FileUpload/index.d.ts +2 -0
- package/dist/types/components/forms/InputText/InputText.d.ts +4 -2
- package/dist/types/components/forms/SegmentedControl/SegmentedControl.d.ts +23 -0
- package/dist/types/components/forms/SegmentedControl/index.d.ts +2 -0
- package/dist/types/components/icons/icons.d.ts +29 -0
- package/dist/types/components/icons/index.d.ts +1 -1
- package/dist/types/components/navigation/SkipLink/SkipLink.d.ts +7 -0
- package/dist/types/components/navigation/SkipLink/index.d.ts +2 -0
- package/dist/types/components/navigation/Steps/Steps.d.ts +16 -0
- package/dist/types/components/navigation/Steps/index.d.ts +2 -0
- package/dist/types/components/navigation/Tabs/Tabs.d.ts +5 -1
- package/dist/types/components/navigation/TabsNav/TabsNav.d.ts +20 -0
- package/dist/types/components/navigation/TabsNav/index.d.ts +2 -0
- package/dist/types/components/overlays/Dialog/Dialog.d.ts +21 -9
- package/dist/types/components/overlays/Dialog/DialogFrame.d.ts +13 -0
- package/dist/types/components/overlays/Drawer/Drawer.d.ts +9 -0
- package/dist/types/components/overlays/Drawer/index.d.ts +2 -0
- package/dist/types/components/overlays/Menu/Menu.d.ts +16 -2
- package/dist/types/components/overlays/Menu/index.d.ts +1 -1
- package/dist/types/index.d.ts +43 -7
- package/dist/types/utils/formatters/formatarDuracao.d.ts +5 -0
- package/dist/types/utils/formatters/formatarNumero.d.ts +6 -1
- package/dist/types/utils/formatters/formatarTamanhoDeArquivo.d.ts +7 -0
- package/dist/types/utils/formatters/index.d.ts +4 -1
- package/dist/utils/formatters/formatarDuracao.cjs +2 -0
- package/dist/utils/formatters/formatarDuracao.cjs.map +1 -0
- package/dist/utils/formatters/formatarDuracao.js +10 -0
- package/dist/utils/formatters/formatarDuracao.js.map +1 -0
- package/dist/utils/formatters/formatarNumero.cjs +1 -1
- package/dist/utils/formatters/formatarNumero.cjs.map +1 -1
- package/dist/utils/formatters/formatarNumero.js +42 -17
- package/dist/utils/formatters/formatarNumero.js.map +1 -1
- package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs +2 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs.map +1 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.js +17 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,166 +1,219 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { useChartMetrics as
|
|
5
|
-
import { useSeriesToggle as
|
|
6
|
-
import { resolveSeriesColors as
|
|
7
|
-
import { mergeDomains as
|
|
8
|
-
import { valueLabelsFor as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as Y, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as d, useState as go } from "react";
|
|
3
|
+
import i from "./ChartLine.module.css.js";
|
|
4
|
+
import { useChartMetrics as vo } from "../core/useChartMetrics.js";
|
|
5
|
+
import { useSeriesToggle as xo, seriesInScale as yo } from "../core/useSeriesToggle.js";
|
|
6
|
+
import { resolveSeriesColors as Ho } from "../palette/seriesColor.js";
|
|
7
|
+
import { mergeDomains as Co, domainOf as Lo, pointScale as Po, linearScale as q, ticksFor as ko } from "../scales/scales.js";
|
|
8
|
+
import { valueLabelsFor as Fo, markShown as G, chartHeight as No } from "../core/cartesianLayout.js";
|
|
9
|
+
import { useCartesianLayout as $o } from "../core/useCartesianLayout.js";
|
|
10
|
+
import { valueLabelRoom as Ro } from "../core/spacing.js";
|
|
11
|
+
import { useHoveredBand as Ao } from "../core/useHoveredBand.js";
|
|
12
|
+
import { useTweenedNumbers as Oo } from "../core/useTweenedNumbers.js";
|
|
13
|
+
import { nearestSeriesAt as Do, PointCursor as Mo, PointBands as So } from "../core/PointBands.js";
|
|
14
|
+
import { formatarNumero as To } from "../../../utils/formatters/formatarNumero.js";
|
|
15
|
+
import { CartesianFrame as jo } from "../core/CartesianFrame.js";
|
|
16
|
+
import { linePath as Bo } from "../core/shapes.js";
|
|
17
|
+
import { pointLabelPlacement as Eo } from "../core/pointLabels.js";
|
|
18
|
+
import { categoryTooltip as wo } from "../core/tooltips.js";
|
|
19
|
+
function zo(m, a) {
|
|
20
|
+
return m[a] !== null && !m[a - 1] && !m[a + 1];
|
|
16
21
|
}
|
|
17
|
-
function
|
|
18
|
-
accent:
|
|
22
|
+
function rt({
|
|
23
|
+
accent: m,
|
|
19
24
|
categories: a,
|
|
20
|
-
curve:
|
|
21
|
-
defaultHiddenSeries:
|
|
22
|
-
emptyMessage:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
curve: J = "smooth",
|
|
26
|
+
defaultHiddenSeries: K,
|
|
27
|
+
emptyMessage: Q = "Sem dados no período",
|
|
28
|
+
formatTooltipValue: U,
|
|
29
|
+
formatValue: h = To,
|
|
30
|
+
height: W = 260,
|
|
31
|
+
includeZero: P = !0,
|
|
32
|
+
hiddenSeries: X,
|
|
33
|
+
labelAngle: _ = "auto",
|
|
34
|
+
legend: Z = "bottom",
|
|
35
|
+
legendAlign: oo,
|
|
36
|
+
onHiddenSeriesChange: to,
|
|
37
|
+
onHoverCategory: k,
|
|
31
38
|
series: e,
|
|
32
|
-
showDataLabels:
|
|
33
|
-
showDots:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
showDataLabels: p = "hidden",
|
|
40
|
+
showDots: F = "onHover",
|
|
41
|
+
showTooltip: N = !0,
|
|
42
|
+
title: lo,
|
|
43
|
+
xAxis: $ = "visible",
|
|
44
|
+
yAxis: R = "visible",
|
|
45
|
+
yAxisRight: A = "hidden"
|
|
38
46
|
}) {
|
|
39
|
-
const { font:
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
const { font: f, height: ao, ref: eo, width: O } = vo(), { fillHeight: ro, value: H } = No(W, ao), { isHidden: c, isOutOfScale: D, toggle: no } = xo({
|
|
48
|
+
defaultHiddenSeries: K,
|
|
49
|
+
hiddenSeries: X,
|
|
50
|
+
labels: e.map((o) => o.label),
|
|
51
|
+
onHiddenSeriesChange: to
|
|
52
|
+
}), b = d(() => Ho(e, { accent: m }), [m, e]), C = d(
|
|
53
|
+
() => Co(
|
|
54
|
+
yo(e, D).map(
|
|
55
|
+
(o) => Lo(
|
|
56
|
+
o.values.filter((t) => t !== null),
|
|
57
|
+
{ includeZero: P }
|
|
58
|
+
)
|
|
59
|
+
)
|
|
42
60
|
),
|
|
43
|
-
[
|
|
44
|
-
),
|
|
61
|
+
[P, D, e]
|
|
62
|
+
), M = Fo(C, H, h), { axisReveal: io, margins: mo, plot: r, rotation: so } = $o({
|
|
45
63
|
bottomLabels: a,
|
|
46
|
-
font:
|
|
47
|
-
height:
|
|
48
|
-
labelAngle:
|
|
49
|
-
leftLabels:
|
|
50
|
-
rightLabels:
|
|
51
|
-
topRoom:
|
|
52
|
-
width:
|
|
53
|
-
xAxis:
|
|
54
|
-
yAxis:
|
|
55
|
-
yAxisRight:
|
|
56
|
-
}),
|
|
57
|
-
() =>
|
|
58
|
-
[a,
|
|
59
|
-
),
|
|
60
|
-
() =>
|
|
61
|
-
[
|
|
62
|
-
), [
|
|
63
|
-
() =>
|
|
64
|
-
[
|
|
65
|
-
),
|
|
66
|
-
(
|
|
67
|
-
const
|
|
68
|
-
return
|
|
64
|
+
font: f,
|
|
65
|
+
height: H,
|
|
66
|
+
labelAngle: _,
|
|
67
|
+
leftLabels: M,
|
|
68
|
+
rightLabels: M,
|
|
69
|
+
topRoom: p === "hidden" ? 0 : Ro(f),
|
|
70
|
+
width: O,
|
|
71
|
+
xAxis: $,
|
|
72
|
+
yAxis: R,
|
|
73
|
+
yAxisRight: A
|
|
74
|
+
}), S = d(
|
|
75
|
+
() => Po({ domain: a, padding: 0, range: [0, r.width] }),
|
|
76
|
+
[a, r.width]
|
|
77
|
+
), { hover: uo, hovered: g } = Ao(k), [ho, co] = go(null), L = N || k !== void 0 || F === "onHover" || p === "onHover", T = d(
|
|
78
|
+
() => q({ domain: C, range: [r.height, 0] }),
|
|
79
|
+
[C, r.height]
|
|
80
|
+
), [j, B] = Oo(T.domain()), v = d(
|
|
81
|
+
() => q({ domain: { min: j, max: B }, nice: !1, range: [r.height, 0] }),
|
|
82
|
+
[B, j, r.height]
|
|
83
|
+
), E = ko(T, r.height), s = e.map(
|
|
84
|
+
(o) => a.map((t, x) => {
|
|
85
|
+
const l = o.values[x];
|
|
86
|
+
return l == null || !Number.isFinite(l) ? null : { x: S(t) ?? 0, y: v(l) };
|
|
69
87
|
})
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
), w = Do(
|
|
89
|
+
s,
|
|
90
|
+
g,
|
|
91
|
+
ho,
|
|
92
|
+
(o) => c(e[o].label)
|
|
93
|
+
), z = a.map((o) => ({
|
|
94
|
+
label: o,
|
|
95
|
+
position: S(o) ?? 0
|
|
96
|
+
})), I = z.map((o) => o.position), V = E.map((o) => ({
|
|
97
|
+
label: h(o),
|
|
98
|
+
position: v(o)
|
|
76
99
|
}));
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
|
|
100
|
+
return /* @__PURE__ */ Y(
|
|
101
|
+
jo,
|
|
79
102
|
{
|
|
80
|
-
|
|
103
|
+
axisReveal: io,
|
|
104
|
+
containerRef: eo,
|
|
81
105
|
empty: e.length === 0 || a.length === 0,
|
|
82
|
-
emptyMessage:
|
|
83
|
-
fillHeight:
|
|
106
|
+
emptyMessage: Q,
|
|
107
|
+
fillHeight: ro,
|
|
84
108
|
grid: [
|
|
85
109
|
{
|
|
86
|
-
baseline:
|
|
87
|
-
lines:
|
|
110
|
+
baseline: v(0),
|
|
111
|
+
lines: E.map((o) => v(o)),
|
|
88
112
|
orientation: "horizontal"
|
|
89
113
|
}
|
|
90
114
|
],
|
|
91
|
-
height:
|
|
92
|
-
legend: e.map((
|
|
93
|
-
color:
|
|
94
|
-
hidden: c(
|
|
95
|
-
label:
|
|
115
|
+
height: H,
|
|
116
|
+
legend: e.map((o, t) => ({
|
|
117
|
+
color: b[t],
|
|
118
|
+
hidden: c(o.label),
|
|
119
|
+
label: o.label
|
|
96
120
|
})),
|
|
97
|
-
legendAlign:
|
|
98
|
-
legendPosition:
|
|
99
|
-
margins:
|
|
100
|
-
onToggleSeries:
|
|
101
|
-
plot:
|
|
102
|
-
title:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const T = `${l.label}, ${a[r]}: ${u(l.values[r] ?? 0)}`;
|
|
128
|
-
return /* @__PURE__ */ s(
|
|
129
|
-
"circle",
|
|
130
|
-
{
|
|
131
|
-
"aria-label": T,
|
|
132
|
-
className: I || pl(f[o], r) ? m.dotVisible : m.dot,
|
|
133
|
-
cx: t.x,
|
|
134
|
-
cy: t.y,
|
|
135
|
-
fill: g[o],
|
|
136
|
-
r: 4,
|
|
137
|
-
children: /* @__PURE__ */ s("title", { children: T })
|
|
138
|
-
},
|
|
139
|
-
r
|
|
140
|
-
);
|
|
141
|
-
}),
|
|
142
|
-
y && f[o].map(
|
|
143
|
-
(t, r) => t === null ? null : /* @__PURE__ */ s(
|
|
144
|
-
"text",
|
|
121
|
+
legendAlign: oo,
|
|
122
|
+
legendPosition: Z,
|
|
123
|
+
margins: mo,
|
|
124
|
+
onToggleSeries: no,
|
|
125
|
+
plot: r,
|
|
126
|
+
title: lo,
|
|
127
|
+
tooltip: N ? wo({
|
|
128
|
+
categories: a,
|
|
129
|
+
colors: b,
|
|
130
|
+
format: U ?? h,
|
|
131
|
+
index: g,
|
|
132
|
+
isHidden: c,
|
|
133
|
+
series: e
|
|
134
|
+
}) : void 0,
|
|
135
|
+
width: O,
|
|
136
|
+
xAxis: { labelRotation: so, ticks: z, visibility: $ },
|
|
137
|
+
yAxis: { hideLine: !0, ticks: V, visibility: R },
|
|
138
|
+
yAxisRight: { hideLine: !0, ticks: V, visibility: A },
|
|
139
|
+
children: [
|
|
140
|
+
L && g !== null && /* @__PURE__ */ u(Mo, { plot: r, position: I[g] }),
|
|
141
|
+
e.map((o, t) => {
|
|
142
|
+
const x = c(o.label);
|
|
143
|
+
return /* @__PURE__ */ Y(
|
|
144
|
+
"g",
|
|
145
|
+
{
|
|
146
|
+
"aria-hidden": x || void 0,
|
|
147
|
+
className: `${i.series} ${x ? i.seriesOff : ""}`,
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ u(
|
|
150
|
+
"path",
|
|
145
151
|
{
|
|
146
|
-
className:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
className: i.line,
|
|
153
|
+
d: Bo(s[t], J),
|
|
154
|
+
fill: "none",
|
|
155
|
+
stroke: b[t]
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
s[t].map((l, n) => {
|
|
159
|
+
if (l === null)
|
|
160
|
+
return null;
|
|
161
|
+
const y = `${o.label}, ${a[n]}: ${h(o.values[n] ?? 0)}`;
|
|
162
|
+
return /* @__PURE__ */ u(
|
|
163
|
+
"circle",
|
|
164
|
+
{
|
|
165
|
+
"aria-label": y,
|
|
166
|
+
className: G(F, t === w) || zo(s[t], n) ? i.dotVisible : i.dot,
|
|
167
|
+
cx: l.x,
|
|
168
|
+
cy: l.y,
|
|
169
|
+
stroke: b[t],
|
|
170
|
+
r: 4,
|
|
171
|
+
children: !L && /* @__PURE__ */ u("title", { children: y })
|
|
172
|
+
},
|
|
173
|
+
n
|
|
174
|
+
);
|
|
175
|
+
}),
|
|
176
|
+
p !== "hidden" && s[t].map((l, n) => {
|
|
177
|
+
if (l === null)
|
|
178
|
+
return null;
|
|
179
|
+
const { below: y, dx: po, textAnchor: fo } = Eo(
|
|
180
|
+
s,
|
|
181
|
+
t,
|
|
182
|
+
n,
|
|
183
|
+
f.lineHeight,
|
|
184
|
+
(bo) => c(e[bo].label)
|
|
185
|
+
);
|
|
186
|
+
return /* @__PURE__ */ u(
|
|
187
|
+
"text",
|
|
188
|
+
{
|
|
189
|
+
className: `${i.valueLabel} ${G(p, t === w) ? "" : i.valueLabelHidden}`,
|
|
190
|
+
textAnchor: fo,
|
|
191
|
+
x: l.x + po,
|
|
192
|
+
y: y ? l.y + f.lineHeight + 2 : l.y - 10,
|
|
193
|
+
children: h(o.values[n] ?? 0)
|
|
194
|
+
},
|
|
195
|
+
n
|
|
196
|
+
);
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
t
|
|
201
|
+
);
|
|
202
|
+
}),
|
|
203
|
+
L && /* @__PURE__ */ u(
|
|
204
|
+
So,
|
|
205
|
+
{
|
|
206
|
+
onHover: uo,
|
|
207
|
+
onPointerY: co,
|
|
208
|
+
plot: r,
|
|
209
|
+
positions: I
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
160
213
|
}
|
|
161
214
|
);
|
|
162
215
|
}
|
|
163
216
|
export {
|
|
164
|
-
|
|
217
|
+
rt as ChartLine
|
|
165
218
|
};
|
|
166
219
|
//# sourceMappingURL=ChartLine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLine.js","sources":["../../../../src/components/charts/ChartLine/ChartLine.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n CartesianFrame,\n cartesianLayout,\n chartHeight,\n linePath,\n useChartMetrics,\n useSeriesToggle,\n useTweenedNumbers,\n valueLabelRoom,\n valueLabelsFor,\n type AxisLabelAngle,\n type AxisTick,\n type AxisVisibility,\n type ChartCurve,\n type ChartHeight,\n type ChartLegendAlign,\n type ChartLegendPosition,\n type ChartPoint,\n} from '../core';\nimport { resolveSeriesColors, type SeriesAppearance } from '../palette';\nimport { domainOf, linearScale, mergeDomains, pointScale, ticksFor } from '../scales';\nimport { formatarNumero } from '../../../utils/formatters';\nimport styles from './ChartLine.module.css';\n/**\n * Ponto sem vizinho desenhado. A curva entre ele e o nada nao tem tracado, e o\n * marcador so no hover deixaria o dado invisivel — entao ele aparece sempre.\n */\nfunction isolado(pontos: readonly (ChartPoint | null)[], indice: number) {\n return pontos[indice] !== null && !pontos[indice - 1] && !pontos[indice + 1];\n}\n\n\nexport interface ChartLineSeries extends SeriesAppearance {\n label: string;\n values: readonly (number | null)[];\n}\n\nexport interface ChartLineProps {\n accent?: string;\n categories: readonly string[];\n curve?: ChartCurve;\n defaultHiddenSeries?: readonly string[];\n emptyMessage?: string;\n formatValue?: (value: number) => string;\n /**\n * Inclui o zero no dominio do eixo de valor. Ligado por padrao, porque marca\n * que nao parte do zero exagera a diferenca; para medidas que nao se comparam\n * a ele — um ano, uma temperatura — desligue; um ano pede tambem um formato sem separador de milhar em `formatValue`.\n */\n includeZero?: boolean;\n height?: ChartHeight;\n hiddenSeries?: readonly string[];\n labelAngle?: AxisLabelAngle;\n legend?: ChartLegendPosition;\n legendAlign?: ChartLegendAlign;\n onHiddenSeriesChange?: (hidden: readonly string[]) => void;\n series: readonly ChartLineSeries[];\n showDataLabels?: boolean;\n showDots?: boolean;\n title: string;\n xAxis?: AxisVisibility;\n yAxis?: AxisVisibility;\n yAxisRight?: AxisVisibility;\n}\n\nexport function ChartLine({\n accent,\n categories,\n curve = 'smooth',\n defaultHiddenSeries,\n emptyMessage = 'Sem dados no período',\n formatValue = formatarNumero,\n height = 260,\n includeZero = true,\n hiddenSeries,\n labelAngle = 'auto',\n legend = 'bottom',\n legendAlign,\n onHiddenSeriesChange,\n series,\n showDataLabels = false,\n showDots = false,\n title,\n xAxis = 'visible',\n yAxis = 'visible',\n yAxisRight = 'hidden',\n}: ChartLineProps) {\n const { font, height: alturaMedida, ref, width } = useChartMetrics();\n const { fillHeight, value: alturaDoDesenho } = chartHeight(height, alturaMedida);\n const { isHidden, toggle } = useSeriesToggle({ defaultHiddenSeries, hiddenSeries, onHiddenSeriesChange });\n\n // A cor sai da lista inteira, e nao das visiveis: desligar uma serie nao pode\n // repintar as demais.\n const cores = useMemo(() => resolveSeriesColors(series, { accent }), [accent, series]);\n\n const dominio = useMemo(\n () =>\n mergeDomains(\n series\n .filter((serie) => !isHidden(serie.label))\n .map((serie) => domainOf(serie.values.filter((valor) => valor !== null), { includeZero })),\n ),\n [includeZero, isHidden, series],\n );\n\n const rotulosDeValor = valueLabelsFor(dominio, alturaDoDesenho, formatValue);\n\n const { margins, plot, rotation } = cartesianLayout({\n bottomLabels: categories,\n font,\n height: alturaDoDesenho,\n labelAngle,\n leftLabels: rotulosDeValor,\n rightLabels: rotulosDeValor,\n topRoom: showDataLabels ? valueLabelRoom(font) : 0,\n width,\n xAxis,\n yAxis,\n yAxisRight,\n });\n\n const escalaCategorias = useMemo(\n () => pointScale({ domain: categories, padding: 0, range: [0, plot.width] }),\n [categories, plot.width],\n );\n\n // A escala alvo fixa as marcas; a animada posiciona o desenho. Sem separar as\n // duas, as marcas exibiriam valores quebrados durante a transicao.\n const escalaAlvo = useMemo(\n () => linearScale({ domain: dominio, range: [plot.height, 0] }),\n [dominio, plot.height],\n );\n\n const [minimo, maximo] = useTweenedNumbers(escalaAlvo.domain());\n\n const escalaValores = useMemo(\n () => linearScale({ domain: { min: minimo, max: maximo }, nice: false, range: [plot.height, 0] }),\n [maximo, minimo, plot.height],\n );\n\n const marcasDeValor = ticksFor(escalaAlvo, plot.height);\n\n const pontosPorSerie = series.map((serie) =>\n categories.map<ChartPoint | null>((categoria, indice) => {\n const valor = serie.values[indice];\n\n if (valor === null || valor === undefined || !Number.isFinite(valor)) {\n return null;\n }\n\n return { x: escalaCategorias(categoria) ?? 0, y: escalaValores(valor) };\n }),\n );\n\n const marcasCategoria: AxisTick[] = categories.map((categoria) => ({\n label: categoria,\n position: escalaCategorias(categoria) ?? 0,\n }));\n\n const marcasValor: AxisTick[] = marcasDeValor.map((valor) => ({\n label: formatValue(valor),\n position: escalaValores(valor),\n }));\n\n return (\n <CartesianFrame\n containerRef={ref}\n empty={series.length === 0 || categories.length === 0}\n emptyMessage={emptyMessage}\n fillHeight={fillHeight}\n grid={[\n {\n baseline: escalaValores(0),\n lines: marcasDeValor.map((valor) => escalaValores(valor)),\n orientation: 'horizontal',\n },\n ]}\n height={alturaDoDesenho}\n legend={series.map((serie, indice) => ({\n color: cores[indice],\n hidden: isHidden(serie.label),\n label: serie.label,\n }))}\n legendAlign={legendAlign}\n legendPosition={legend}\n margins={margins}\n onToggleSeries={toggle}\n plot={plot}\n title={title}\n width={width}\n xAxis={{ labelRotation: rotation, ticks: marcasCategoria, visibility: xAxis }}\n yAxis={{ hideLine: true, ticks: marcasValor, visibility: yAxis }}\n yAxisRight={{ hideLine: true, ticks: marcasValor, visibility: yAxisRight }}\n >\n {series.map((serie, indiceSerie) => {\n const oculta = isHidden(serie.label);\n\n return (\n <g\n aria-hidden={oculta || undefined}\n className={`${styles.series} ${oculta ? styles.seriesOff : ''}`}\n key={indiceSerie}\n >\n <path\n className={styles.line}\n d={linePath(pontosPorSerie[indiceSerie], curve)}\n fill=\"none\"\n stroke={cores[indiceSerie]}\n />\n\n {pontosPorSerie[indiceSerie].map((ponto, indice) => {\n if (ponto === null) {\n return null;\n }\n\n const descricao = `${serie.label}, ${categories[indice]}: ${formatValue(serie.values[indice] ?? 0)}`;\n\n return (\n <circle\n aria-label={descricao}\n className={\n showDots || isolado(pontosPorSerie[indiceSerie], indice)\n ? styles.dotVisible\n : styles.dot\n }\n cx={ponto.x}\n cy={ponto.y}\n fill={cores[indiceSerie]}\n key={indice}\n r={4}\n >\n <title>{descricao}</title>\n </circle>\n );\n })}\n\n {showDataLabels &&\n pontosPorSerie[indiceSerie].map((ponto, indice) =>\n ponto === null ? null : (\n <text\n className={styles.valueLabel}\n key={indice}\n textAnchor=\"middle\"\n x={ponto.x}\n y={ponto.y - 10}\n >\n {formatValue(serie.values[indice] ?? 0)}\n </text>\n ),\n )}\n </g>\n );\n })}\n </CartesianFrame>\n );\n}\n"],"names":["isolado","pontos","indice","ChartLine","accent","categories","curve","defaultHiddenSeries","emptyMessage","formatValue","formatarNumero","height","includeZero","hiddenSeries","labelAngle","legend","legendAlign","onHiddenSeriesChange","series","showDataLabels","showDots","title","xAxis","yAxis","yAxisRight","font","alturaMedida","ref","width","useChartMetrics","fillHeight","alturaDoDesenho","chartHeight","isHidden","toggle","useSeriesToggle","cores","useMemo","resolveSeriesColors","dominio","mergeDomains","serie","domainOf","valor","rotulosDeValor","valueLabelsFor","margins","plot","rotation","cartesianLayout","valueLabelRoom","escalaCategorias","pointScale","escalaAlvo","linearScale","minimo","maximo","useTweenedNumbers","escalaValores","marcasDeValor","ticksFor","pontosPorSerie","categoria","marcasCategoria","marcasValor","jsx","CartesianFrame","indiceSerie","oculta","jsxs","styles","linePath","ponto","descricao"],"mappings":";;;;;;;;;;;;;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AA/D,EAAYgC,EAAM,OAAOvC,CAAM,KAAK,CAAC;AAAA,kBAAA;AAAA,kBALjCA;AAAA,gBAAA;AAAA,cAMP;AAAA,YAEJ;AAAA,UAAA;AAAA,UAhDGiE;AAAA,QAAA;AAAA,MAmDX,CAAC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
1
|
+
{"version":3,"file":"ChartLine.js","sources":["../../../../src/components/charts/ChartLine/ChartLine.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport {\n CartesianFrame,\n categoryTooltip,\n PointBands,\n PointCursor,\n seriesInScale,\n useCartesianLayout,\n chartHeight,\n linePath,\n markShown,\n nearestSeriesAt,\n pointLabelPlacement,\n useChartMetrics,\n useHoveredBand,\n useSeriesToggle,\n useTweenedNumbers,\n valueLabelRoom,\n valueLabelsFor,\n type AxisLabelAngle,\n type AxisTick,\n type AxisVisibility,\n type ChartCurve,\n type ChartHeight,\n type ChartLegendAlign,\n type ChartLegendPosition,\n type ChartPoint,\n type MarkVisibility,\n} from '../core';\nimport { resolveSeriesColors, type SeriesAppearance } from '../palette';\nimport { domainOf, linearScale, mergeDomains, pointScale, ticksFor } from '../scales';\nimport { formatarNumero } from '../../../utils/formatters';\nimport styles from './ChartLine.module.css';\n/**\n * Ponto sem vizinho desenhado. A curva entre ele e o nada nao tem tracado, e o\n * marcador so no hover deixaria o dado invisivel — entao ele aparece sempre.\n */\nfunction isolado(pontos: readonly (ChartPoint | null)[], indice: number) {\n return pontos[indice] !== null && !pontos[indice - 1] && !pontos[indice + 1];\n}\n\n\nexport interface ChartLineSeries extends SeriesAppearance {\n label: string;\n values: readonly (number | null)[];\n}\n\nexport interface ChartLineProps {\n accent?: string;\n categories: readonly string[];\n curve?: ChartCurve;\n defaultHiddenSeries?: readonly string[];\n emptyMessage?: string;\n /** Formato dos valores no balao. Sem ele, vale o `formatValue`: o eixo pode sair compacto e o balao, exato. */\n formatTooltipValue?: (value: number) => string;\n formatValue?: (value: number) => string;\n /**\n * Inclui o zero no dominio do eixo de valor. Ligado por padrao, porque marca\n * que nao parte do zero exagera a diferenca; para medidas que nao se comparam\n * a ele — um ano, uma temperatura — desligue; um ano pede tambem um formato sem separador de milhar em `formatValue`.\n */\n includeZero?: boolean;\n height?: ChartHeight;\n hiddenSeries?: readonly string[];\n labelAngle?: AxisLabelAngle;\n legend?: ChartLegendPosition;\n legendAlign?: ChartLegendAlign;\n onHiddenSeriesChange?: (hidden: readonly string[]) => void;\n /** Indice da categoria mais proxima do ponteiro, ou `null` ao sair. */\n onHoverCategory?: (index: number | null) => void;\n series: readonly ChartLineSeries[];\n /** Valor acima de cada ponto: sempre, nunca, ou so os da serie mais proxima do ponteiro. */\n showDataLabels?: MarkVisibility;\n /** Pontos de cada valor: sempre, nunca, ou so os da serie mais proxima do ponteiro. */\n showDots?: MarkVisibility;\n /**\n * Balao com as series da categoria mais proxima do ponteiro. Desligue para montar o proprio\n * `ChartTooltip` pela costura; sem balao nem costura, o ponto volta a ter o `<title>`.\n */\n showTooltip?: boolean;\n title: string;\n xAxis?: AxisVisibility;\n yAxis?: AxisVisibility;\n yAxisRight?: AxisVisibility;\n}\n\nexport function ChartLine({\n accent,\n categories,\n curve = 'smooth',\n defaultHiddenSeries,\n emptyMessage = 'Sem dados no período',\n formatTooltipValue,\n formatValue = formatarNumero,\n height = 260,\n includeZero = true,\n hiddenSeries,\n labelAngle = 'auto',\n legend = 'bottom',\n legendAlign,\n onHiddenSeriesChange,\n onHoverCategory,\n series,\n showDataLabels = 'hidden',\n showDots = 'onHover',\n showTooltip = true,\n title,\n xAxis = 'visible',\n yAxis = 'visible',\n yAxisRight = 'hidden',\n}: ChartLineProps) {\n const { font, height: alturaMedida, ref, width } = useChartMetrics();\n const { fillHeight, value: alturaDoDesenho } = chartHeight(height, alturaMedida);\n const { isHidden, isOutOfScale, toggle } = useSeriesToggle({\n defaultHiddenSeries,\n hiddenSeries,\n labels: series.map((serie) => serie.label),\n onHiddenSeriesChange,\n });\n\n // A cor sai da lista inteira, e nao das visiveis: desligar uma serie nao pode\n // repintar as demais.\n const cores = useMemo(() => resolveSeriesColors(series, { accent }), [accent, series]);\n\n const dominio = useMemo(\n () =>\n mergeDomains(\n seriesInScale(series, isOutOfScale).map((serie) =>\n domainOf(\n serie.values.filter((valor) => valor !== null),\n { includeZero },\n ),\n ),\n ),\n [includeZero, isOutOfScale, series],\n );\n\n const rotulosDeValor = valueLabelsFor(dominio, alturaDoDesenho, formatValue);\n\n const { axisReveal, margins, plot, rotation } = useCartesianLayout({\n bottomLabels: categories,\n font,\n height: alturaDoDesenho,\n labelAngle,\n leftLabels: rotulosDeValor,\n rightLabels: rotulosDeValor,\n topRoom: showDataLabels === 'hidden' ? 0 : valueLabelRoom(font),\n width,\n xAxis,\n yAxis,\n yAxisRight,\n });\n\n const escalaCategorias = useMemo(\n () => pointScale({ domain: categories, padding: 0, range: [0, plot.width] }),\n [categories, plot.width],\n );\n\n const { hover: focarCategoria, hovered: categoriaEmFoco } = useHoveredBand(onHoverCategory);\n const [alturaDoPonteiro, setAlturaDoPonteiro] = useState<number | null>(null);\n const comFaixas =\n showTooltip || onHoverCategory !== undefined || showDots === 'onHover' || showDataLabels === 'onHover';\n\n // A escala alvo fixa as marcas; a animada posiciona o desenho. Sem separar as\n // duas, as marcas exibiriam valores quebrados durante a transicao.\n const escalaAlvo = useMemo(\n () => linearScale({ domain: dominio, range: [plot.height, 0] }),\n [dominio, plot.height],\n );\n\n const [minimo, maximo] = useTweenedNumbers(escalaAlvo.domain());\n\n const escalaValores = useMemo(\n () => linearScale({ domain: { min: minimo, max: maximo }, nice: false, range: [plot.height, 0] }),\n [maximo, minimo, plot.height],\n );\n\n const marcasDeValor = ticksFor(escalaAlvo, plot.height);\n\n const pontosPorSerie = series.map((serie) =>\n categories.map<ChartPoint | null>((categoria, indice) => {\n const valor = serie.values[indice];\n\n if (valor === null || valor === undefined || !Number.isFinite(valor)) {\n return null;\n }\n\n return { x: escalaCategorias(categoria) ?? 0, y: escalaValores(valor) };\n }),\n );\n\n const serieEmFoco = nearestSeriesAt(pontosPorSerie, categoriaEmFoco, alturaDoPonteiro, (indice) =>\n isHidden(series[indice].label),\n );\n\n const marcasCategoria: AxisTick[] = categories.map((categoria) => ({\n label: categoria,\n position: escalaCategorias(categoria) ?? 0,\n }));\n const posicoesCategoria = marcasCategoria.map((marca) => marca.position);\n\n const marcasValor: AxisTick[] = marcasDeValor.map((valor) => ({\n label: formatValue(valor),\n position: escalaValores(valor),\n }));\n\n return (\n <CartesianFrame\n axisReveal={axisReveal}\n containerRef={ref}\n empty={series.length === 0 || categories.length === 0}\n emptyMessage={emptyMessage}\n fillHeight={fillHeight}\n grid={[\n {\n baseline: escalaValores(0),\n lines: marcasDeValor.map((valor) => escalaValores(valor)),\n orientation: 'horizontal',\n },\n ]}\n height={alturaDoDesenho}\n legend={series.map((serie, indice) => ({\n color: cores[indice],\n hidden: isHidden(serie.label),\n label: serie.label,\n }))}\n legendAlign={legendAlign}\n legendPosition={legend}\n margins={margins}\n onToggleSeries={toggle}\n plot={plot}\n title={title}\n tooltip={\n showTooltip\n ? categoryTooltip({\n categories,\n colors: cores,\n format: formatTooltipValue ?? formatValue,\n index: categoriaEmFoco,\n isHidden,\n series,\n })\n : undefined\n }\n width={width}\n xAxis={{ labelRotation: rotation, ticks: marcasCategoria, visibility: xAxis }}\n yAxis={{ hideLine: true, ticks: marcasValor, visibility: yAxis }}\n yAxisRight={{ hideLine: true, ticks: marcasValor, visibility: yAxisRight }}\n >\n {comFaixas && categoriaEmFoco !== null && (\n <PointCursor plot={plot} position={posicoesCategoria[categoriaEmFoco]} />\n )}\n\n {series.map((serie, indiceSerie) => {\n const oculta = isHidden(serie.label);\n\n return (\n <g\n aria-hidden={oculta || undefined}\n className={`${styles.series} ${oculta ? styles.seriesOff : ''}`}\n key={indiceSerie}\n >\n <path\n className={styles.line}\n d={linePath(pontosPorSerie[indiceSerie], curve)}\n fill=\"none\"\n stroke={cores[indiceSerie]}\n />\n\n {pontosPorSerie[indiceSerie].map((ponto, indice) => {\n if (ponto === null) {\n return null;\n }\n\n const descricao = `${serie.label}, ${categories[indice]}: ${formatValue(serie.values[indice] ?? 0)}`;\n\n return (\n <circle\n aria-label={descricao}\n className={\n markShown(showDots, indiceSerie === serieEmFoco) || isolado(pontosPorSerie[indiceSerie], indice)\n ? styles.dotVisible\n : styles.dot\n }\n cx={ponto.x}\n cy={ponto.y}\n stroke={cores[indiceSerie]}\n key={indice}\n r={4}\n >\n {!comFaixas && <title>{descricao}</title>}\n </circle>\n );\n })}\n\n {showDataLabels !== 'hidden' &&\n pontosPorSerie[indiceSerie].map((ponto, indice) => {\n if (ponto === null) {\n return null;\n }\n\n const { below, dx, textAnchor } = pointLabelPlacement(pontosPorSerie, indiceSerie, indice, font.lineHeight, (outra) =>\n isHidden(series[outra].label),\n );\n\n return (\n <text\n className={`${styles.valueLabel} ${markShown(showDataLabels, indiceSerie === serieEmFoco) ? '' : styles.valueLabelHidden}`}\n key={indice}\n textAnchor={textAnchor}\n x={ponto.x + dx}\n y={below ? ponto.y + font.lineHeight + 2 : ponto.y - 10}\n >\n {formatValue(serie.values[indice] ?? 0)}\n </text>\n );\n })}\n </g>\n );\n })}\n\n {comFaixas && (\n <PointBands\n onHover={focarCategoria}\n onPointerY={setAlturaDoPonteiro}\n plot={plot}\n positions={posicoesCategoria}\n />\n )}\n </CartesianFrame>\n );\n}\n"],"names":["isolado","pontos","indice","ChartLine","accent","categories","curve","defaultHiddenSeries","emptyMessage","formatTooltipValue","formatValue","formatarNumero","height","includeZero","hiddenSeries","labelAngle","legend","legendAlign","onHiddenSeriesChange","onHoverCategory","series","showDataLabels","showDots","showTooltip","title","xAxis","yAxis","yAxisRight","font","alturaMedida","ref","width","useChartMetrics","fillHeight","alturaDoDesenho","chartHeight","isHidden","isOutOfScale","toggle","useSeriesToggle","serie","cores","useMemo","resolveSeriesColors","dominio","mergeDomains","seriesInScale","domainOf","valor","rotulosDeValor","valueLabelsFor","axisReveal","margins","plot","rotation","useCartesianLayout","valueLabelRoom","escalaCategorias","pointScale","focarCategoria","categoriaEmFoco","useHoveredBand","alturaDoPonteiro","setAlturaDoPonteiro","useState","comFaixas","escalaAlvo","linearScale","minimo","maximo","useTweenedNumbers","escalaValores","marcasDeValor","ticksFor","pontosPorSerie","categoria","serieEmFoco","nearestSeriesAt","marcasCategoria","posicoesCategoria","marca","marcasValor","jsxs","CartesianFrame","categoryTooltip","jsx","PointCursor","indiceSerie","oculta","styles","linePath","ponto","descricao","markShown","below","dx","textAnchor","pointLabelPlacement","outra","PointBands"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,SAASA,GAAQC,GAAwCC,GAAgB;AACvE,SAAOD,EAAOC,CAAM,MAAM,QAAQ,CAACD,EAAOC,IAAS,CAAC,KAAK,CAACD,EAAOC,IAAS,CAAC;AAC7E;AA+CO,SAASC,GAAU;AAAA,EACxB,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,qBAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,oBAAAC;AAAA,EACA,aAAAC,IAAcC;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC,IAAS;AAAA,EACT,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,YAAAC,IAAa;AACf,GAAmB;AACjB,QAAM,EAAE,MAAAC,GAAM,QAAQC,IAAc,KAAAC,IAAK,OAAAC,EAAA,IAAUC,GAAA,GAC7C,EAAE,YAAAC,IAAY,OAAOC,MAAoBC,GAAYvB,GAAQiB,EAAY,GACzE,EAAE,UAAAO,GAAU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C,GAAA,IAAeC;AAAA,oBAAoBvB;AAAA,oBAAgBa;AAAA,oBAAarF;AAAA,oBAAQ0B,EAAK;AAAA,oBAAY,CAACsE,OAC3G9D,EAAShB,EAAO8E,EAAK,EAAE,KAAK;AAAA,kBAAA;AAG9B,yBACE,gBAAAb;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAW,GAAGI,EAAO,UAAU,IAAII,EAAUxE,GAAgBkE,MAAgBX,CAAW,IAAI,KAAKa,EAAO,gBAAgB;AAAA,sBAExH,YAAAO;AAAA,sBACA,GAAGL,EAAM,IAAII;AAAA,sBACb,GAAGD,IAAQH,EAAM,IAAI/D,EAAK,aAAa,IAAI+D,EAAM,IAAI;AAAA,sBAEpD,UAAAjF,EAAY8B,EAAM,OAAOtC,CAAM,KAAK,CAAC;AAAA,oBAAA;AAAA,oBALjCA;AAAA,kBAAA;AAAA,gBAQX,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,YAxDEqF;AAAA,UAAA;AAAA,QA2DX,CAAC;AAAA,QAEAtB,KACC,gBAAAoB;AAAA,UAACc;AAAA,UAAA;AAAA,YACC,SAASxC;AAAA,YACT,YAAYI;AAAA,YACZ,MAAAV;AAAA,YACA,WAAW0B;AAAA,UAAA;AAAA,QAAA;AAAA,MACb;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_line_6wl2h_1 _line_yf6oe_121",l="_dot_6wl2h_5 _dot_yf6oe_130",_="_dotVisible_6wl2h_9 _dotVisible_yf6oe_137",s="_valueLabel_6wl2h_13 _valueLabel_yf6oe_103",i="_series_6wl2h_17 _series_yf6oe_211",o="_seriesOff_6wl2h_21 _seriesOff_yf6oe_215",t="_valueLabelHidden_6wl2h_25 _valueLabelHidden_yf6oe_116",a={line:e,dot:l,dotVisible:_,valueLabel:s,series:i,seriesOff:o,valueLabelHidden:t};exports.default=a;exports.dot=l;exports.dotVisible=_;exports.line=e;exports.series=i;exports.seriesOff=o;exports.valueLabel=s;exports.valueLabelHidden=t;
|
|
2
2
|
//# sourceMappingURL=ChartLine.module.css.cjs.map
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
const _ = "
|
|
2
|
-
line:
|
|
3
|
-
dot:
|
|
4
|
-
dotVisible:
|
|
5
|
-
valueLabel:
|
|
6
|
-
series:
|
|
7
|
-
seriesOff:
|
|
1
|
+
const e = "_line_6wl2h_1 _line_yf6oe_121", _ = "_dot_6wl2h_5 _dot_yf6oe_130", l = "_dotVisible_6wl2h_9 _dotVisible_yf6oe_137", s = "_valueLabel_6wl2h_13 _valueLabel_yf6oe_103", i = "_series_6wl2h_17 _series_yf6oe_211", o = "_seriesOff_6wl2h_21 _seriesOff_yf6oe_215", t = "_valueLabelHidden_6wl2h_25 _valueLabelHidden_yf6oe_116", a = {
|
|
2
|
+
line: e,
|
|
3
|
+
dot: _,
|
|
4
|
+
dotVisible: l,
|
|
5
|
+
valueLabel: s,
|
|
6
|
+
series: i,
|
|
7
|
+
seriesOff: o,
|
|
8
|
+
valueLabelHidden: t
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
a as default,
|
|
12
|
+
_ as dot,
|
|
13
|
+
l as dotVisible,
|
|
14
|
+
e as line,
|
|
15
|
+
i as series,
|
|
16
|
+
o as seriesOff,
|
|
17
|
+
s as valueLabel,
|
|
18
|
+
t as valueLabelHidden
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=ChartLine.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLine.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartLine.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),Lt=require("d3-array"),gt=require("d3-geo"),Kt=require("d3-scale"),o=require("react"),Ut=require("./ChartMapLegend.cjs"),zt=require("./ChartMapTable.cjs"),se=require("./mapGeometry.cjs"),Ee=require("./mapLabels.cjs"),Gt=require("./mapScales.cjs"),n=require("./ChartMap.module.css.cjs"),vt=require("../core/useChartMetrics.cjs"),xt=require("../core/useSeriesToggle.cjs"),Mt=require("../../../utils/formatters/formatarNumero.cjs"),Vt=require("../palette/seriesColor.cjs"),Wt=require("../../actions/Button/Button.cjs"),Xt=require("../../feedback/EmptyState/EmptyState.cjs"),Jt=require("../../icons/icons.cjs"),Qt=require("../ChartTooltip/ChartTooltip.cjs"),Yt=require("../core/measureText.cjs"),Zt={type:"sequential"},Rt=640,De=160,ea=240,ta="repeating-linear-gradient(45deg, var(--pl-chart-no-data-hatch) 0 1.5px, var(--pl-chart-no-data) 1.5px 4px)",aa="var(--pl-color-surface-subtle)",sa=c=>Mt.formatarPercentual(c,{casasDecimais:1}),na=(c,l,i)=>`${c} ${c===1?l:i}`;function la(c){return c>1e3?.25:c>100?.5:.8}function ra(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}function ia({all:c,callouts:l,fixedHeight:i,font:x,labels:D,maxHeight:j,target:d,valueOf:M,width:y}){const C=g=>Yt.measureLabel(g,x),ge=x.size+1,p=g=>{const _=i?j:Math.round(Math.min(j,Math.max(De,se.naturalHeight(d,g)))),O=se.fitProjection(d,c,g,_);if(!D)return{height:_,plan:{callouts:[],inside:[]},projection:O};const ve=d.map(A=>{let G;return{bounds:se.projectedBounds(A,O),id:A.id,get parts(){return G??(G=se.projectedParts(A,O)),G},title:A.label,value:M(A)}});return{height:_,plan:Ee.planLabels(ve,{callouts:l,calloutStep:x.lineHeight,height:_,lineHeight:ge,measure:C,right:g}),projection:O}},B=p(y);if(B.plan.callouts.length===0)return B;const F=Math.ceil(Math.max(...B.plan.callouts.map(g=>Ee.calloutWidth(g,C)))+Ee.CALLOUT_GAP+4);return p(Math.max(y-F,y/2))}function oa({accent:c,colorScale:l=Zt,data:i=[],defaultHiddenSeries:x,emptyMessage:D="Sem dados",featureIdKey:j="id",featureLabelKey:d,featureNameKey:M="properties.name",focus:y,formatPercent:C=sa,formatTooltipValue:ge,formatValue:p=Mt.formatarNumero,geometry:B,height:F=440,hiddenClasses:g,hiddenSeries:_,legend:O="bottom",legendAlign:ve="center",markerMaxSize:A=20,markerMinSize:G=3,markers:yt,markerValueLabel:xe="Valor",noDataLabel:V="Sem dado",noDataStyle:Be="hatch",onHiddenClassesChange:Fe,onHiddenSeriesChange:$t,onHoverRegion:b,onMarkerClick:Me,onRegionClick:ye,regionLabels:$e="visible",selectedRegion:W,showDataLabels:ke="hidden",showShare:_e=!1,showTableToggle:kt=!0,showTooltip:jt=!0,smallRegionLabels:Le="callout",subtitle:Ke,title:ne,valueLabel:je="Valor"}){var ft;const Ue=o.useId(),ze=o.useId(),Ge=`${o.useId().replace(/[^\w-]/g,"")}-hatch`,be=vt.useChartMetrics(),L=vt.useChartMetrics(),Ve=o.useRef(null),X=xt.useSeriesToggle({defaultHiddenSeries:x,hiddenSeries:_,onHiddenSeriesChange:$t}),bt=o.useMemo(()=>g==null?void 0:g.map(String),[g]),Nt=xt.useSeriesToggle({hiddenSeries:bt,onHiddenSeriesChange:Fe&&(e=>Fe(e.map(Number)))}),[J,Tt]=o.useState(null),[We,Xe]=o.useState(null),[Je,le]=o.useState(null),[Ne,wt]=o.useState(null),[Q,St]=o.useState(!1),v=o.useMemo(()=>se.regionsOf(B,{idKey:j,labelKey:d,nameKey:M}),[j,d,M,B]),Te=(y??[]).join("\0"),{context:Qe,inPlay:re}=o.useMemo(()=>{const e=new Set(Te?Te.split("\0"):[]),t=v.filter(s=>e.has(s.id));return t.length>0?{context:v.filter(s=>!e.has(s.id)),inPlay:t}:{context:[],inPlay:v}},[Te,v]),we=l.type==="categorical"?X:Nt,Ye=we.isHidden,{entries:m,ranked:H,scale:$}=o.useMemo(()=>{const e=new Map;i.forEach(r=>{e.has(r.id)||e.set(r.id,r)});const t=re.map(r=>{const u=e.get(r.id),k=u==null?void 0:u.value;return{category:(u==null?void 0:u.category)??null,region:r,value:typeof k=="number"&&Number.isFinite(k)?k:null}}),s=Gt.buildMapScale(l,t.flatMap(r=>r.value??[]),p,c),h=t.filter(r=>r.value!==null).sort((r,u)=>u.value-r.value),f=new Map(h.map((r,u)=>[r.region.id,u+1])),w=t.map(r=>{const u=s.keyOf(r),k=f.get(r.region.id),S=s.numeric?r.value===null?void 0:p(r.value):s.labelOf(r),E=l.type==="none"?r.region.name:[r.region.name,S??V,k&&`${k}º de ${h.length}`].filter(Boolean).join(", ");return{...r,description:E,fill:s.fillOf(r),hidden:u!==void 0&&Ye(u),key:u,rank:k,valueText:S}});return{entries:w,ranked:w.filter(r=>r.rank!==void 0).sort((r,u)=>r.rank-u.rank),scale:s}},[c,l,i,p,re,Ye,V]),Se=Lt.sum(H,e=>e.value),ie=l.type==="none"?0:m.filter(e=>e.fill===void 0).length,oe=o.useMemo(()=>{const e=new Set(v.map(t=>t.id));return i.filter(t=>!e.has(t.id)).map(t=>t.id).join(", ")},[i,v]);o.useEffect(()=>{oe&&ra()&&console.warn(`ChartMap "${ne}": ${oe.split(", ").length} dado(s) sem região na geometria, fora do desenho: ${oe}.`)},[oe,ne]);const K=yt??[],Ze=o.useMemo(()=>Vt.resolveSeriesColors(K,{accent:c}),[c,K]),ce=new Set(K.flatMap(e=>e.points.filter(t=>[t.latitude,t.longitude,t.value].every(Number.isFinite)&&t.value>=0))),Re=ce.size>0,U=v.length===0||!Re&&($.numeric?H.length===0:l.type==="categorical"&&m.every(e=>e.fill===void 0)),Oe=O==="right"&&be.width>=Rt,Y=O==="right"&&!Oe?"bottom":O,Z=L.width,R=F==="fill",et=R?Math.max(L.height,De):F,tt=$e!=="hidden",at=ke!=="hidden"&&$.numeric,N=o.useMemo(()=>{if(Z===0||U)return;const e=new Map(m.map(t=>[t.region.id,t.valueText]));return ia({all:v,callouts:Le==="callout",fixedHeight:R,font:L.font,labels:tt,maxHeight:et,target:re,valueOf:t=>at?e.get(t.id):void 0,width:Z})},[U,m,R,re,tt,et,L.font,v,Le,at,Z]),q=N==null?void 0:N.projection,st=(N==null?void 0:N.height)??0,P=o.useMemo(()=>{if(!q)return new Map;const e=gt.geoPath(q);return new Map(v.map(t=>[t.id,e(t.shape)??""]))},[q,v]),qe=Kt.scaleSqrt().domain([0,Math.max(...[...ce].map(e=>e.value),1)]).range([0,A]),Ie=q?K.flatMap((e,t)=>X.isHidden(e.id)?[]:e.points.flatMap((s,h)=>{const f=ce.has(s)?q([s.longitude,s.latitude]):null;return f?[{color:Ze[t],key:`marker:${t}:${h}`,point:s,radius:Math.max(G,qe(s.value)),series:e,x:f[0],y:f[1]}]:[]})).sort((e,t)=>t.radius-e.radius):[],I=ye!==void 0,ee=Me!==void 0,nt=I||ee,Ce=e=>`region:${e}`,ue=[...I?m.map((e,t)=>Ce(t)):[],...ee?Ie.map(e=>e.key):[]],de=m.findIndex(e=>e.region.id===W),Ae=ue.includes(Je??"")?Je:I&&de>=0?Ce(de):ue[0],te=e=>e!=null&&e.startsWith("region:")?m[Number(e.slice(7))]:void 0,he=e=>Ie.find(t=>t.key===e),ae=te(We),fe=he(We),T=(J==null?void 0:J.kind)==="region"?J.entry:void 0,Ot=(T==null?void 0:T.region.id)??(ae==null?void 0:ae.region.id),qt=e=>({category:e.category,feature:e.region.feature,id:e.region.id,name:e.region.name,value:e.value}),It=({point:e,series:t})=>({id:e.id,series:t.id,value:e.value}),Ct=({point:e,series:t})=>`${e.label}, ${t.label}, ${p(e.value)}`;function me(e){var t,s;return((s=(t=e.target).getAttribute)==null?void 0:s.call(t,"data-mark"))??null}function lt(e){const t=te(e),s=he(e);Tt(t?{entry:t,kind:"region"}:s?{kind:"marker",marker:s}:null),b==null||b((t==null?void 0:t.region.id)??null)}function rt(e){const t=te(e),s=he(e);t&&ye?(le(e),ye(qt(t))):s&&Me&&(le(e),Me(It(s)))}function At(e,[t,s]){if(!q)return;const h=gt.geoPath(q),f=S=>{const E=te(S),z=he(S);return E?h.centroid(E.region.shape):z?[z.x,z.y]:[0,0]},[w,r]=f(e);let u,k=1/0;return ue.forEach(S=>{if(S===e)return;const[E,z]=f(S),mt=(E-w)*t+(z-r)*s,pt=mt+2*Math.abs((E-w)*s-(z-r)*t);mt>1&&pt<k&&(k=pt,u=S)}),u}function Ht(e){var h,f;const t=me(e),s={ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1]};if(!(!t||!ue.includes(t))){if(e.key==="Enter"||e.key===" "){e.preventDefault(),rt(t);return}if(e.key in s){e.preventDefault();const w=At(t,s[e.key]);w&&(le(w),(f=(h=Ve.current)==null?void 0:h.querySelector(`[data-mark="${w}"]`))==null||f.focus())}}}const it={onBlur:()=>{Xe(null),b==null||b(null)},onClick:e=>rt(me(e)),onFocus:e=>{var s;const t=me(e);Xe(t),le(t),b==null||b(((s=te(t))==null?void 0:s.region.id)??null)},onKeyDown:Ht,onMouseOut:()=>lt(null),onMouseOver:e=>lt(me(e))},pe=la(v.length),ot=(N==null?void 0:N.plan)??{callouts:[],inside:[]},ct=L.font.size+1,ut=Be==="hatch"?`url(#${Ge})`:"var(--pl-chart-no-data)",Pt=o.useMemo(()=>m.map((e,t)=>{const s=Ce(t),h=Ne!==null&&e.key!==Ne;return a.jsx("path",{"aria-label":e.description,"aria-pressed":I&&W!==void 0?e.region.id===W:void 0,className:`${n.default.region} ${I?n.default.clickable:""} ${h?n.default.dimmed:""}`,d:P.get(e.region.id),"data-mark":s,fill:e.hidden?aa:e.fill??ut,role:I?"button":void 0,strokeWidth:pe,tabIndex:I?s===Ae?0:-1:void 0},t)}),[m,Ne,ut,P,I,W,pe,Ae]),Et=o.useMemo(()=>Qe.map((e,t)=>a.jsx("path",{className:n.default.context,d:P.get(e.id),strokeWidth:pe},t)),[Qe,P,pe]),Dt=(()=>{const e=na(m.length,"região","regiões"),t=ie>0?` ${ie} sem dado.`:"",s=nt?" Use as setas para percorrer as marcas.":"";if(!$.numeric||H.length===0)return`Mapa de ${e}.${t}${s}`;const[h,f]=[H[0],H[H.length-1]];return`Mapa de ${e}. Maior valor: ${h.region.name}, ${p(h.value)}. Menor: ${f.region.name}, ${p(f.value)}.${t}${s}`})();function dt(e,t){return`${n.default.label} ${t?n.default.labelOnHover:""} ${Ot===e?n.default.labelActive:""}`}const He=q&&a.jsxs("svg",{"aria-describedby":ze,"aria-labelledby":Ue,className:`${n.default.canvas} ${R?n.default.canvasFill:""}`,height:st,ref:Ve,role:nt?"group":"img",viewBox:`0 0 ${Z} ${st}`,width:Z,children:[a.jsx("defs",{children:a.jsxs("pattern",{height:6,id:Ge,patternTransform:"rotate(45)",patternUnits:"userSpaceOnUse",width:6,children:[a.jsx("rect",{className:n.default.hatchBackground,height:6,width:6}),a.jsx("line",{className:n.default.hatchLine,x1:0,x2:0,y1:0,y2:6})]})}),a.jsx("g",{"aria-hidden":"true",className:n.default.passThrough,children:Et}),a.jsx("g",{...it,children:Pt}),a.jsxs("g",{"aria-hidden":"true",className:n.default.passThrough,children:[de>=0&&a.jsx("path",{className:n.default.selectedOutline,d:P.get(m[de].region.id)}),T&&a.jsx("path",{className:n.default.hoverOutline,d:P.get(T.region.id)}),ae&&a.jsx("path",{className:n.default.focusOutline,d:P.get(ae.region.id)})]}),a.jsxs("g",{...it,children:[Ie.map(e=>a.jsx("circle",{"aria-label":Ct(e),className:`${n.default.marker} ${ee?n.default.clickable:""}`,cx:e.x,cy:e.y,"data-mark":e.key,fill:e.color,r:e.radius,role:ee?"button":"img",tabIndex:ee?e.key===Ae?0:-1:void 0},e.key)),fe&&a.jsx("circle",{"aria-hidden":"true",className:n.default.focusOutline,cx:fe.x,cy:fe.y,r:fe.radius+3})]}),a.jsxs("g",{"aria-hidden":"true",className:n.default.passThrough,children:[ot.inside.map(e=>a.jsxs("text",{className:dt(e.id,$e==="onHover"),x:e.x,y:e.y,children:[a.jsx("tspan",{dominantBaseline:"central",x:e.x,y:e.value?e.y-ct/2:e.y,children:e.title}),e.value&&a.jsx("tspan",{className:`${n.default.labelValue} ${ke==="onHover"?n.default.valueOnHover:""}`,dominantBaseline:"central",x:e.x,y:e.y+ct/2,children:e.value})]},e.id)),ot.callouts.map(e=>a.jsxs("g",{className:dt(e.id,$e==="onHover"),children:[a.jsx("path",{className:n.default.leader,d:`M${e.anchor[0]},${e.anchor[1]}L${e.x-12},${e.y}L${e.x-4},${e.y}`}),a.jsx("circle",{className:n.default.leaderDot,cx:e.anchor[0],cy:e.anchor[1],r:1.8}),a.jsxs("text",{className:n.default.callout,dominantBaseline:"central",x:e.x,y:e.y,children:[e.title,e.value&&a.jsx("tspan",{className:`${n.default.labelValue} ${ke==="onHover"?n.default.valueOnHover:""}`,dx:5,children:e.value})]})]},e.id))]})]}),Bt=ca(J,{formatPercent:C,formatTooltipValue:ge??p,markerValueLabel:xe,noDataLabel:V,rankedCount:H.length,scale:$,showShare:_e,total:Se,valueLabel:je,colorScale:l}),Pe=new Map;m.forEach(e=>e.key!==void 0&&Pe.set(e.key,(Pe.get(e.key)??0)+1));const ht=Y!=="none"&&a.jsx(Ut.ChartMapLegend,{align:ve,entries:$.entries.map(e=>({...e,count:Pe.get(e.key)??0,hidden:we.isHidden(e.key)})),formatValue:p,gradient:$.gradient,indicator:(T==null?void 0:T.value)==null||(ft=$.gradient)==null?void 0:ft.position(T.value),markerSeries:K.map((e,t)=>({color:Ze[t],hidden:X.isHidden(e.id),key:e.id,label:e.label})),markerSizes:Re?{maximum:qe.domain()[1],radiusOf:e=>Math.max(G,qe(e))}:void 0,markerValueLabel:xe,noData:ie>0?{color:Be==="hatch"?ta:"var(--pl-chart-no-data)",count:ie,label:V}:void 0,onHighlight:e=>wt(e),onToggle:we.toggle,onToggleMarkerSeries:X.toggle,position:Y,style:Oe?{width:Math.min(ea,Math.round(be.width*.3))}:void 0,valueLabel:je}),Ft=m.filter(e=>!e.hidden).map(e=>({classLabel:l.type==="classes"?$.labelOf(e):void 0,id:e.region.id,name:e.region.name,rank:e.rank,selected:e.region.id===W,share:e.value!==null&&Se>0?e.value/Se:void 0,value:e.value,valueText:e.valueText})),_t=K.flatMap(e=>X.isHidden(e.id)?[]:e.points.filter(t=>ce.has(t)).map(t=>({key:`${e.id}:${t.id}`,name:t.label,series:e.label,value:p(t.value)})));return a.jsxs("figure",{className:n.default.figure,children:[a.jsxs("figcaption",{className:n.default.header,children:[a.jsxs("span",{className:n.default.heading,children:[a.jsx("span",{className:n.default.title,id:Ue,children:ne}),Ke&&a.jsx("span",{className:n.default.subtitle,children:Ke})]}),kt&&!U&&a.jsx(Wt.Button,{"aria-pressed":Q,className:n.default.tableToggle,onClick:()=>St(e=>!e),size:"sm",variant:"secondary",children:"Ver como tabela"})]}),a.jsx("span",{className:n.default.visuallyHidden,id:ze,children:Dt}),a.jsxs("div",{className:`${n.default.body} ${Oe&&!Q?n.default.bodyRow:""}`,ref:be.ref,children:[Y==="top"&&!Q&&!U&&ht,U?a.jsx("div",{className:n.default.empty,children:a.jsx(Xt.EmptyState,{icon:a.jsx(Jt.IconChartBar,{}),size:"sm",title:D})}):Q?a.jsx(zt.ChartMapTable,{markerRows:_t,markerValueLabel:xe,maxHeight:typeof F=="number"?Math.max(F,De):void 0,noDataLabel:V,regionRows:Ft,showClasses:l.type==="classes",showRank:$.numeric,showShare:_e&&$.numeric,showValue:l.type!=="none",formatPercent:C,title:ne,valueLabel:je}):a.jsx("div",{className:`${n.default.plot} ${R?n.default.plotFill:""}`,ref:L.ref,children:He&&(jt?a.jsx(Qt.ChartTooltip,{...Bt,children:He}):He)}),(Y==="bottom"||Y==="right")&&!Q&&!U&&ht]})]})}function ca(c,l){if(c===null)return{rows:[]};if(c.kind==="marker"){const{color:M,point:y,series:C}=c.marker;return{columns:[{format:l.formatTooltipValue}],computed:"none",rows:[{color:M,label:l.markerValueLabel,values:[y.value]}],subtitle:C.label,title:y.label}}const{entry:i}=c,{region:x}=i,D=x.label!==x.name?x.label:void 0,j=(M,y)=>({format:()=>y,label:M,values:[0]}),d=[];if(l.colorScale.type==="none")d.push({label:D??x.name,values:[]});else if(!l.scale.numeric)d.push(i.valueText?{...j(l.valueLabel,i.valueText),color:i.fill}:{label:l.noDataLabel,values:[]});else if(i.value===null)d.push({label:l.noDataLabel,values:[]});else{d.push({color:i.fill,label:l.valueLabel,values:[i.value]});const M=l.colorScale.type==="classes"?l.scale.labelOf(i):void 0;M&&d.push(j("Faixa",M)),l.showShare&&l.total>0&&d.push({format:l.formatPercent,label:"% do total",values:[i.value/l.total]}),d.push(j("Posição",`${i.rank}º de ${l.rankedCount}`))}return i.hidden&&d.push({label:"Oculta pela legenda",values:[]}),{columns:[{format:l.formatTooltipValue}],computed:"none",rows:d,subtitle:D,title:x.name}}exports.ChartMap=oa;
|
|
2
|
+
//# sourceMappingURL=ChartMap.cjs.map
|