panelui-native 0.86.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -543,7 +543,15 @@ export {
543
543
  type NumberInputProps,
544
544
  } from './components/number-input';
545
545
  export { OtpInput, type OtpInputProps } from './components/otp-input';
546
- export { SearchBar, type SearchBarProps } from './components/search-bar';
546
+ export {
547
+ SearchBar,
548
+ type SearchBarProps,
549
+ type SearchBarItemProps,
550
+ type SearchBarSectionProps,
551
+ type SearchBarStatusProps,
552
+ type SearchBarPanelMode,
553
+ type SearchBarPanelPlacement,
554
+ } from './components/search-bar';
547
555
  export {
548
556
  Panelside,
549
557
  usePanelside,
@@ -621,6 +629,42 @@ export {
621
629
  type LiveLineMomentumColors,
622
630
  type LiveLinePoint,
623
631
  } from './components/live-line-chart';
632
+ export {
633
+ BubbleChart,
634
+ useBubbleChart,
635
+ type BubbleChartProps,
636
+ type BubbleChartHandle,
637
+ type BubbleChartHeaderProps,
638
+ type BubbleChartGridProps,
639
+ type BubbleChartBubblesProps,
640
+ type BubbleChartLabelsProps,
641
+ type BubbleChartSkeletonProps,
642
+ type BubbleChartXAxisProps,
643
+ type BubbleChartYAxisProps,
644
+ type BubbleChartTooltipProps,
645
+ type BubbleChartLegendProps,
646
+ type BubbleChartDatum,
647
+ type BubbleChartPoint,
648
+ type BubbleChartStatus,
649
+ } from './components/bubble-chart';
650
+ export {
651
+ PyramidChart,
652
+ usePyramidChart,
653
+ type PyramidChartProps,
654
+ type PyramidChartHandle,
655
+ type PyramidChartHeaderProps,
656
+ type PyramidChartGridProps,
657
+ type PyramidChartBarProps,
658
+ type PyramidChartSkeletonProps,
659
+ type PyramidChartXAxisProps,
660
+ type PyramidChartYAxisProps,
661
+ type PyramidChartTooltipProps,
662
+ type PyramidChartLegendProps,
663
+ type PyramidChartDatum,
664
+ type PyramidChartStatus,
665
+ type PyramidChartSide,
666
+ type PyramidChartLabelPlacement,
667
+ } from './components/pyramid-chart';
624
668
  export {
625
669
  PolarAreaChart,
626
670
  usePolarAreaChart,
@@ -209,6 +209,33 @@ function mantissa(value: number): string {
209
209
  return trimZeros(value.toFixed(Math.abs(value) < 10 ? 1 : 0));
210
210
  }
211
211
 
212
+ /**
213
+ * A value's radius on a bubble scale, in points.
214
+ *
215
+ * The value maps to *area* and the radius is taken from it, so a bubble holding
216
+ * twice the value carries twice the ink. Mapping it to the radius instead
217
+ * quadruples the ink for a doubled value, and the reader believes the larger
218
+ * number by four times.
219
+ *
220
+ * `extent` is the smallest and largest value in the whole set, so one bubble's
221
+ * size means the same thing as another's. A degenerate extent — one row, or
222
+ * every value identical — puts everything at the top of the range rather than
223
+ * dividing by zero.
224
+ */
225
+ export function bubbleRadius(
226
+ value: number,
227
+ extent: readonly [number, number],
228
+ range: readonly [number, number]
229
+ ): number {
230
+ 'worklet';
231
+ const [min, max] = extent;
232
+ const [rMin, rMax] = range;
233
+ const ratio = max === min ? 1 : (value - min) / (max - min);
234
+ const clamped = ratio < 0 ? 0 : ratio > 1 ? 1 : ratio;
235
+ const area = rMin * rMin + clamped * (rMax * rMax - rMin * rMin);
236
+ return Math.sqrt(area);
237
+ }
238
+
212
239
  /** `12k` rather than `12400` — a readout has one line to say it in. */
213
240
  export function compactNumber(value: number): string {
214
241
  if (!Number.isFinite(value)) return String(value);