snice 4.8.0 → 4.9.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 (315) hide show
  1. package/adapters/react/camera-annotate.d.ts +27 -0
  2. package/adapters/react/camera-annotate.d.ts.map +1 -0
  3. package/adapters/react/camera-annotate.js +24 -0
  4. package/adapters/react/camera-annotate.js.map +1 -0
  5. package/adapters/react/camera-annotate.tsx +35 -0
  6. package/adapters/react/candlestick.d.ts +34 -0
  7. package/adapters/react/candlestick.d.ts.map +1 -0
  8. package/adapters/react/candlestick.js +24 -0
  9. package/adapters/react/candlestick.js.map +1 -0
  10. package/adapters/react/candlestick.tsx +42 -0
  11. package/adapters/react/components.d.ts +14 -0
  12. package/adapters/react/components.d.ts.map +1 -1
  13. package/adapters/react/components.js +7 -0
  14. package/adapters/react/components.js.map +1 -1
  15. package/adapters/react/components.ts +14 -0
  16. package/adapters/react/funnel.d.ts +31 -0
  17. package/adapters/react/funnel.d.ts.map +1 -0
  18. package/adapters/react/funnel.js +24 -0
  19. package/adapters/react/funnel.js.map +1 -0
  20. package/adapters/react/funnel.tsx +39 -0
  21. package/adapters/react/network-graph.d.ts +32 -0
  22. package/adapters/react/network-graph.d.ts.map +1 -0
  23. package/adapters/react/network-graph.js +24 -0
  24. package/adapters/react/network-graph.js.map +1 -0
  25. package/adapters/react/network-graph.tsx +40 -0
  26. package/adapters/react/sankey.d.ts +31 -0
  27. package/adapters/react/sankey.d.ts.map +1 -0
  28. package/adapters/react/sankey.js +24 -0
  29. package/adapters/react/sankey.js.map +1 -0
  30. package/adapters/react/sankey.tsx +39 -0
  31. package/adapters/react/time-range-picker.d.ts +33 -0
  32. package/adapters/react/time-range-picker.d.ts.map +1 -0
  33. package/adapters/react/time-range-picker.js +24 -0
  34. package/adapters/react/time-range-picker.js.map +1 -0
  35. package/adapters/react/time-range-picker.tsx +41 -0
  36. package/adapters/react/treemap.d.ts +30 -0
  37. package/adapters/react/treemap.d.ts.map +1 -0
  38. package/adapters/react/treemap.js +24 -0
  39. package/adapters/react/treemap.js.map +1 -0
  40. package/adapters/react/treemap.tsx +38 -0
  41. package/adapters/react/virtual-scroller.d.ts +1 -0
  42. package/adapters/react/virtual-scroller.d.ts.map +1 -1
  43. package/adapters/react/virtual-scroller.js +1 -1
  44. package/adapters/react/virtual-scroller.js.map +1 -1
  45. package/adapters/react/virtual-scroller.tsx +2 -1
  46. package/dist/cdn/accordion/snice-accordion.js +1 -1
  47. package/dist/cdn/accordion/snice-accordion.min.js +1 -1
  48. package/dist/cdn/alert/snice-alert.js +1 -1
  49. package/dist/cdn/alert/snice-alert.min.js +1 -1
  50. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  51. package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
  52. package/dist/cdn/avatar/snice-avatar.js +1 -1
  53. package/dist/cdn/avatar/snice-avatar.min.js +1 -1
  54. package/dist/cdn/badge/snice-badge.js +1 -1
  55. package/dist/cdn/badge/snice-badge.min.js +1 -1
  56. package/dist/cdn/banner/snice-banner.js +1 -1
  57. package/dist/cdn/banner/snice-banner.min.js +1 -1
  58. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +2 -2
  59. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js.map +1 -1
  60. package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +13 -13
  61. package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js.map +1 -1
  62. package/dist/cdn/button/snice-button.js +1 -1
  63. package/dist/cdn/button/snice-button.min.js +1 -1
  64. package/dist/cdn/calendar/snice-calendar.js +1 -1
  65. package/dist/cdn/calendar/snice-calendar.min.js +1 -1
  66. package/dist/cdn/camera/snice-camera.js +1 -1
  67. package/dist/cdn/camera/snice-camera.min.js +1 -1
  68. package/dist/cdn/camera-annotate/README.md +27 -0
  69. package/dist/cdn/camera-annotate/snice-camera-annotate.js +730 -0
  70. package/dist/cdn/camera-annotate/snice-camera-annotate.js.map +1 -0
  71. package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +144 -0
  72. package/dist/cdn/camera-annotate/snice-camera-annotate.min.js.map +1 -0
  73. package/dist/cdn/candlestick/README.md +27 -0
  74. package/dist/cdn/candlestick/snice-candlestick.js +717 -0
  75. package/dist/cdn/candlestick/snice-candlestick.js.map +1 -0
  76. package/dist/cdn/candlestick/snice-candlestick.min.js +22 -0
  77. package/dist/cdn/candlestick/snice-candlestick.min.js.map +1 -0
  78. package/dist/cdn/card/snice-card.js +1 -1
  79. package/dist/cdn/card/snice-card.min.js +1 -1
  80. package/dist/cdn/carousel/snice-carousel.js +1 -1
  81. package/dist/cdn/carousel/snice-carousel.min.js +1 -1
  82. package/dist/cdn/chart/snice-chart.js +1 -1
  83. package/dist/cdn/chart/snice-chart.min.js +1 -1
  84. package/dist/cdn/chat/snice-chat.js +1 -1
  85. package/dist/cdn/chat/snice-chat.min.js +1 -1
  86. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  87. package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
  88. package/dist/cdn/chip/snice-chip.js +1 -1
  89. package/dist/cdn/chip/snice-chip.min.js +1 -1
  90. package/dist/cdn/code-block/snice-code-block.js +1 -1
  91. package/dist/cdn/code-block/snice-code-block.min.js +1 -1
  92. package/dist/cdn/color-display/snice-color-display.js +1 -1
  93. package/dist/cdn/color-display/snice-color-display.min.js +1 -1
  94. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  95. package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
  96. package/dist/cdn/command-palette/snice-command-palette.js +1 -1
  97. package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
  98. package/dist/cdn/date-picker/snice-date-picker.js +1 -1
  99. package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
  100. package/dist/cdn/divider/snice-divider.js +1 -1
  101. package/dist/cdn/divider/snice-divider.min.js +1 -1
  102. package/dist/cdn/doc/snice-doc.js +1 -1
  103. package/dist/cdn/doc/snice-doc.min.js +1 -1
  104. package/dist/cdn/draw/snice-draw.js +1 -1
  105. package/dist/cdn/draw/snice-draw.min.js +1 -1
  106. package/dist/cdn/drawer/snice-drawer.js +1 -1
  107. package/dist/cdn/drawer/snice-drawer.min.js +1 -1
  108. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  109. package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
  110. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  111. package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
  112. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  113. package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
  114. package/dist/cdn/funnel/README.md +27 -0
  115. package/dist/cdn/funnel/snice-funnel.js +424 -0
  116. package/dist/cdn/funnel/snice-funnel.js.map +1 -0
  117. package/dist/cdn/funnel/snice-funnel.min.js +20 -0
  118. package/dist/cdn/funnel/snice-funnel.min.js.map +1 -0
  119. package/dist/cdn/gauge/snice-gauge.js +1 -1
  120. package/dist/cdn/gauge/snice-gauge.min.js +1 -1
  121. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  122. package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
  123. package/dist/cdn/image/snice-image.js +1 -1
  124. package/dist/cdn/image/snice-image.min.js +1 -1
  125. package/dist/cdn/input/snice-input.js +1 -1
  126. package/dist/cdn/input/snice-input.min.js +1 -1
  127. package/dist/cdn/kanban/snice-kanban.js +1 -1
  128. package/dist/cdn/kanban/snice-kanban.min.js +1 -1
  129. package/dist/cdn/kpi/snice-kpi.js +1 -1
  130. package/dist/cdn/kpi/snice-kpi.min.js +1 -1
  131. package/dist/cdn/layout/README.md +2 -2
  132. package/dist/cdn/layout/snice-layout.js +23 -6
  133. package/dist/cdn/layout/snice-layout.js.map +1 -1
  134. package/dist/cdn/layout/snice-layout.min.js +2 -2
  135. package/dist/cdn/layout/snice-layout.min.js.map +1 -1
  136. package/dist/cdn/link/snice-link.js +1 -1
  137. package/dist/cdn/link/snice-link.min.js +1 -1
  138. package/dist/cdn/link-preview/snice-link-preview.js +1 -1
  139. package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
  140. package/dist/cdn/list/README.md +6 -2
  141. package/dist/cdn/list/snice-list.js +87 -10
  142. package/dist/cdn/list/snice-list.js.map +1 -1
  143. package/dist/cdn/list/snice-list.min.js +20 -6
  144. package/dist/cdn/list/snice-list.min.js.map +1 -1
  145. package/dist/cdn/location/snice-location.js +1 -1
  146. package/dist/cdn/location/snice-location.min.js +1 -1
  147. package/dist/cdn/login/snice-login.js +1 -1
  148. package/dist/cdn/login/snice-login.min.js +1 -1
  149. package/dist/cdn/masonry/snice-masonry.js +1 -1
  150. package/dist/cdn/masonry/snice-masonry.min.js +1 -1
  151. package/dist/cdn/menu/snice-menu.js +1 -1
  152. package/dist/cdn/menu/snice-menu.min.js +1 -1
  153. package/dist/cdn/modal/snice-modal.js +1 -1
  154. package/dist/cdn/modal/snice-modal.min.js +1 -1
  155. package/dist/cdn/music-player/snice-music-player.js +1 -1
  156. package/dist/cdn/music-player/snice-music-player.min.js +1 -1
  157. package/dist/cdn/nav/README.md +2 -2
  158. package/dist/cdn/nav/snice-nav.js +23 -6
  159. package/dist/cdn/nav/snice-nav.js.map +1 -1
  160. package/dist/cdn/nav/snice-nav.min.js +2 -2
  161. package/dist/cdn/nav/snice-nav.min.js.map +1 -1
  162. package/dist/cdn/network-graph/README.md +27 -0
  163. package/dist/cdn/network-graph/snice-network-graph.js +788 -0
  164. package/dist/cdn/network-graph/snice-network-graph.js.map +1 -0
  165. package/dist/cdn/network-graph/snice-network-graph.min.js +13 -0
  166. package/dist/cdn/network-graph/snice-network-graph.min.js.map +1 -0
  167. package/dist/cdn/pagination/README.md +2 -2
  168. package/dist/cdn/pagination/snice-pagination.js +13 -13
  169. package/dist/cdn/pagination/snice-pagination.js.map +1 -1
  170. package/dist/cdn/pagination/snice-pagination.min.js +14 -14
  171. package/dist/cdn/pagination/snice-pagination.min.js.map +1 -1
  172. package/dist/cdn/paint/snice-paint.js +1 -1
  173. package/dist/cdn/paint/snice-paint.min.js +1 -1
  174. package/dist/cdn/progress/snice-progress.js +1 -1
  175. package/dist/cdn/progress/snice-progress.min.js +1 -1
  176. package/dist/cdn/qr-code/snice-qr-code.js +1 -1
  177. package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
  178. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  179. package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
  180. package/dist/cdn/radio/snice-radio.js +1 -1
  181. package/dist/cdn/radio/snice-radio.min.js +1 -1
  182. package/dist/cdn/runtime/snice-runtime.esm.js +3 -3
  183. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  184. package/dist/cdn/runtime/snice-runtime.esm.min.js +3 -3
  185. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  186. package/dist/cdn/runtime/snice-runtime.js +3 -3
  187. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  188. package/dist/cdn/runtime/snice-runtime.min.js +3 -3
  189. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  190. package/dist/cdn/sankey/README.md +27 -0
  191. package/dist/cdn/sankey/snice-sankey.js +679 -0
  192. package/dist/cdn/sankey/snice-sankey.js.map +1 -0
  193. package/dist/cdn/sankey/snice-sankey.min.js +21 -0
  194. package/dist/cdn/sankey/snice-sankey.min.js.map +1 -0
  195. package/dist/cdn/select/snice-select.js +1 -1
  196. package/dist/cdn/select/snice-select.min.js +1 -1
  197. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  198. package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
  199. package/dist/cdn/slider/snice-slider.js +1 -1
  200. package/dist/cdn/slider/snice-slider.min.js +1 -1
  201. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  202. package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
  203. package/dist/cdn/spinner/snice-spinner.js +1 -1
  204. package/dist/cdn/spinner/snice-spinner.min.js +1 -1
  205. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  206. package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
  207. package/dist/cdn/stepper/README.md +6 -2
  208. package/dist/cdn/stepper/snice-stepper.js +77 -10
  209. package/dist/cdn/stepper/snice-stepper.js.map +1 -1
  210. package/dist/cdn/stepper/snice-stepper.min.js +13 -9
  211. package/dist/cdn/stepper/snice-stepper.min.js.map +1 -1
  212. package/dist/cdn/switch/snice-switch.js +1 -1
  213. package/dist/cdn/switch/snice-switch.min.js +1 -1
  214. package/dist/cdn/table/snice-table.js +1 -1
  215. package/dist/cdn/table/snice-table.min.js +1 -1
  216. package/dist/cdn/tabs/snice-tabs.js +1 -1
  217. package/dist/cdn/tabs/snice-tabs.min.js +1 -1
  218. package/dist/cdn/terminal/snice-terminal.js +1 -1
  219. package/dist/cdn/terminal/snice-terminal.min.js +1 -1
  220. package/dist/cdn/textarea/snice-textarea.js +1 -1
  221. package/dist/cdn/textarea/snice-textarea.min.js +1 -1
  222. package/dist/cdn/time-range-picker/README.md +27 -0
  223. package/dist/cdn/time-range-picker/snice-time-range-picker.js +635 -0
  224. package/dist/cdn/time-range-picker/snice-time-range-picker.js.map +1 -0
  225. package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +34 -0
  226. package/dist/cdn/time-range-picker/snice-time-range-picker.min.js.map +1 -0
  227. package/dist/cdn/timeline/snice-timeline.js +1 -1
  228. package/dist/cdn/timeline/snice-timeline.min.js +1 -1
  229. package/dist/cdn/timer/snice-timer.js +1 -1
  230. package/dist/cdn/timer/snice-timer.min.js +1 -1
  231. package/dist/cdn/toast/snice-toast.js +1 -1
  232. package/dist/cdn/toast/snice-toast.min.js +1 -1
  233. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  234. package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
  235. package/dist/cdn/tree/README.md +5 -1
  236. package/dist/cdn/tree/snice-tree.js +4 -8
  237. package/dist/cdn/tree/snice-tree.js.map +1 -1
  238. package/dist/cdn/tree/snice-tree.min.js +5 -5
  239. package/dist/cdn/tree/snice-tree.min.js.map +1 -1
  240. package/dist/cdn/treemap/README.md +27 -0
  241. package/dist/cdn/treemap/snice-treemap.js +522 -0
  242. package/dist/cdn/treemap/snice-treemap.js.map +1 -0
  243. package/dist/cdn/treemap/snice-treemap.min.js +14 -0
  244. package/dist/cdn/treemap/snice-treemap.min.js.map +1 -0
  245. package/dist/cdn/virtual-scroller/README.md +2 -2
  246. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +47 -16
  247. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js.map +1 -1
  248. package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +9 -9
  249. package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js.map +1 -1
  250. package/dist/components/breadcrumbs/snice-breadcrumbs.js +1 -1
  251. package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
  252. package/dist/components/camera-annotate/snice-camera-annotate.d.ts +68 -0
  253. package/dist/components/camera-annotate/snice-camera-annotate.js +663 -0
  254. package/dist/components/camera-annotate/snice-camera-annotate.js.map +1 -0
  255. package/dist/components/camera-annotate/snice-camera-annotate.types.d.ts +50 -0
  256. package/dist/components/candlestick/snice-candlestick.d.ts +78 -0
  257. package/dist/components/candlestick/snice-candlestick.js +650 -0
  258. package/dist/components/candlestick/snice-candlestick.js.map +1 -0
  259. package/dist/components/candlestick/snice-candlestick.types.d.ts +40 -0
  260. package/dist/components/funnel/snice-funnel.d.ts +37 -0
  261. package/dist/components/funnel/snice-funnel.js +357 -0
  262. package/dist/components/funnel/snice-funnel.js.map +1 -0
  263. package/dist/components/funnel/snice-funnel.types.d.ts +28 -0
  264. package/dist/components/list/snice-list-item.d.ts +2 -0
  265. package/dist/components/list/snice-list-item.js +20 -2
  266. package/dist/components/list/snice-list-item.js.map +1 -1
  267. package/dist/components/nav/snice-nav.js +22 -5
  268. package/dist/components/nav/snice-nav.js.map +1 -1
  269. package/dist/components/network-graph/snice-network-graph.d.ts +80 -0
  270. package/dist/components/network-graph/snice-network-graph.js +721 -0
  271. package/dist/components/network-graph/snice-network-graph.js.map +1 -0
  272. package/dist/components/network-graph/snice-network-graph.types.d.ts +49 -0
  273. package/dist/components/pagination/snice-pagination.js +12 -12
  274. package/dist/components/sankey/snice-sankey.d.ts +46 -0
  275. package/dist/components/sankey/snice-sankey.js +612 -0
  276. package/dist/components/sankey/snice-sankey.js.map +1 -0
  277. package/dist/components/sankey/snice-sankey.types.d.ts +59 -0
  278. package/dist/components/stepper/snice-stepper.js +9 -3
  279. package/dist/components/stepper/snice-stepper.js.map +1 -1
  280. package/dist/components/time-range-picker/snice-time-range-picker.d.ts +67 -0
  281. package/dist/components/time-range-picker/snice-time-range-picker.js +568 -0
  282. package/dist/components/time-range-picker/snice-time-range-picker.js.map +1 -0
  283. package/dist/components/time-range-picker/snice-time-range-picker.types.d.ts +39 -0
  284. package/dist/components/treemap/snice-treemap.d.ts +49 -0
  285. package/dist/components/treemap/snice-treemap.js +455 -0
  286. package/dist/components/treemap/snice-treemap.js.map +1 -0
  287. package/dist/components/treemap/snice-treemap.types.d.ts +42 -0
  288. package/dist/components/virtual-scroller/snice-virtual-scroller.d.ts +5 -0
  289. package/dist/components/virtual-scroller/snice-virtual-scroller.js +47 -16
  290. package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -1
  291. package/dist/index.cjs +1 -1
  292. package/dist/index.cjs.map +1 -1
  293. package/dist/index.esm.js +1 -1
  294. package/dist/index.esm.js.map +1 -1
  295. package/dist/index.iife.js +1 -1
  296. package/dist/index.iife.js.map +1 -1
  297. package/dist/symbols.cjs +1 -1
  298. package/dist/symbols.esm.js +1 -1
  299. package/dist/transitions.cjs +1 -1
  300. package/dist/transitions.esm.js +1 -1
  301. package/docs/ai/components/camera-annotate.md +82 -0
  302. package/docs/ai/components/candlestick.md +79 -0
  303. package/docs/ai/components/funnel.md +86 -0
  304. package/docs/ai/components/network-graph.md +87 -0
  305. package/docs/ai/components/sankey.md +63 -0
  306. package/docs/ai/components/time-range-picker.md +78 -0
  307. package/docs/ai/components/treemap.md +78 -0
  308. package/docs/components/camera-annotate.md +186 -0
  309. package/docs/components/candlestick.md +196 -0
  310. package/docs/components/funnel.md +191 -0
  311. package/docs/components/network-graph.md +215 -0
  312. package/docs/components/sankey.md +201 -0
  313. package/docs/components/time-range-picker.md +213 -0
  314. package/docs/components/treemap.md +198 -0
  315. package/package.json +1 -1
@@ -0,0 +1,215 @@
1
+ # Network Graph Component
2
+
3
+ The network graph component renders an SVG-based force-directed graph visualization for displaying relationships between nodes. It supports multiple layout algorithms, interactive zoom/pan, draggable nodes, and hover highlighting.
4
+
5
+ ## Table of Contents
6
+ - [Basic Usage](#basic-usage)
7
+ - [Properties](#properties)
8
+ - [Data Format](#data-format)
9
+ - [Events](#events)
10
+ - [Examples](#examples)
11
+ - [Accessibility](#accessibility)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ## Basic Usage
15
+
16
+ ```html
17
+ <snice-network-graph id="graph"></snice-network-graph>
18
+
19
+ <script type="module">
20
+ import 'snice/components/network-graph/snice-network-graph';
21
+
22
+ const graph = document.getElementById('graph');
23
+ graph.data = {
24
+ nodes: [
25
+ { id: 'alice', label: 'Alice', group: 'team-a' },
26
+ { id: 'bob', label: 'Bob', group: 'team-b' },
27
+ { id: 'carol', label: 'Carol', group: 'team-a' },
28
+ ],
29
+ edges: [
30
+ { source: 'alice', target: 'bob', label: 'collaborates' },
31
+ { source: 'bob', target: 'carol' },
32
+ { source: 'alice', target: 'carol' },
33
+ ],
34
+ };
35
+ </script>
36
+ ```
37
+
38
+ ## Properties
39
+
40
+ | Property | Type | Default | Attribute | Description |
41
+ |----------|------|---------|-----------|-------------|
42
+ | `data` | `NetworkGraphData` | `{ nodes: [], edges: [] }` | — | Graph data (set via JS property) |
43
+ | `layout` | `'force' \| 'circular' \| 'grid'` | `'force'` | `layout` | Layout algorithm |
44
+ | `chargeStrength` | `number` | `-300` | `charge-strength` | Repulsion force between nodes (negative = repel) |
45
+ | `linkDistance` | `number` | `80` | `link-distance` | Target distance between connected nodes |
46
+ | `zoomEnabled` | `boolean` | `true` | `zoom-enabled` | Enable mouse wheel zoom and background pan |
47
+ | `dragEnabled` | `boolean` | `true` | `drag-enabled` | Enable dragging nodes |
48
+ | `showLabels` | `boolean` | `true` | `show-labels` | Show text labels on nodes and edges |
49
+ | `animation` | `boolean` | `true` | `animation` | Animate force simulation |
50
+
51
+ ## Data Format
52
+
53
+ ### NetworkNode
54
+
55
+ | Field | Type | Required | Description |
56
+ |-------|------|----------|-------------|
57
+ | `id` | `string` | Yes | Unique identifier |
58
+ | `label` | `string` | No | Display label (falls back to `id`) |
59
+ | `group` | `string` | No | Group for automatic color coding |
60
+ | `size` | `number` | No | Custom circle radius (overrides degree-based sizing) |
61
+ | `color` | `string` | No | Custom fill color (overrides group color) |
62
+ | `x` | `number` | No | Fixed X position (pins node) |
63
+ | `y` | `number` | No | Fixed Y position (pins node) |
64
+
65
+ ### NetworkEdge
66
+
67
+ | Field | Type | Required | Description |
68
+ |-------|------|----------|-------------|
69
+ | `source` | `string` | Yes | Source node `id` |
70
+ | `target` | `string` | Yes | Target node `id` |
71
+ | `label` | `string` | No | Label displayed at edge midpoint |
72
+ | `weight` | `number` | No | Stroke width (default 1) |
73
+ | `color` | `string` | No | Custom stroke color |
74
+
75
+ ## Events
76
+
77
+ | Event | Detail | Description |
78
+ |-------|--------|-------------|
79
+ | `@snice/node-click` | `{ node: NetworkNode }` | Node clicked |
80
+ | `@snice/edge-click` | `{ edge: NetworkEdge }` | Edge clicked |
81
+ | `@snice/node-drag` | `{ node: NetworkNode, x: number, y: number }` | Node dragged to new position |
82
+ | `@snice/graph-zoom` | `{ scale: number, x: number, y: number }` | Zoom level changed |
83
+
84
+ ## Examples
85
+
86
+ ### Layout Types
87
+
88
+ ```html
89
+ <!-- Force-directed (default) -->
90
+ <snice-network-graph id="force" layout="force"></snice-network-graph>
91
+
92
+ <!-- Circular arrangement -->
93
+ <snice-network-graph id="circular" layout="circular"></snice-network-graph>
94
+
95
+ <!-- Grid arrangement -->
96
+ <snice-network-graph id="grid" layout="grid"></snice-network-graph>
97
+ ```
98
+
99
+ ### Custom Node Sizes and Colors
100
+
101
+ ```html
102
+ <snice-network-graph id="custom-graph"></snice-network-graph>
103
+
104
+ <script type="module">
105
+ document.getElementById('custom-graph').data = {
106
+ nodes: [
107
+ { id: 'server', label: 'Server', size: 20, color: 'rgb(220 38 38)' },
108
+ { id: 'db', label: 'Database', size: 16, color: 'rgb(37 99 235)' },
109
+ { id: 'client', label: 'Client', size: 10, color: 'rgb(22 163 74)' },
110
+ ],
111
+ edges: [
112
+ { source: 'client', target: 'server', weight: 2 },
113
+ { source: 'server', target: 'db', label: 'queries', weight: 4, color: 'rgb(37 99 235)' },
114
+ ],
115
+ };
116
+ </script>
117
+ ```
118
+
119
+ ### Group-Based Coloring
120
+
121
+ Nodes with the same `group` value are automatically assigned the same color from a 10-color palette.
122
+
123
+ ```javascript
124
+ graph.data = {
125
+ nodes: [
126
+ { id: 'a', group: 'frontend' },
127
+ { id: 'b', group: 'backend' },
128
+ { id: 'c', group: 'frontend' }, // same color as 'a'
129
+ ],
130
+ edges: [
131
+ { source: 'a', target: 'b' },
132
+ { source: 'b', target: 'c' },
133
+ ],
134
+ };
135
+ ```
136
+
137
+ ### Tuning the Force Simulation
138
+
139
+ ```html
140
+ <!-- Stronger repulsion, longer links -->
141
+ <snice-network-graph charge-strength="-500" link-distance="120"></snice-network-graph>
142
+
143
+ <!-- Weaker repulsion, tighter clustering -->
144
+ <snice-network-graph charge-strength="-100" link-distance="50"></snice-network-graph>
145
+ ```
146
+
147
+ ### Pinned Nodes
148
+
149
+ Provide `x` and `y` on nodes to pin them at fixed positions. Double-click a dragged node to unpin it.
150
+
151
+ ```javascript
152
+ graph.data = {
153
+ nodes: [
154
+ { id: 'fixed', label: 'Pinned', x: 300, y: 200 },
155
+ { id: 'free', label: 'Free' },
156
+ ],
157
+ edges: [{ source: 'fixed', target: 'free' }],
158
+ };
159
+ ```
160
+
161
+ ### Listening to Events
162
+
163
+ ```javascript
164
+ graph.addEventListener('@snice/node-click', (e) => {
165
+ console.log('Clicked:', e.detail.node.label);
166
+ });
167
+
168
+ graph.addEventListener('@snice/node-drag', (e) => {
169
+ console.log(`Dragged ${e.detail.node.id} to (${e.detail.x}, ${e.detail.y})`);
170
+ });
171
+
172
+ graph.addEventListener('@snice/graph-zoom', (e) => {
173
+ console.log('Zoom:', e.detail.scale);
174
+ });
175
+ ```
176
+
177
+ ### Disabling Interaction
178
+
179
+ ```html
180
+ <!-- Static display, no drag or zoom -->
181
+ <snice-network-graph zoom-enabled="false" drag-enabled="false"></snice-network-graph>
182
+ ```
183
+
184
+ ## Interaction
185
+
186
+ - **Drag nodes**: Click and drag any node to reposition it. The node becomes pinned.
187
+ - **Unpin nodes**: Double-click a pinned node to release it back to the simulation.
188
+ - **Pan**: Click and drag on the background to pan the view.
189
+ - **Zoom**: Use the mouse wheel to zoom in/out, centered on the cursor.
190
+ - **Hover**: Hovering a node highlights its connected subgraph and dims unconnected nodes.
191
+ - **Tooltips**: Hovering shows a tooltip with the node label and connection count.
192
+
193
+ ## Accessibility
194
+
195
+ - Container has `role="img"` with `aria-label="Network graph visualization"`
196
+ - Keyboard navigation is not currently supported (future enhancement)
197
+ - Color is not the sole indicator of grouping when labels are shown
198
+
199
+ ## Browser Support
200
+
201
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
202
+ - Requires Custom Elements v1 and Shadow DOM support
203
+
204
+ ## Best Practices
205
+
206
+ 1. **Set a height**: The component needs a height set via CSS (e.g., `height: 500px`) since it uses `contain: layout style paint`
207
+ 2. **Use groups for automatic coloring**: The 10-color palette handles most use cases
208
+ 3. **Label important nodes**: Labels provide context beyond color
209
+ 4. **Tune simulation parameters**: Adjust `charge-strength` and `link-distance` for your data density
210
+ 5. **Use weight for edge importance**: Heavier edges appear thicker
211
+ 6. **Pin key nodes**: Use `x`/`y` to anchor important nodes
212
+ 7. **Disable animation for static layouts**: Set `animation="false"` for circular/grid layouts
213
+ 8. **Keep graph sizes reasonable**: Performance is best with under 200 nodes
214
+ 9. **Listen to events**: Use node-click and edge-click for interactive dashboards
215
+ 10. **Test in both themes**: Colors and borders adapt to light/dark mode
@@ -0,0 +1,201 @@
1
+ # Sankey Component
2
+
3
+ The sankey component renders an SVG-based Sankey diagram for visualizing flow between categories. It shows nodes connected by curved links, where link width is proportional to flow value. Ideal for energy flows, budget breakdowns, user journeys, and conversion funnels.
4
+
5
+ ## Table of Contents
6
+ - [Basic Usage](#basic-usage)
7
+ - [Properties](#properties)
8
+ - [Events](#events)
9
+ - [Types](#types)
10
+ - [Examples](#examples)
11
+ - [Accessibility](#accessibility)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ## Basic Usage
15
+
16
+ ```html
17
+ <snice-sankey id="my-sankey" show-labels show-values></snice-sankey>
18
+
19
+ <script type="module">
20
+ import 'snice/components/sankey/snice-sankey';
21
+
22
+ document.getElementById('my-sankey').data = {
23
+ nodes: [
24
+ { id: 'source', label: 'Source', color: '#2196f3' },
25
+ { id: 'target', label: 'Target', color: '#4caf50' }
26
+ ],
27
+ links: [
28
+ { source: 'source', target: 'target', value: 100 }
29
+ ]
30
+ };
31
+ </script>
32
+ ```
33
+
34
+ ## Properties
35
+
36
+ | Property | Type | Default | Description |
37
+ |----------|------|---------|-------------|
38
+ | `data` | `SankeyData` | `{ nodes: [], links: [] }` | Data containing nodes and links |
39
+ | `nodeWidth` | `number` | `20` | Width of node rectangles in pixels |
40
+ | `nodePadding` | `number` | `10` | Vertical padding between nodes in pixels |
41
+ | `alignment` | `'left' \| 'right' \| 'center' \| 'justify'` | `'justify'` | How leaf nodes are aligned |
42
+ | `showLabels` | `boolean` | `true` | Whether to show node labels |
43
+ | `showValues` | `boolean` | `true` | Whether to show node values |
44
+ | `animation` | `boolean` | `false` | Whether to animate on initial render |
45
+
46
+ ## Events
47
+
48
+ | Event | Detail | Description |
49
+ |-------|--------|-------------|
50
+ | `@snice/sankey-node-click` | `{ node: SankeyNode }` | Fired when a node is clicked |
51
+ | `@snice/sankey-link-click` | `{ link: SankeyLink }` | Fired when a link is clicked |
52
+ | `@snice/sankey-hover` | `{ type: 'node' \| 'link', item: SankeyNode \| SankeyLink } \| null` | Fired when hover state changes |
53
+
54
+ ## Types
55
+
56
+ ```typescript
57
+ interface SankeyData {
58
+ nodes: SankeyNode[];
59
+ links: SankeyLink[];
60
+ }
61
+
62
+ interface SankeyNode {
63
+ id: string; // Unique identifier
64
+ label?: string; // Display label (defaults to id)
65
+ color?: string; // Node color (auto-assigned if omitted)
66
+ }
67
+
68
+ interface SankeyLink {
69
+ source: string; // Source node id
70
+ target: string; // Target node id
71
+ value: number; // Flow value (determines link width)
72
+ color?: string; // Link color (defaults to source node color)
73
+ }
74
+ ```
75
+
76
+ ## Examples
77
+
78
+ ### Energy Flow
79
+
80
+ ```html
81
+ <snice-sankey id="energy" show-labels show-values animation style="height: 400px;"></snice-sankey>
82
+
83
+ <script type="module">
84
+ document.getElementById('energy').data = {
85
+ nodes: [
86
+ { id: 'solar', label: 'Solar', color: '#f59e0b' },
87
+ { id: 'wind', label: 'Wind', color: '#3b82f6' },
88
+ { id: 'electric', label: 'Electricity', color: '#8b5cf6' },
89
+ { id: 'residential', label: 'Residential', color: '#10b981' },
90
+ { id: 'commercial', label: 'Commercial', color: '#06b6d4' }
91
+ ],
92
+ links: [
93
+ { source: 'solar', target: 'electric', value: 120 },
94
+ { source: 'wind', target: 'electric', value: 90 },
95
+ { source: 'electric', target: 'residential', value: 130 },
96
+ { source: 'electric', target: 'commercial', value: 80 }
97
+ ]
98
+ };
99
+ </script>
100
+ ```
101
+
102
+ ### Budget Breakdown
103
+
104
+ ```html
105
+ <snice-sankey id="budget" show-labels show-values style="height: 300px;"></snice-sankey>
106
+
107
+ <script type="module">
108
+ document.getElementById('budget').data = {
109
+ nodes: [
110
+ { id: 'salary', label: 'Salary', color: '#10b981' },
111
+ { id: 'housing', label: 'Housing', color: '#ef4444' },
112
+ { id: 'food', label: 'Food', color: '#f59e0b' },
113
+ { id: 'savings', label: 'Savings', color: '#06b6d4' }
114
+ ],
115
+ links: [
116
+ { source: 'salary', target: 'housing', value: 1500 },
117
+ { source: 'salary', target: 'food', value: 600 },
118
+ { source: 'salary', target: 'savings', value: 900 }
119
+ ]
120
+ };
121
+ </script>
122
+ ```
123
+
124
+ ### With Event Handling
125
+
126
+ ```html
127
+ <snice-sankey id="clickable" show-labels style="height: 300px;"></snice-sankey>
128
+ <div id="output"></div>
129
+
130
+ <script type="module">
131
+ const sankey = document.getElementById('clickable');
132
+ const output = document.getElementById('output');
133
+
134
+ sankey.data = {
135
+ nodes: [
136
+ { id: 'a', label: 'Source A' },
137
+ { id: 'b', label: 'Source B' },
138
+ { id: 'c', label: 'Target C' }
139
+ ],
140
+ links: [
141
+ { source: 'a', target: 'c', value: 50 },
142
+ { source: 'b', target: 'c', value: 30 }
143
+ ]
144
+ };
145
+
146
+ sankey.addEventListener('@snice/sankey-node-click', (e) => {
147
+ output.textContent = `Clicked node: ${e.detail.node.label}`;
148
+ });
149
+
150
+ sankey.addEventListener('@snice/sankey-link-click', (e) => {
151
+ output.textContent = `Clicked link: ${e.detail.link.source} -> ${e.detail.link.target}`;
152
+ });
153
+ </script>
154
+ ```
155
+
156
+ ### Custom Node Width and Padding
157
+
158
+ ```html
159
+ <snice-sankey id="custom" node-width="30" node-padding="20" show-labels style="height: 300px;"></snice-sankey>
160
+ ```
161
+
162
+ ### Alignment Options
163
+
164
+ ```html
165
+ <!-- Left-aligned (sources at left) -->
166
+ <snice-sankey alignment="left" show-labels></snice-sankey>
167
+
168
+ <!-- Right-aligned (sinks at right) -->
169
+ <snice-sankey alignment="right" show-labels></snice-sankey>
170
+
171
+ <!-- Center-aligned (isolated nodes centered) -->
172
+ <snice-sankey alignment="center" show-labels></snice-sankey>
173
+
174
+ <!-- Justified (default, sinks pushed to right) -->
175
+ <snice-sankey alignment="justify" show-labels></snice-sankey>
176
+ ```
177
+
178
+ ## Accessibility
179
+
180
+ - **ARIA role**: The diagram container has `role="img"` for screen reader support
181
+ - **ARIA label**: `aria-label="Sankey diagram"` describes the visualization
182
+ - **Keyboard navigation**: Nodes and links are interactive via click events
183
+ - **Hover feedback**: Visual dimming of non-connected elements on hover
184
+ - **Color independence**: Labels and values provide non-color context
185
+
186
+ ## Browser Support
187
+
188
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
189
+ - Requires Custom Elements v1, Shadow DOM, and SVG support
190
+ - Uses ResizeObserver for responsive sizing
191
+
192
+ ## Best Practices
193
+
194
+ 1. **Set explicit height**: The component needs a defined height (via CSS or style attribute) since it uses `display: block`
195
+ 2. **Provide labels**: Always include `label` on nodes for clarity
196
+ 3. **Use meaningful colors**: Assign colors that distinguish categories; auto-colors work for quick prototyping
197
+ 4. **Keep data manageable**: Sankey diagrams work best with 5-20 nodes and clear flow direction
198
+ 5. **Enable animation**: Use `animation` for initial presentation or when data changes
199
+ 6. **Handle events**: Use click events for drill-down or detail views
200
+ 7. **Responsive layout**: The component automatically resizes via ResizeObserver
201
+ 8. **Test dark mode**: The component uses theme variables with fallbacks for both themes
@@ -0,0 +1,213 @@
1
+ # Time Range Picker
2
+
3
+ The `<snice-time-range-picker>` component provides a vertically stacked time slot picker for selecting time ranges within a single day. Users can click and drag to select contiguous time ranges, or click individual slots.
4
+
5
+ ## Basic Usage
6
+
7
+ ```html
8
+ <snice-time-range-picker
9
+ start-time="08:00"
10
+ end-time="18:00">
11
+ </snice-time-range-picker>
12
+ ```
13
+
14
+ ## Properties
15
+
16
+ | Property | Attribute | Type | Default | Description |
17
+ |----------|-----------|------|---------|-------------|
18
+ | `granularity` | `granularity` | `5 \| 15 \| 30 \| 60` | `15` | Time interval in minutes for each slot |
19
+ | `startTime` | `start-time` | `string` | `'00:00'` | Start time of the day in HH:MM format |
20
+ | `endTime` | `end-time` | `string` | `'23:59'` | End time of the day in HH:MM format |
21
+ | `value` | `value` | `string` | `''` | JSON string of selected time ranges |
22
+ | `disabledRanges` | `disabled-ranges` | `string` | `''` | JSON string of disabled time ranges |
23
+ | `format` | `format` | `'12h' \| '24h'` | `'24h'` | Time display format |
24
+ | `multiple` | `multiple` | `boolean` | `false` | Allow multiple non-contiguous range selections |
25
+ | `readonly` | `readonly` | `boolean` | `false` | Prevent interaction but show selections |
26
+ | `disabled` | `disabled` | `boolean` | `false` | Disable all interaction |
27
+
28
+ ## Time Range Format
29
+
30
+ Both `value` and `disabled-ranges` use JSON arrays of time range objects:
31
+
32
+ ```typescript
33
+ interface TimeRange {
34
+ start: string; // "HH:MM" format
35
+ end: string; // "HH:MM" format
36
+ }
37
+ ```
38
+
39
+ Example:
40
+ ```json
41
+ [{"start": "09:00", "end": "11:00"}, {"start": "14:00", "end": "16:00"}]
42
+ ```
43
+
44
+ ## Events
45
+
46
+ ### `@snice/time-range-change`
47
+
48
+ Fired when the selection changes.
49
+
50
+ ```javascript
51
+ picker.addEventListener('@snice/time-range-change', (e) => {
52
+ console.log('Selected ranges:', e.detail.ranges);
53
+ // [{start: "09:00", end: "10:30"}, ...]
54
+ });
55
+ ```
56
+
57
+ **Detail:**
58
+ - `ranges` - Array of selected `TimeRange` objects
59
+ - `component` - Reference to the picker element
60
+
61
+ ### `@snice/time-range-select`
62
+
63
+ Fired when a drag selection begins.
64
+
65
+ ```javascript
66
+ picker.addEventListener('@snice/time-range-select', (e) => {
67
+ console.log('Drag started at:', e.detail.start);
68
+ });
69
+ ```
70
+
71
+ **Detail:**
72
+ - `start` - The time where dragging started
73
+ - `component` - Reference to the picker element
74
+
75
+ ### `@snice/time-range-complete`
76
+
77
+ Fired when a drag selection completes.
78
+
79
+ ```javascript
80
+ picker.addEventListener('@snice/time-range-complete', (e) => {
81
+ console.log('Completed range:', e.detail.range);
82
+ console.log('All ranges:', e.detail.ranges);
83
+ });
84
+ ```
85
+
86
+ **Detail:**
87
+ - `range` - The just-completed `TimeRange`
88
+ - `ranges` - All currently selected ranges
89
+ - `component` - Reference to the picker element
90
+
91
+ ## Methods
92
+
93
+ ### `getSelectedRanges(): TimeRange[]`
94
+
95
+ Returns an array of currently selected time ranges.
96
+
97
+ ```javascript
98
+ const ranges = picker.getSelectedRanges();
99
+ // [{start: "09:00", end: "10:30"}]
100
+ ```
101
+
102
+ ### `setSelectedRanges(ranges: TimeRange[]): void`
103
+
104
+ Programmatically sets the selected time ranges.
105
+
106
+ ```javascript
107
+ picker.setSelectedRanges([
108
+ { start: '09:00', end: '11:00' },
109
+ { start: '14:00', end: '16:00' }
110
+ ]);
111
+ ```
112
+
113
+ ### `clearSelection(): void`
114
+
115
+ Clears all selected time ranges.
116
+
117
+ ```javascript
118
+ picker.clearSelection();
119
+ ```
120
+
121
+ ### `isSlotDisabled(time: string): boolean`
122
+
123
+ Checks if a specific time slot is disabled.
124
+
125
+ ```javascript
126
+ picker.isSlotDisabled('12:00'); // true if in disabled ranges
127
+ ```
128
+
129
+ ## Examples
130
+
131
+ ### Appointment Booking
132
+
133
+ ```html
134
+ <snice-time-range-picker
135
+ granularity="30"
136
+ format="12h"
137
+ start-time="08:00"
138
+ end-time="18:00"
139
+ disabled-ranges='[{"start":"12:00","end":"13:00"}]'>
140
+ </snice-time-range-picker>
141
+ ```
142
+
143
+ ### Working Hours Configuration
144
+
145
+ ```html
146
+ <snice-time-range-picker
147
+ multiple
148
+ granularity="60"
149
+ start-time="06:00"
150
+ end-time="22:00">
151
+ </snice-time-range-picker>
152
+ ```
153
+
154
+ ### Fine-Grained Scheduling
155
+
156
+ ```html
157
+ <snice-time-range-picker
158
+ granularity="5"
159
+ start-time="09:00"
160
+ end-time="10:00">
161
+ </snice-time-range-picker>
162
+ ```
163
+
164
+ ### Pre-selected Schedule
165
+
166
+ ```html
167
+ <snice-time-range-picker
168
+ granularity="30"
169
+ format="12h"
170
+ start-time="08:00"
171
+ end-time="18:00"
172
+ value='[{"start":"09:00","end":"11:30"},{"start":"14:00","end":"16:30"}]'
173
+ multiple>
174
+ </snice-time-range-picker>
175
+ ```
176
+
177
+ ## Interaction
178
+
179
+ ### Mouse
180
+ - **Click** a slot to select it individually
181
+ - **Click and drag** across slots to select a contiguous range
182
+ - In multiple mode, existing selections are preserved when adding new ranges
183
+
184
+ ### Touch
185
+ - **Tap** a slot to select it
186
+ - **Touch and drag** to select a range
187
+
188
+ ### Keyboard
189
+ - **Enter / Space** - Toggle selection of focused slot
190
+ - **Arrow Up / Down** - Navigate between slots
191
+ - **Escape** - Clear all selections
192
+
193
+ ## Accessibility
194
+
195
+ - Each slot has `role="option"` with appropriate `aria-selected` and `aria-disabled` attributes
196
+ - Keyboard-navigable with visible focus indicators
197
+ - Disabled slots have `tabindex="-1"` and are skipped during keyboard navigation
198
+
199
+ ## Styling
200
+
201
+ The component uses CSS custom properties from the Snice theme system:
202
+
203
+ | Variable | Usage |
204
+ |----------|-------|
205
+ | `--snice-color-primary` | Selected slot background |
206
+ | `--snice-color-text-inverse` | Selected slot text |
207
+ | `--snice-color-border` | Slot borders |
208
+ | `--snice-color-background` | Component background |
209
+ | `--snice-color-background-element` | Disabled slot background / hover |
210
+ | `--snice-color-text-tertiary` | Disabled slot text |
211
+ | `--snice-font-family` | Font family |
212
+
213
+ All values include fallbacks for use without the theme loaded.