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,186 @@
1
+ # Camera Annotate Component
2
+
3
+ The camera annotate component combines camera capture with freehand drawing and labeled annotations. It provides a workflow for taking pictures, drawing shapes on them, and adding descriptive labels to each annotation.
4
+
5
+ ## Table of Contents
6
+ - [Basic Usage](#basic-usage)
7
+ - [Properties](#properties)
8
+ - [Methods](#methods)
9
+ - [Events](#events)
10
+ - [Examples](#examples)
11
+ - [Annotation Workflow](#annotation-workflow)
12
+ - [Accessibility](#accessibility)
13
+ - [Best Practices](#best-practices)
14
+
15
+ ## Basic Usage
16
+
17
+ ```html
18
+ <snice-camera-annotate></snice-camera-annotate>
19
+ ```
20
+
21
+ ```typescript
22
+ import 'snice/components/camera-annotate/snice-camera-annotate';
23
+ ```
24
+
25
+ ## Properties
26
+
27
+ | Property | Type | Default | Description |
28
+ |----------|------|---------|-------------|
29
+ | `mode` | `'camera' \| 'annotate'` | `'camera'` | Current mode of the component |
30
+ | `auto-rotate-colors` | `boolean` | `true` | Automatically cycle through preset colors for each new annotation |
31
+ | `show-labels-panel` | `boolean` | `true` | Show the sidebar panel with annotation labels |
32
+
33
+ ## Methods
34
+
35
+ | Method | Return Type | Description |
36
+ |--------|-------------|-------------|
37
+ | `capture()` | `Promise<void>` | Capture current camera frame and switch to annotate mode |
38
+ | `exportImage(options?)` | `string` | Export annotated image as data URL. Options: `{ includeLabels?: boolean }` |
39
+ | `exportAnnotations()` | `AnnotationData` | Export all annotation data as a serializable object |
40
+ | `importAnnotations(data)` | `void` | Load annotation data from a previously exported object |
41
+ | `clearAnnotations()` | `void` | Remove all annotations and strokes |
42
+
43
+ ## Events
44
+
45
+ | Event | Detail | Description |
46
+ |-------|--------|-------------|
47
+ | `@snice/capture` | `{ dataURL, width, height }` | Fired when an image is captured from the camera |
48
+ | `@snice/annotate` | `{ annotation }` | Fired when a new annotation (shape) is drawn |
49
+ | `@snice/annotation-change` | `{ annotations }` | Fired when annotations are modified (add, remove, visibility, label) |
50
+
51
+ ## Examples
52
+
53
+ ### Default Camera Annotator
54
+
55
+ ```html
56
+ <snice-camera-annotate></snice-camera-annotate>
57
+ ```
58
+
59
+ ### Without Labels Panel
60
+
61
+ ```html
62
+ <snice-camera-annotate show-labels-panel="false"></snice-camera-annotate>
63
+ ```
64
+
65
+ ### Manual Color Selection
66
+
67
+ ```html
68
+ <snice-camera-annotate auto-rotate-colors="false"></snice-camera-annotate>
69
+ ```
70
+
71
+ ### Listening to Events
72
+
73
+ ```html
74
+ <snice-camera-annotate id="annotator"></snice-camera-annotate>
75
+
76
+ <script type="module">
77
+ const annotator = document.getElementById('annotator');
78
+
79
+ annotator.addEventListener('@snice/capture', (e) => {
80
+ console.log('Captured:', e.detail.width, 'x', e.detail.height);
81
+ });
82
+
83
+ annotator.addEventListener('@snice/annotate', (e) => {
84
+ console.log('New annotation:', e.detail.annotation.id);
85
+ });
86
+
87
+ annotator.addEventListener('@snice/annotation-change', (e) => {
88
+ console.log('Total annotations:', e.detail.annotations.length);
89
+ });
90
+ </script>
91
+ ```
92
+
93
+ ### Save and Load Annotations
94
+
95
+ ```html
96
+ <snice-camera-annotate id="annotator"></snice-camera-annotate>
97
+
98
+ <script type="module">
99
+ const annotator = document.getElementById('annotator');
100
+
101
+ // Save
102
+ function saveAnnotations() {
103
+ const data = annotator.exportAnnotations();
104
+ localStorage.setItem('annotations', JSON.stringify(data));
105
+ }
106
+
107
+ // Load
108
+ function loadAnnotations() {
109
+ const json = localStorage.getItem('annotations');
110
+ if (json) {
111
+ annotator.importAnnotations(JSON.parse(json));
112
+ }
113
+ }
114
+ </script>
115
+ ```
116
+
117
+ ### Export Image
118
+
119
+ ```html
120
+ <snice-camera-annotate id="annotator"></snice-camera-annotate>
121
+ <button onclick="downloadImage()">Download</button>
122
+
123
+ <script type="module">
124
+ function downloadImage() {
125
+ const annotator = document.getElementById('annotator');
126
+
127
+ // Without labels on the image
128
+ const imageOnly = annotator.exportImage();
129
+
130
+ // With labels rendered on the image
131
+ const withLabels = annotator.exportImage({ includeLabels: true });
132
+
133
+ // Download
134
+ const a = document.createElement('a');
135
+ a.href = withLabels;
136
+ a.download = 'annotated.png';
137
+ a.click();
138
+ }
139
+ </script>
140
+ ```
141
+
142
+ ## Annotation Workflow
143
+
144
+ 1. **Camera Mode**: The component starts showing a live camera feed
145
+ 2. **Capture**: Click the "Capture" button to take a photo
146
+ 3. **Annotate Mode**: Draw shapes on the captured image using freehand strokes
147
+ 4. **Label**: Type labels for each annotation in the sidebar
148
+ 5. **Manage**: Show/hide individual annotations, toggle all, or delete specific ones
149
+ 6. **Export**: Save annotation data as JSON or export the annotated image
150
+ 7. **Retake**: Click "Retake" to return to camera mode and start fresh
151
+
152
+ ### Color System
153
+
154
+ - **Preset Palette**: 12 preset colors displayed as swatches in the sidebar
155
+ - **Auto Rotate**: When enabled (default), each new annotation automatically gets the next color from the palette
156
+ - **Manual Selection**: Click any color swatch to set the active drawing color
157
+
158
+ ### Visual Highlighting
159
+
160
+ When you hover over an annotation label in the sidebar:
161
+ - The corresponding shape is highlighted at full opacity
162
+ - All other shapes dim to 20% opacity with a grayscale filter
163
+ - This makes it easy to identify which shape belongs to which label
164
+
165
+ ## Accessibility
166
+
167
+ - Color swatches have title attributes showing the hex value
168
+ - Annotation visibility toggles have descriptive title text
169
+ - Delete buttons have clear title labels
170
+ - The sidebar scrolls independently when annotations exceed available space
171
+
172
+ ## Browser Support
173
+
174
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
175
+ - Requires camera access via `getUserMedia`
176
+ - Requires Custom Elements v1 and Shadow DOM support
177
+
178
+ ## Best Practices
179
+
180
+ 1. **Grant camera permissions**: Ensure users have allowed camera access for the capture workflow
181
+ 2. **Add labels promptly**: Label annotations as you draw them for better organization
182
+ 3. **Use auto-rotate colors**: Keeps annotations visually distinct without manual color selection
183
+ 4. **Export regularly**: Save annotation data to prevent loss on page refresh
184
+ 5. **Use the sidebar**: Hovering labels helps verify which shape corresponds to which annotation
185
+ 6. **Clear before starting fresh**: Use clearAnnotations() or "Retake" to reset
186
+ 7. **Export with labels**: When sharing annotated images, include labels for context
@@ -0,0 +1,196 @@
1
+ # Candlestick Chart Component
2
+
3
+ The candlestick chart component renders an SVG-based OHLC (Open-High-Low-Close) financial chart, commonly used for stock market and cryptocurrency price visualization. It supports volume bars, crosshair overlay, zoom/pan, tooltips, and responsive sizing.
4
+
5
+ ## Table of Contents
6
+ - [Basic Usage](#basic-usage)
7
+ - [Properties](#properties)
8
+ - [Methods](#methods)
9
+ - [Events](#events)
10
+ - [Examples](#examples)
11
+ - [Accessibility](#accessibility)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ## Basic Usage
15
+
16
+ ```html
17
+ <snice-candlestick id="chart"></snice-candlestick>
18
+
19
+ <script type="module">
20
+ import 'snice/components/candlestick/snice-candlestick';
21
+
22
+ const chart = document.getElementById('chart');
23
+ chart.data = [
24
+ { date: '2024-01-01', open: 100, high: 110, low: 95, close: 105, volume: 500000 },
25
+ { date: '2024-01-02', open: 105, high: 115, low: 100, close: 98, volume: 600000 },
26
+ { date: '2024-01-03', open: 98, high: 108, low: 93, close: 107, volume: 450000 },
27
+ ];
28
+ </script>
29
+ ```
30
+
31
+ ## Properties
32
+
33
+ | Property | Type | Default | Description |
34
+ |----------|------|---------|-------------|
35
+ | `data` | `CandleData[]` | `[]` | Array of candlestick data points |
36
+ | `show-volume` | `boolean` | `false` | Show volume bars below the price chart |
37
+ | `show-grid` | `boolean` | `true` | Show horizontal grid lines |
38
+ | `show-crosshair` | `boolean` | `true` | Show crosshair overlay on hover |
39
+ | `bullish-color` | `string` | `''` | Custom color for bullish candles (close >= open) |
40
+ | `bearish-color` | `string` | `''` | Custom color for bearish candles (close < open) |
41
+ | `time-format` | `string` | `'auto'` | Date format: `'auto'`, `'date'`, `'time'`, `'datetime'`, `'month'`, `'year'` |
42
+ | `y-axis-format` | `string` | `'number'` | Y-axis format: `'number'`, `'currency'`, `'percent'` |
43
+ | `zoom-enabled` | `boolean` | `true` | Enable scroll-to-zoom and drag-to-pan |
44
+ | `animation` | `boolean` | `true` | Animate candle appearance on data change |
45
+
46
+ ### CandleData Interface
47
+
48
+ ```typescript
49
+ interface CandleData {
50
+ date: string | number | Date; // Timestamp or date string
51
+ open: number; // Opening price
52
+ high: number; // Highest price
53
+ low: number; // Lowest price
54
+ close: number; // Closing price
55
+ volume?: number; // Trading volume (optional)
56
+ }
57
+ ```
58
+
59
+ ## Methods
60
+
61
+ | Method | Signature | Description |
62
+ |--------|-----------|-------------|
63
+ | `resetZoom()` | `() => void` | Reset zoom to show all data points |
64
+ | `zoomTo()` | `(startIndex: number, endIndex: number) => void` | Zoom to a specific index range |
65
+
66
+ ## Events
67
+
68
+ | Event | Detail | Description |
69
+ |-------|--------|-------------|
70
+ | `@snice/candle-click` | `{ candle: CandleData, index: number }` | A candle was clicked |
71
+ | `@snice/candle-hover` | `{ candle: CandleData, index: number }` | Mouse entered a candle |
72
+ | `@snice/crosshair-move` | `{ price: number, date: string, x: number, y: number }` | Crosshair position changed |
73
+
74
+ ## Examples
75
+
76
+ ### With Volume Bars
77
+
78
+ ```html
79
+ <snice-candlestick id="vol-chart" show-volume></snice-candlestick>
80
+ ```
81
+
82
+ ### Custom Colors
83
+
84
+ ```html
85
+ <snice-candlestick bullish-color="#0088ff" bearish-color="#ff6600"></snice-candlestick>
86
+ ```
87
+
88
+ ### Currency Format (Stock Prices)
89
+
90
+ ```html
91
+ <snice-candlestick id="stock-chart" y-axis-format="currency" show-volume></snice-candlestick>
92
+
93
+ <script>
94
+ stockChart.data = [
95
+ { date: '2024-01-02', open: 42500, high: 42850, low: 42200, close: 42700, volume: 15000000 },
96
+ // ...
97
+ ];
98
+ </script>
99
+ ```
100
+
101
+ ### Minimal (No Grid, No Crosshair)
102
+
103
+ ```html
104
+ <snice-candlestick show-grid="false" show-crosshair="false"></snice-candlestick>
105
+ ```
106
+
107
+ ### Zoom Controls
108
+
109
+ ```html
110
+ <button onclick="chart.resetZoom()">Reset Zoom</button>
111
+ <button onclick="chart.zoomTo(0, 30)">First 30 Days</button>
112
+ <snice-candlestick id="chart" zoom-enabled></snice-candlestick>
113
+ ```
114
+
115
+ ### Listening to Events
116
+
117
+ ```html
118
+ <snice-candlestick id="chart"></snice-candlestick>
119
+
120
+ <script>
121
+ chart.addEventListener('@snice/candle-click', (e) => {
122
+ console.log('Clicked candle:', e.detail.candle);
123
+ console.log('Index:', e.detail.index);
124
+ });
125
+
126
+ chart.addEventListener('@snice/crosshair-move', (e) => {
127
+ console.log('Price at cursor:', e.detail.price);
128
+ console.log('Date at cursor:', e.detail.date);
129
+ });
130
+ </script>
131
+ ```
132
+
133
+ ### Dynamic Data Updates
134
+
135
+ ```html
136
+ <snice-candlestick id="live-chart" show-volume></snice-candlestick>
137
+
138
+ <script>
139
+ // Add new candle every 5 seconds
140
+ setInterval(() => {
141
+ const data = [...liveChart.data];
142
+ const last = data[data.length - 1];
143
+ const change = (Math.random() - 0.5) * 10;
144
+ const open = last.close;
145
+ const close = open + change;
146
+ data.push({
147
+ date: new Date(),
148
+ open,
149
+ high: Math.max(open, close) + Math.random() * 3,
150
+ low: Math.min(open, close) - Math.random() * 3,
151
+ close,
152
+ volume: Math.floor(Math.random() * 1000000)
153
+ });
154
+ liveChart.data = data;
155
+ }, 5000);
156
+ </script>
157
+ ```
158
+
159
+ ## CSS Custom Properties
160
+
161
+ | Property | Default | Description |
162
+ |----------|---------|-------------|
163
+ | `--snice-candlestick-bullish` | `rgb(22 163 74)` (green) | Bullish candle color |
164
+ | `--snice-candlestick-bearish` | `rgb(220 38 38)` (red) | Bearish candle color |
165
+
166
+ You can also override colors globally using these CSS custom properties:
167
+
168
+ ```css
169
+ snice-candlestick {
170
+ --snice-candlestick-bullish: #26a69a;
171
+ --snice-candlestick-bearish: #ef5350;
172
+ }
173
+ ```
174
+
175
+ ## Accessibility
176
+
177
+ - **ARIA role**: The SVG has `role="img"` for screen reader identification
178
+ - **ARIA label**: Includes data point count in `aria-label`
179
+ - **Keyboard**: Zoom and pan are mouse-driven; use `resetZoom()` and `zoomTo()` methods for programmatic control
180
+ - **Color contrast**: Default bullish (green) and bearish (red) colors meet WCAG AA standards
181
+
182
+ ## Browser Support
183
+
184
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
185
+ - Requires Custom Elements v1 and Shadow DOM support
186
+
187
+ ## Best Practices
188
+
189
+ 1. **Set data via property**: Data is an array of objects, set via JavaScript (`chart.data = [...]`), not as an HTML attribute
190
+ 2. **Include volume data**: Even if not displayed, volume data enriches tooltips
191
+ 3. **Use appropriate time formats**: Match `time-format` to your data granularity (intraday = `'time'`, daily = `'date'`, monthly = `'month'`)
192
+ 4. **Give the chart height**: The component needs an explicit height (set via CSS or a container)
193
+ 5. **Limit visible candles**: For large datasets, the chart auto-limits visible candles; use `zoomTo()` for specific ranges
194
+ 6. **Handle events**: Use `@snice/candle-click` for drill-down, `@snice/crosshair-move` for real-time price readout
195
+ 7. **Custom colors**: Use `bullish-color` / `bearish-color` or CSS custom properties for theme integration
196
+ 8. **Responsive**: The chart uses `ResizeObserver` and redraws on container resize
@@ -0,0 +1,191 @@
1
+ # Funnel Component
2
+
3
+ The funnel component renders an SVG-based funnel/conversion chart, ideal for visualizing pipeline stages, conversion funnels, and drop-off analysis. Each stage is rendered as a trapezoid shape that narrows proportionally to its value.
4
+
5
+ ## Table of Contents
6
+ - [Basic Usage](#basic-usage)
7
+ - [Properties](#properties)
8
+ - [Methods](#methods)
9
+ - [Events](#events)
10
+ - [Examples](#examples)
11
+ - [Accessibility](#accessibility)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ## Basic Usage
15
+
16
+ ```html
17
+ <snice-funnel id="my-funnel"></snice-funnel>
18
+
19
+ <script type="module">
20
+ import 'snice/components/funnel/snice-funnel';
21
+
22
+ const funnel = document.getElementById('my-funnel');
23
+ funnel.data = [
24
+ { label: 'Visitors', value: 10000 },
25
+ { label: 'Leads', value: 5000 },
26
+ { label: 'Opportunities', value: 2000 },
27
+ { label: 'Customers', value: 500 },
28
+ ];
29
+ </script>
30
+ ```
31
+
32
+ ## Properties
33
+
34
+ | Property | Type | Default | Description |
35
+ |----------|------|---------|-------------|
36
+ | `data` | `FunnelStage[]` | `[]` | Array of stage objects with label, value, and optional color |
37
+ | `variant` | `'default' \| 'gradient'` | `'default'` | Color variant - default uses distinct colors, gradient uses opacity fade |
38
+ | `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` | Funnel layout direction |
39
+ | `show-labels` | `boolean` | `true` | Whether to display stage labels |
40
+ | `show-values` | `boolean` | `true` | Whether to display stage values |
41
+ | `show-percentages` | `boolean` | `true` | Whether to display conversion percentages |
42
+ | `animation` | `boolean` | `false` | Whether to animate stages on initial render |
43
+
44
+ ### FunnelStage Interface
45
+
46
+ ```typescript
47
+ interface FunnelStage {
48
+ label: string; // Stage name (e.g., "Visitors")
49
+ value: number; // Numeric value for the stage
50
+ color?: string; // Optional custom color (CSS color string)
51
+ }
52
+ ```
53
+
54
+ ## Methods
55
+
56
+ | Method | Return Type | Description |
57
+ |--------|-------------|-------------|
58
+ | `setStages(stages)` | `void` | Set funnel data programmatically (alternative to setting `data` property) |
59
+ | `exportImage(format?)` | `string` | Export the funnel as a data URL. Format: `'png'` (default) or `'svg'` |
60
+
61
+ ### Export Example
62
+
63
+ ```javascript
64
+ const funnel = document.getElementById('my-funnel');
65
+
66
+ // Export as SVG
67
+ const svgDataUrl = funnel.exportImage('svg');
68
+
69
+ // Export as PNG
70
+ const pngDataUrl = funnel.exportImage('png');
71
+ ```
72
+
73
+ ## Events
74
+
75
+ | Event | Detail | Description |
76
+ |-------|--------|-------------|
77
+ | `funnel-click` | `{ stage: FunnelStage, index: number }` | Fired when a stage is clicked |
78
+ | `funnel-hover` | `{ stage: FunnelStage, index: number }` | Fired when a stage is hovered |
79
+
80
+ ```javascript
81
+ funnel.addEventListener('funnel-click', (e) => {
82
+ console.log('Clicked stage:', e.detail.stage.label);
83
+ console.log('Stage index:', e.detail.index);
84
+ });
85
+ ```
86
+
87
+ ## Examples
88
+
89
+ ### Conversion Funnel
90
+
91
+ ```html
92
+ <snice-funnel id="conversion"></snice-funnel>
93
+ <script>
94
+ document.getElementById('conversion').data = [
95
+ { label: 'Website Visits', value: 50000 },
96
+ { label: 'Sign Ups', value: 12000 },
97
+ { label: 'Trial Started', value: 5000 },
98
+ { label: 'Paid', value: 1500 },
99
+ { label: 'Retained', value: 800 },
100
+ ];
101
+ </script>
102
+ ```
103
+
104
+ ### Gradient Variant
105
+
106
+ The gradient variant uses decreasing opacity of the primary color for a smoother visual effect.
107
+
108
+ ```html
109
+ <snice-funnel id="gradient-funnel" variant="gradient"></snice-funnel>
110
+ ```
111
+
112
+ ### Custom Colors
113
+
114
+ ```html
115
+ <snice-funnel id="colored-funnel"></snice-funnel>
116
+ <script>
117
+ document.getElementById('colored-funnel').data = [
118
+ { label: 'Awareness', value: 10000, color: 'rgb(37 99 235)' },
119
+ { label: 'Interest', value: 6000, color: 'rgb(22 163 74)' },
120
+ { label: 'Decision', value: 2500, color: 'rgb(234 179 8)' },
121
+ { label: 'Action', value: 1000, color: 'rgb(220 38 38)' },
122
+ ];
123
+ </script>
124
+ ```
125
+
126
+ ### Horizontal Layout
127
+
128
+ ```html
129
+ <snice-funnel id="horizontal" orientation="horizontal"></snice-funnel>
130
+ ```
131
+
132
+ ### With Animation
133
+
134
+ ```html
135
+ <snice-funnel id="animated" animation></snice-funnel>
136
+ ```
137
+
138
+ ### Minimal Display
139
+
140
+ ```html
141
+ <snice-funnel id="minimal" show-labels="false" show-percentages="false"></snice-funnel>
142
+ ```
143
+
144
+ ### Event Handling
145
+
146
+ ```html
147
+ <snice-funnel id="interactive"></snice-funnel>
148
+ <div id="output"></div>
149
+
150
+ <script>
151
+ const funnel = document.getElementById('interactive');
152
+ const output = document.getElementById('output');
153
+
154
+ funnel.data = [
155
+ { label: 'Step 1', value: 1000 },
156
+ { label: 'Step 2', value: 600 },
157
+ { label: 'Step 3', value: 200 },
158
+ ];
159
+
160
+ funnel.addEventListener('funnel-click', (e) => {
161
+ output.textContent = `Clicked: ${e.detail.stage.label} (${e.detail.stage.value})`;
162
+ });
163
+ </script>
164
+ ```
165
+
166
+ ## Accessibility
167
+
168
+ - **ARIA role**: The SVG has `role="img"` with `aria-label="Funnel chart"`
169
+ - **Interactive stages**: Each stage has `role="button"` and `tabindex="0"` for keyboard navigation
170
+ - **ARIA labels**: Each stage has a descriptive `aria-label` including the label, value, and percentage
171
+ - **Keyboard support**: Stages can be activated with Enter or Space keys
172
+ - **Focus styles**: Visible focus ring on keyboard navigation
173
+ - **Color contrast**: Default colors meet WCAG AA standards
174
+
175
+ ## Browser Support
176
+
177
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
178
+ - Requires Custom Elements v1 and Shadow DOM support
179
+
180
+ ## Best Practices
181
+
182
+ 1. **Order data by value**: Place the largest value first for a natural funnel shape
183
+ 2. **Use meaningful labels**: Stage labels should clearly describe each step in the process
184
+ 3. **Limit stages**: 3-7 stages works best visually; more than 8 becomes hard to read
185
+ 4. **Choose colors wisely**: Use custom colors to match your brand or highlight important stages
186
+ 5. **Include percentages**: Conversion percentages help users understand drop-off rates
187
+ 6. **Use animation sparingly**: Enable animation for initial page load or dashboard reveals
188
+ 7. **Consider orientation**: Vertical works well for sidebar placement; horizontal for wide layouts
189
+ 8. **Handle click events**: Use click events to drill down into stage details
190
+ 9. **Format values**: Large numbers are automatically formatted (K/M notation)
191
+ 10. **Test responsiveness**: The SVG scales with its container width