panelui-native 0.100.0 → 0.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +2 -0
  2. package/lib/module/components/compare/index.js +576 -0
  3. package/lib/module/components/compare/index.js.map +1 -0
  4. package/lib/module/components/sankey-chart/index.js +933 -0
  5. package/lib/module/components/sankey-chart/index.js.map +1 -0
  6. package/lib/module/components/sankey-chart/sankey-layout.js +530 -0
  7. package/lib/module/components/sankey-chart/sankey-layout.js.map +1 -0
  8. package/lib/module/icons/index.js +15 -3
  9. package/lib/module/icons/index.js.map +1 -1
  10. package/lib/module/index.js +2 -0
  11. package/lib/module/index.js.map +1 -1
  12. package/lib/module/utils/chart.js +31 -0
  13. package/lib/module/utils/chart.js.map +1 -1
  14. package/lib/typescript/src/components/compare/index.d.ts +183 -0
  15. package/lib/typescript/src/components/compare/index.d.ts.map +1 -0
  16. package/lib/typescript/src/components/sankey-chart/index.d.ts +307 -0
  17. package/lib/typescript/src/components/sankey-chart/index.d.ts.map +1 -0
  18. package/lib/typescript/src/components/sankey-chart/sankey-layout.d.ts +107 -0
  19. package/lib/typescript/src/components/sankey-chart/sankey-layout.d.ts.map +1 -0
  20. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  21. package/lib/typescript/src/index.d.ts +2 -0
  22. package/lib/typescript/src/index.d.ts.map +1 -1
  23. package/lib/typescript/src/utils/chart.d.ts +17 -0
  24. package/lib/typescript/src/utils/chart.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/components/compare/index.tsx +650 -0
  27. package/src/components/sankey-chart/index.tsx +1165 -0
  28. package/src/components/sankey-chart/sankey-layout.ts +645 -0
  29. package/src/icons/index.tsx +20 -6
  30. package/src/index.ts +25 -0
  31. package/src/utils/chart.ts +46 -0
package/src/index.ts CHANGED
@@ -504,6 +504,15 @@ export {
504
504
  type ComboboxSelection,
505
505
  type ComboboxPresentation,
506
506
  } from './components/combobox';
507
+ export {
508
+ Compare,
509
+ type CompareProps,
510
+ type CompareBeforeProps,
511
+ type CompareAfterProps,
512
+ type CompareHandleProps,
513
+ type CompareLabelProps,
514
+ type CompareOrientation,
515
+ } from './components/compare';
507
516
  export {
508
517
  ContextMenu,
509
518
  type ContextMenuProps,
@@ -1102,6 +1111,22 @@ export {
1102
1111
  type RingChartLegendProps,
1103
1112
  type RingDatum,
1104
1113
  } from './components/ring-chart';
1114
+ export {
1115
+ SankeyChart,
1116
+ useSankeyChart,
1117
+ type SankeyChartProps,
1118
+ type SankeyChartHandle,
1119
+ type SankeyChartHeaderProps,
1120
+ type SankeyChartLinksProps,
1121
+ type SankeyChartNodesProps,
1122
+ type SankeyChartLabelsProps,
1123
+ type SankeyChartTooltipProps,
1124
+ type SankeyChartSkeletonProps,
1125
+ type SankeyChartStatus,
1126
+ type SankeyNode,
1127
+ type SankeyLink,
1128
+ type SankeyAlign,
1129
+ } from './components/sankey-chart';
1105
1130
  export {
1106
1131
  ScatterChart,
1107
1132
  useScatterChart,
@@ -1157,3 +1157,49 @@ export function ribbonPath(
1157
1157
  `Z`
1158
1158
  );
1159
1159
  }
1160
+
1161
+ /**
1162
+ * One ribbon of a flow diagram: a band of constant thickness running from a
1163
+ * centre at one end to a different centre at the other.
1164
+ *
1165
+ * Given by centres rather than edges because that is what the layout produces
1166
+ * — a ribbon is stacked against its node's edge and then recorded by its
1167
+ * middle, so that growing it in place thickens it about its own centre line
1168
+ * instead of sliding it down the node.
1169
+ *
1170
+ * The ends stay vertical whatever the two centres are, so a ribbon meets the
1171
+ * flat side of a node exactly rather than at the angle it happened to arrive.
1172
+ * `curve` is how far the control points reach towards the middle, as a
1173
+ * fraction of the horizontal run: `0.5` puts both on the halfway line, which
1174
+ * is the S that reads as one continuous flow, and `0` gives a straight
1175
+ * diagonal.
1176
+ */
1177
+ export function flowPath(
1178
+ x0: number,
1179
+ cy0: number,
1180
+ x1: number,
1181
+ cy1: number,
1182
+ thickness: number,
1183
+ curve: number
1184
+ ): string {
1185
+ 'worklet';
1186
+ if (!(thickness > 0)) return '';
1187
+
1188
+ const half = thickness / 2;
1189
+ const topStart = cy0 - half;
1190
+ const topEnd = cy1 - half;
1191
+ const bottomStart = cy0 + half;
1192
+ const bottomEnd = cy1 + half;
1193
+
1194
+ const run = x1 - x0;
1195
+ const near = x0 + run * curve;
1196
+ const far = x1 - run * curve;
1197
+
1198
+ return (
1199
+ `M${x0},${topStart}` +
1200
+ `C${near},${topStart},${far},${topEnd},${x1},${topEnd}` +
1201
+ `L${x1},${bottomEnd}` +
1202
+ `C${far},${bottomEnd},${near},${bottomStart},${x0},${bottomStart}` +
1203
+ `Z`
1204
+ );
1205
+ }