@unovis/ts 1.1.1-beta.7 → 1.1.1-beta.9

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 (710) hide show
  1. package/components/area/config.d.ts +25 -0
  2. package/components/area/config.js +16 -0
  3. package/components/area/config.js.map +1 -0
  4. package/components/area/index.d.ts +19 -0
  5. package/components/area/index.js +102 -0
  6. package/components/area/index.js.map +1 -0
  7. package/components/area/style.d.ts +3 -0
  8. package/{src/components/area/style.ts → components/area/style.js} +10 -9
  9. package/components/area/style.js.map +1 -0
  10. package/components/area/types.d.ts +6 -0
  11. package/components/axis/config.d.ts +71 -0
  12. package/components/axis/config.js +32 -0
  13. package/components/axis/config.js.map +1 -0
  14. package/components/axis/index.d.ts +44 -0
  15. package/components/axis/index.js +305 -0
  16. package/components/axis/index.js.map +1 -0
  17. package/components/axis/style.d.ts +9 -0
  18. package/{src/components/axis/style.ts → components/axis/style.js} +22 -27
  19. package/components/axis/style.js.map +1 -0
  20. package/components/axis/types.d.ts +4 -0
  21. package/components/axis/types.js +8 -0
  22. package/components/axis/types.js.map +1 -0
  23. package/components/brush/config.d.ts +42 -0
  24. package/components/brush/config.js +24 -0
  25. package/components/brush/config.js.map +1 -0
  26. package/components/brush/index.d.ts +28 -0
  27. package/components/brush/index.js +199 -0
  28. package/components/brush/index.js.map +1 -0
  29. package/components/brush/style.d.ts +5 -0
  30. package/{src/components/brush/style.ts → components/brush/style.js} +14 -15
  31. package/components/brush/style.js.map +1 -0
  32. package/components/brush/types.d.ts +7 -0
  33. package/components/brush/types.js +8 -0
  34. package/components/brush/types.js.map +1 -0
  35. package/components/bullet-legend/config.d.ts +34 -0
  36. package/components/bullet-legend/config.js +16 -0
  37. package/components/bullet-legend/config.js.map +1 -0
  38. package/components/bullet-legend/index.d.ts +19 -0
  39. package/components/bullet-legend/index.js +79 -0
  40. package/components/bullet-legend/index.js.map +1 -0
  41. package/components/bullet-legend/style.d.ts +6 -0
  42. package/{src/components/bullet-legend/style.ts → components/bullet-legend/style.js} +16 -18
  43. package/components/bullet-legend/style.js.map +1 -0
  44. package/components/bullet-legend/types.d.ts +7 -0
  45. package/components/bullet-legend/types.js +2 -0
  46. package/components/bullet-legend/types.js.map +1 -0
  47. package/components/chord-diagram/config.d.ts +44 -0
  48. package/components/chord-diagram/config.js +25 -0
  49. package/components/chord-diagram/config.js.map +1 -0
  50. package/components/chord-diagram/index.d.ts +42 -0
  51. package/components/chord-diagram/index.js +305 -0
  52. package/components/chord-diagram/index.js.map +1 -0
  53. package/components/chord-diagram/modules/label.d.ts +8 -0
  54. package/components/chord-diagram/modules/label.js +115 -0
  55. package/components/chord-diagram/modules/label.js.map +1 -0
  56. package/components/chord-diagram/modules/link.d.ts +21 -0
  57. package/components/chord-diagram/modules/link.js +63 -0
  58. package/components/chord-diagram/modules/link.js.map +1 -0
  59. package/components/chord-diagram/modules/node.d.ts +17 -0
  60. package/components/chord-diagram/modules/node.js +52 -0
  61. package/components/chord-diagram/modules/node.js.map +1 -0
  62. package/components/chord-diagram/style.d.ts +13 -0
  63. package/{src/components/chord-diagram/style.ts → components/chord-diagram/style.js} +30 -39
  64. package/components/chord-diagram/style.js.map +1 -0
  65. package/components/chord-diagram/types.d.ts +58 -0
  66. package/components/chord-diagram/types.js +8 -0
  67. package/components/chord-diagram/types.js.map +1 -0
  68. package/components/crosshair/config.d.ts +43 -0
  69. package/components/crosshair/config.js +19 -0
  70. package/components/crosshair/config.js.map +1 -0
  71. package/components/crosshair/index.d.ts +35 -0
  72. package/components/crosshair/index.js +183 -0
  73. package/components/crosshair/index.js.map +1 -0
  74. package/components/crosshair/style.d.ts +4 -0
  75. package/{src/components/crosshair/style.ts → components/crosshair/style.js} +12 -12
  76. package/components/crosshair/style.js.map +1 -0
  77. package/components/crosshair/types.d.ts +13 -0
  78. package/components/crosshair/types.js +2 -0
  79. package/components/crosshair/types.js.map +1 -0
  80. package/components/donut/config.d.ts +59 -0
  81. package/components/donut/config.js +28 -0
  82. package/components/donut/config.js.map +1 -0
  83. package/components/donut/index.d.ts +21 -0
  84. package/components/donut/index.js +107 -0
  85. package/components/donut/index.js.map +1 -0
  86. package/components/donut/modules/arc.d.ts +10 -0
  87. package/components/donut/modules/arc.js +59 -0
  88. package/components/donut/modules/arc.js.map +1 -0
  89. package/components/donut/style.d.ts +7 -0
  90. package/{src/components/donut/style.ts → components/donut/style.js} +18 -20
  91. package/components/donut/style.js.map +1 -0
  92. package/components/donut/types.d.ts +20 -0
  93. package/components/flow-legend/config.d.ts +29 -0
  94. package/components/flow-legend/config.js +18 -0
  95. package/components/flow-legend/config.js.map +1 -0
  96. package/components/flow-legend/index.d.ts +16 -0
  97. package/components/flow-legend/index.js +75 -0
  98. package/components/flow-legend/index.js.map +1 -0
  99. package/components/flow-legend/style.d.ts +8 -0
  100. package/{src/components/flow-legend/style.ts → components/flow-legend/style.js} +21 -25
  101. package/components/flow-legend/style.js.map +1 -0
  102. package/components/flow-legend/types.d.ts +9 -0
  103. package/components/flow-legend/types.js +8 -0
  104. package/components/flow-legend/types.js.map +1 -0
  105. package/components/free-brush/config.d.ts +45 -0
  106. package/components/free-brush/config.js +24 -0
  107. package/components/free-brush/config.js.map +1 -0
  108. package/components/free-brush/index.d.ts +20 -0
  109. package/components/free-brush/index.js +192 -0
  110. package/components/free-brush/index.js.map +1 -0
  111. package/components/free-brush/style.d.ts +4 -0
  112. package/{src/components/free-brush/style.ts → components/free-brush/style.js} +12 -12
  113. package/components/free-brush/style.js.map +1 -0
  114. package/components/free-brush/types.d.ts +7 -0
  115. package/components/free-brush/types.js +9 -0
  116. package/components/free-brush/types.js.map +1 -0
  117. package/components/graph/config.d.ts +238 -0
  118. package/components/graph/config.js +84 -0
  119. package/components/graph/config.js.map +1 -0
  120. package/components/graph/index.d.ts +126 -0
  121. package/components/graph/index.js +656 -0
  122. package/components/graph/index.js.map +1 -0
  123. package/components/graph/modules/layout-helpers.d.ts +21 -0
  124. package/components/graph/modules/layout-helpers.js +69 -0
  125. package/components/graph/modules/layout-helpers.js.map +1 -0
  126. package/components/graph/modules/layout.d.ts +10 -0
  127. package/components/graph/modules/layout.js +399 -0
  128. package/components/graph/modules/layout.js.map +1 -0
  129. package/components/graph/modules/link/helper.d.ts +25 -0
  130. package/components/graph/modules/link/helper.js +74 -0
  131. package/components/graph/modules/link/helper.js.map +1 -0
  132. package/components/graph/modules/link/index.d.ts +11 -0
  133. package/components/graph/modules/link/index.js +212 -0
  134. package/components/graph/modules/link/index.js.map +1 -0
  135. package/components/graph/modules/link/style.d.ts +15 -0
  136. package/{src/components/graph/modules/link/style.ts → components/graph/modules/link/style.js} +34 -45
  137. package/components/graph/modules/link/style.js.map +1 -0
  138. package/components/graph/modules/node/helper.d.ts +21 -0
  139. package/components/graph/modules/node/helper.js +126 -0
  140. package/components/graph/modules/node/helper.js.map +1 -0
  141. package/components/graph/modules/node/index.d.ts +11 -0
  142. package/components/graph/modules/node/index.js +252 -0
  143. package/components/graph/modules/node/index.js.map +1 -0
  144. package/components/graph/modules/node/style.d.ts +24 -0
  145. package/{src/components/graph/modules/node/style.ts → components/graph/modules/node/style.js} +52 -72
  146. package/components/graph/modules/node/style.js.map +1 -0
  147. package/components/graph/modules/panel/helper.d.ts +18 -0
  148. package/components/graph/modules/panel/helper.js +111 -0
  149. package/components/graph/modules/panel/helper.js.map +1 -0
  150. package/components/graph/modules/panel/index.d.ts +7 -0
  151. package/components/graph/modules/panel/index.js +98 -0
  152. package/components/graph/modules/panel/index.js.map +1 -0
  153. package/components/graph/modules/panel/style.d.ts +14 -0
  154. package/{src/components/graph/modules/panel/style.ts → components/graph/modules/panel/style.js} +32 -42
  155. package/components/graph/modules/panel/style.js.map +1 -0
  156. package/components/graph/modules/shape.d.ts +6 -0
  157. package/components/graph/modules/shape.js +80 -0
  158. package/components/graph/modules/shape.js.map +1 -0
  159. package/components/graph/modules/zoom-levels.d.ts +6 -0
  160. package/components/graph/modules/zoom-levels.js +10 -0
  161. package/components/graph/modules/zoom-levels.js.map +1 -0
  162. package/components/graph/style.d.ts +6 -0
  163. package/components/graph/style.js +66 -0
  164. package/components/graph/style.js.map +1 -0
  165. package/components/graph/types.d.ts +125 -0
  166. package/components/graph/types.js +30 -0
  167. package/components/graph/types.js.map +1 -0
  168. package/components/grouped-bar/config.d.ts +36 -0
  169. package/components/grouped-bar/config.js +20 -0
  170. package/components/grouped-bar/config.js.map +1 -0
  171. package/components/grouped-bar/index.d.ts +32 -0
  172. package/components/grouped-bar/index.js +249 -0
  173. package/components/grouped-bar/index.js.map +1 -0
  174. package/components/grouped-bar/style.d.ts +5 -0
  175. package/{src/components/grouped-bar/style.ts → components/grouped-bar/style.js} +14 -15
  176. package/components/grouped-bar/style.js.map +1 -0
  177. package/components/leaflet-flow-map/config.d.ts +46 -0
  178. package/components/leaflet-flow-map/config.js +25 -0
  179. package/components/leaflet-flow-map/config.js.map +1 -0
  180. package/components/leaflet-flow-map/index.d.ts +52 -0
  181. package/components/leaflet-flow-map/index.js +220 -0
  182. package/components/leaflet-flow-map/index.js.map +1 -0
  183. package/components/leaflet-flow-map/renderer-utils.d.ts +5 -0
  184. package/components/leaflet-flow-map/renderer-utils.js +15 -0
  185. package/components/leaflet-flow-map/renderer-utils.js.map +1 -0
  186. package/components/leaflet-flow-map/renderer.d.ts +26 -0
  187. package/components/leaflet-flow-map/renderer.js +117 -0
  188. package/components/leaflet-flow-map/renderer.js.map +1 -0
  189. package/components/leaflet-flow-map/shaders.d.ts +2 -0
  190. package/{src/components/leaflet-flow-map/shaders.ts → components/leaflet-flow-map/shaders.js} +7 -4
  191. package/components/leaflet-flow-map/shaders.js.map +1 -0
  192. package/components/leaflet-flow-map/types.d.ts +23 -0
  193. package/components/leaflet-map/config.d.ts +193 -0
  194. package/components/leaflet-map/config.js +71 -0
  195. package/components/leaflet-map/config.js.map +1 -0
  196. package/components/leaflet-map/index.d.ts +130 -0
  197. package/components/leaflet-map/index.js +690 -0
  198. package/components/leaflet-map/index.js.map +1 -0
  199. package/components/leaflet-map/leaflet.css.js +5 -0
  200. package/components/leaflet-map/leaflet.css.js.map +1 -0
  201. package/components/leaflet-map/modules/clusterBackground.d.ts +5 -0
  202. package/components/leaflet-map/modules/clusterBackground.js +27 -0
  203. package/components/leaflet-map/modules/clusterBackground.js.map +1 -0
  204. package/components/leaflet-map/modules/donut.d.ts +3 -0
  205. package/components/leaflet-map/modules/donut.js +25 -0
  206. package/components/leaflet-map/modules/donut.js.map +1 -0
  207. package/components/leaflet-map/modules/map.d.ts +14 -0
  208. package/components/leaflet-map/modules/map.js +154 -0
  209. package/components/leaflet-map/modules/map.js.map +1 -0
  210. package/components/leaflet-map/modules/node.d.ts +9 -0
  211. package/components/leaflet-map/modules/node.js +162 -0
  212. package/components/leaflet-map/modules/node.js.map +1 -0
  213. package/components/leaflet-map/modules/selectionRing.d.ts +7 -0
  214. package/components/leaflet-map/modules/selectionRing.js +41 -0
  215. package/components/leaflet-map/modules/selectionRing.js.map +1 -0
  216. package/components/leaflet-map/modules/utils.d.ts +50 -0
  217. package/components/leaflet-map/modules/utils.js +210 -0
  218. package/components/leaflet-map/modules/utils.js.map +1 -0
  219. package/{src/components → components}/leaflet-map/renderer/leaflet-maplibre-gl.js +78 -76
  220. package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -0
  221. package/components/leaflet-map/renderer/map-style.d.ts +4 -0
  222. package/components/leaflet-map/renderer/map-style.js +15 -0
  223. package/components/leaflet-map/renderer/map-style.js.map +1 -0
  224. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +40 -0
  225. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +1 -0
  226. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +40 -0
  227. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +1 -0
  228. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +4981 -0
  229. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +1 -0
  230. package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +8 -0
  231. package/components/leaflet-map/renderer/mapboxgl-layer.js +27 -0
  232. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -0
  233. package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +4 -0
  234. package/components/leaflet-map/renderer/mapboxgl-utils.js +39 -0
  235. package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -0
  236. package/{src/components → components}/leaflet-map/renderer/maplibre-gl.css.js +4 -2
  237. package/components/leaflet-map/renderer/maplibre-gl.css.js.map +1 -0
  238. package/components/leaflet-map/style.d.ts +52 -0
  239. package/components/leaflet-map/style.js +183 -0
  240. package/components/leaflet-map/style.js.map +1 -0
  241. package/components/leaflet-map/types.d.ts +75 -0
  242. package/components/leaflet-map/types.js +15 -0
  243. package/components/leaflet-map/types.js.map +1 -0
  244. package/components/line/config.d.ts +30 -0
  245. package/components/line/config.js +17 -0
  246. package/components/line/config.js.map +1 -0
  247. package/components/line/index.d.ts +27 -0
  248. package/components/line/index.js +152 -0
  249. package/components/line/index.js.map +1 -0
  250. package/components/line/style.d.ts +6 -0
  251. package/{src/components/line/style.ts → components/line/style.js} +16 -18
  252. package/components/line/style.js.map +1 -0
  253. package/components/line/types.d.ts +12 -0
  254. package/components/nested-donut/config.d.ts +59 -0
  255. package/components/nested-donut/config.js +19 -0
  256. package/components/nested-donut/config.js.map +1 -0
  257. package/components/nested-donut/index.d.ts +38 -0
  258. package/components/nested-donut/index.js +133 -0
  259. package/components/nested-donut/index.js.map +1 -0
  260. package/components/nested-donut/modules/arc.d.ts +17 -0
  261. package/components/nested-donut/modules/arc.js +50 -0
  262. package/components/nested-donut/modules/arc.js.map +1 -0
  263. package/components/nested-donut/modules/label.d.ts +7 -0
  264. package/components/nested-donut/modules/label.js +34 -0
  265. package/components/nested-donut/modules/label.js.map +1 -0
  266. package/components/nested-donut/style.d.ts +26 -0
  267. package/components/nested-donut/style.js +70 -0
  268. package/components/nested-donut/style.js.map +1 -0
  269. package/components/nested-donut/types.d.ts +24 -0
  270. package/components/nested-donut/types.js +11 -0
  271. package/components/nested-donut/types.js.map +1 -0
  272. package/components/sankey/config.d.ts +162 -0
  273. package/components/sankey/config.js +65 -0
  274. package/components/sankey/config.js.map +1 -0
  275. package/components/sankey/index.d.ts +59 -0
  276. package/components/sankey/index.js +306 -0
  277. package/components/sankey/index.js.map +1 -0
  278. package/components/sankey/modules/label.d.ts +23 -0
  279. package/components/sankey/modules/label.js +168 -0
  280. package/components/sankey/modules/label.js.map +1 -0
  281. package/components/sankey/modules/link.d.ts +14 -0
  282. package/components/sankey/modules/link.js +108 -0
  283. package/components/sankey/modules/link.js.map +1 -0
  284. package/components/sankey/modules/node.d.ts +10 -0
  285. package/components/sankey/modules/node.js +156 -0
  286. package/components/sankey/modules/node.js.map +1 -0
  287. package/components/sankey/style.d.ts +20 -0
  288. package/{src/components/sankey/style.ts → components/sankey/style.js} +44 -60
  289. package/components/sankey/style.js.map +1 -0
  290. package/components/sankey/types.d.ts +84 -0
  291. package/components/sankey/types.js +34 -0
  292. package/components/sankey/types.js.map +1 -0
  293. package/components/scatter/config.d.ts +44 -0
  294. package/components/scatter/config.js +23 -0
  295. package/components/scatter/config.js.map +1 -0
  296. package/components/scatter/index.d.ts +28 -0
  297. package/components/scatter/index.js +167 -0
  298. package/components/scatter/index.js.map +1 -0
  299. package/components/scatter/modules/point.d.ts +7 -0
  300. package/components/scatter/modules/point.js +86 -0
  301. package/components/scatter/modules/point.js.map +1 -0
  302. package/components/scatter/modules/utils.d.ts +11 -0
  303. package/components/scatter/modules/utils.js +112 -0
  304. package/components/scatter/modules/utils.js.map +1 -0
  305. package/components/scatter/style.d.ts +5 -0
  306. package/{src/components/scatter/style.ts → components/scatter/style.js} +14 -15
  307. package/components/scatter/style.js.map +1 -0
  308. package/components/scatter/types.d.ts +19 -0
  309. package/components/stacked-bar/config.d.ts +38 -0
  310. package/components/stacked-bar/config.js +20 -0
  311. package/components/stacked-bar/config.js.map +1 -0
  312. package/components/stacked-bar/index.d.ts +28 -0
  313. package/components/stacked-bar/index.js +208 -0
  314. package/components/stacked-bar/index.js.map +1 -0
  315. package/components/stacked-bar/style.d.ts +5 -0
  316. package/{src/components/stacked-bar/style.ts → components/stacked-bar/style.js} +14 -15
  317. package/components/stacked-bar/style.js.map +1 -0
  318. package/components/stacked-bar/types.d.ts +5 -0
  319. package/components/timeline/config.d.ts +43 -0
  320. package/components/timeline/config.js +24 -0
  321. package/components/timeline/config.js.map +1 -0
  322. package/components/timeline/index.d.ts +41 -0
  323. package/components/timeline/index.js +244 -0
  324. package/components/timeline/index.js.map +1 -0
  325. package/components/timeline/style.d.ts +13 -0
  326. package/{src/components/timeline/style.ts → components/timeline/style.js} +30 -39
  327. package/components/timeline/style.js.map +1 -0
  328. package/components/tooltip/config.d.ts +68 -0
  329. package/components/tooltip/config.js +20 -0
  330. package/components/tooltip/config.js.map +1 -0
  331. package/components/tooltip/index.d.ts +36 -0
  332. package/components/tooltip/index.js +184 -0
  333. package/components/tooltip/index.js.map +1 -0
  334. package/{src/components → components}/tooltip/style.js +14 -11
  335. package/components/tooltip/style.js.map +1 -0
  336. package/components/topojson-map/config.d.ts +99 -0
  337. package/components/topojson-map/config.js +42 -0
  338. package/components/topojson-map/config.js.map +1 -0
  339. package/components/topojson-map/index.d.ts +52 -0
  340. package/components/topojson-map/index.js +355 -0
  341. package/components/topojson-map/index.js.map +1 -0
  342. package/components/topojson-map/style.d.ts +11 -0
  343. package/{src/components/topojson-map/style.ts → components/topojson-map/style.js} +26 -33
  344. package/components/topojson-map/style.js.map +1 -0
  345. package/components/topojson-map/types.d.ts +78 -0
  346. package/components/topojson-map/types.js +80 -0
  347. package/components/topojson-map/types.js.map +1 -0
  348. package/components/topojson-map/utils.d.ts +3 -0
  349. package/components/topojson-map/utils.js +30 -0
  350. package/components/topojson-map/utils.js.map +1 -0
  351. package/components/vis-controls/config.d.ts +12 -0
  352. package/components/vis-controls/config.js +13 -0
  353. package/components/vis-controls/config.js.map +1 -0
  354. package/components/vis-controls/index.d.ts +14 -0
  355. package/components/vis-controls/index.js +52 -0
  356. package/components/vis-controls/index.js.map +1 -0
  357. package/components/vis-controls/style.d.ts +11 -0
  358. package/{src/components/vis-controls/style.ts → components/vis-controls/style.js} +27 -34
  359. package/components/vis-controls/style.js.map +1 -0
  360. package/components/vis-controls/types.d.ts +13 -0
  361. package/components/vis-controls/types.js +8 -0
  362. package/components/vis-controls/types.js.map +1 -0
  363. package/components/xy-labels/config.d.ts +48 -0
  364. package/components/xy-labels/config.js +25 -0
  365. package/components/xy-labels/config.js.map +1 -0
  366. package/components/xy-labels/index.d.ts +15 -0
  367. package/components/xy-labels/index.js +87 -0
  368. package/components/xy-labels/index.js.map +1 -0
  369. package/components/xy-labels/modules/label.d.ts +9 -0
  370. package/components/xy-labels/modules/label.js +107 -0
  371. package/components/xy-labels/modules/label.js.map +1 -0
  372. package/components/xy-labels/style.d.ts +5 -0
  373. package/{src/components/xy-labels/style.ts → components/xy-labels/style.js} +14 -15
  374. package/components/xy-labels/style.js.map +1 -0
  375. package/components/xy-labels/types.d.ts +23 -0
  376. package/components/xy-labels/types.js +9 -0
  377. package/components/xy-labels/types.js.map +1 -0
  378. package/components.d.ts +51 -0
  379. package/components.js +29 -0
  380. package/components.js.map +1 -0
  381. package/containers/single-container/config.d.ts +12 -0
  382. package/containers/single-container/config.js +12 -0
  383. package/containers/single-container/config.js.map +1 -0
  384. package/containers/single-container/index.d.ts +19 -0
  385. package/containers/single-container/index.js +128 -0
  386. package/containers/single-container/index.js.map +1 -0
  387. package/containers/xy-container/config.d.ts +99 -0
  388. package/containers/xy-container/config.js +30 -0
  389. package/containers/xy-container/config.js.map +1 -0
  390. package/containers/xy-container/index.d.ts +34 -0
  391. package/containers/xy-container/index.js +330 -0
  392. package/containers/xy-container/index.js.map +1 -0
  393. package/containers.d.ts +6 -0
  394. package/containers.js +4 -0
  395. package/containers.js.map +1 -0
  396. package/core/component/config.d.ts +58 -0
  397. package/core/component/config.js +14 -0
  398. package/core/component/config.js.map +1 -0
  399. package/core/component/index.d.ts +43 -0
  400. package/core/component/index.js +118 -0
  401. package/core/component/index.js.map +1 -0
  402. package/core/component/types.d.ts +2 -0
  403. package/core/component/types.js +2 -0
  404. package/core/component/types.js.map +1 -0
  405. package/core/config/index.d.ts +3 -0
  406. package/core/config/index.js +16 -0
  407. package/core/config/index.js.map +1 -0
  408. package/core/container/config.d.ts +48 -0
  409. package/core/container/config.js +29 -0
  410. package/core/container/config.js.map +1 -0
  411. package/core/container/index.d.ts +26 -0
  412. package/core/container/index.js +106 -0
  413. package/core/container/index.js.map +1 -0
  414. package/core/xy-component/config.d.ts +38 -0
  415. package/core/xy-component/config.js +20 -0
  416. package/core/xy-component/config.js.map +1 -0
  417. package/core/xy-component/index.d.ts +27 -0
  418. package/core/xy-component/index.js +74 -0
  419. package/core/xy-component/index.js.map +1 -0
  420. package/data-models/core.d.ts +6 -0
  421. package/data-models/core.js +14 -0
  422. package/data-models/core.js.map +1 -0
  423. package/data-models/graph.d.ts +24 -0
  424. package/data-models/graph.js +107 -0
  425. package/data-models/graph.js.map +1 -0
  426. package/data-models/map-graph.d.ts +21 -0
  427. package/data-models/map-graph.js +62 -0
  428. package/data-models/map-graph.js.map +1 -0
  429. package/data-models/map.d.ts +5 -0
  430. package/data-models/map.js +12 -0
  431. package/data-models/map.js.map +1 -0
  432. package/data-models/series.d.ts +6 -0
  433. package/data-models/series.js +19 -0
  434. package/data-models/series.js.map +1 -0
  435. package/index.d.ts +7 -0
  436. package/index.js +55 -0
  437. package/index.js.map +1 -0
  438. package/maps/china-provinces.json.js +140373 -0
  439. package/maps/fr-regions.json.js +14162 -0
  440. package/maps/germany-regions.json.js +35760 -0
  441. package/maps/ind-regions.json.js +290584 -0
  442. package/maps/uk-regions.json.js +96233 -0
  443. package/maps/us-counties.json.js +206318 -0
  444. package/maps/us-states.json.js +16345 -0
  445. package/maps/world-110m-alpha.json.js +251366 -0
  446. package/maps/world-simple.json.js +89428 -0
  447. package/maps/world-simplest.json.js +28175 -0
  448. package/maps.d.ts +60 -0
  449. package/maps.js +23 -0
  450. package/package.json +1 -1
  451. package/styles/colors.d.ts +7 -0
  452. package/styles/colors.js +24 -0
  453. package/styles/colors.js.map +1 -0
  454. package/styles/index.d.ts +7 -0
  455. package/styles/index.js +38 -0
  456. package/styles/index.js.map +1 -0
  457. package/styles/sizes.d.ts +2 -0
  458. package/{src/styles/sizes.ts → styles/sizes.js} +8 -6
  459. package/styles/sizes.js.map +1 -0
  460. package/types/accessor.d.ts +5 -0
  461. package/types/accessor.js +2 -0
  462. package/types/accessor.js.map +1 -0
  463. package/types/component.d.ts +13 -0
  464. package/types/component.js +14 -0
  465. package/types/component.js.map +1 -0
  466. package/types/curve.d.ts +40 -0
  467. package/types/curve.js +46 -0
  468. package/types/curve.js.map +1 -0
  469. package/types/data.d.ts +7 -0
  470. package/types/data.js +2 -0
  471. package/types/data.js.map +1 -0
  472. package/types/direction.d.ts +6 -0
  473. package/types/direction.js +10 -0
  474. package/types/direction.js.map +1 -0
  475. package/types/graph.d.ts +35 -0
  476. package/types/graph.js +2 -0
  477. package/types/graph.js.map +1 -0
  478. package/types/map.d.ts +4 -0
  479. package/types/map.js +2 -0
  480. package/types/map.js.map +1 -0
  481. package/types/misc.d.ts +8 -0
  482. package/types/position.d.ts +20 -0
  483. package/types/position.js +27 -0
  484. package/types/position.js.map +1 -0
  485. package/types/scale.d.ts +23 -0
  486. package/types/scale.js +27 -0
  487. package/types/scale.js.map +1 -0
  488. package/types/shape.d.ts +7 -0
  489. package/types/shape.js +11 -0
  490. package/types/shape.js.map +1 -0
  491. package/types/spacing.d.ts +6 -0
  492. package/types/spacing.js +2 -0
  493. package/types/spacing.js.map +1 -0
  494. package/types/svg.d.ts +18 -0
  495. package/types/svg.js +22 -0
  496. package/types/svg.js.map +1 -0
  497. package/types/symbol.d.ts +18 -0
  498. package/types/symbol.js +24 -0
  499. package/types/symbol.js.map +1 -0
  500. package/types/text.d.ts +47 -0
  501. package/types/text.js +26 -0
  502. package/types/text.js.map +1 -0
  503. package/types.d.ts +27 -0
  504. package/types.js +30 -0
  505. package/types.js.map +1 -0
  506. package/utils/color.d.ts +10 -0
  507. package/utils/color.js +32 -0
  508. package/utils/color.js.map +1 -0
  509. package/utils/d3.d.ts +3 -0
  510. package/utils/d3.js +16 -0
  511. package/utils/d3.js.map +1 -0
  512. package/utils/data.d.ts +45 -0
  513. package/utils/data.js +274 -0
  514. package/utils/data.js.map +1 -0
  515. package/utils/html.d.ts +1 -0
  516. package/utils/html.js +16 -0
  517. package/utils/html.js.map +1 -0
  518. package/utils/map.d.ts +2 -0
  519. package/utils/map.js +20 -0
  520. package/utils/map.js.map +1 -0
  521. package/utils/misc.d.ts +9 -0
  522. package/utils/misc.js +47 -0
  523. package/utils/misc.js.map +1 -0
  524. package/utils/path.d.ts +23 -0
  525. package/utils/path.js +144 -0
  526. package/utils/path.js.map +1 -0
  527. package/utils/scale.d.ts +1 -0
  528. package/utils/style.d.ts +6 -0
  529. package/utils/style.js +24 -0
  530. package/utils/style.js.map +1 -0
  531. package/utils/svg.d.ts +3 -0
  532. package/utils/text.d.ts +139 -0
  533. package/utils/text.js +443 -0
  534. package/utils/text.js.map +1 -0
  535. package/utils/type.d.ts +5 -0
  536. package/declaration.d.ts +0 -1
  537. package/index.ts +0 -1
  538. package/licences.txt +0 -43
  539. package/maps.ts +0 -1
  540. package/rollup.config.js +0 -71
  541. package/rules/ts-getter-setter.js +0 -35
  542. package/src/components/area/config.ts +0 -29
  543. package/src/components/area/index.ts +0 -133
  544. package/src/components/area/types.ts +0 -2
  545. package/src/components/axis/config.ts +0 -76
  546. package/src/components/axis/index.ts +0 -363
  547. package/src/components/axis/types.ts +0 -4
  548. package/src/components/brush/config.ts +0 -51
  549. package/src/components/brush/index.ts +0 -233
  550. package/src/components/brush/types.ts +0 -8
  551. package/src/components/bullet-legend/config.ts +0 -38
  552. package/src/components/bullet-legend/index.ts +0 -104
  553. package/src/components/bullet-legend/types.ts +0 -7
  554. package/src/components/chord-diagram/config.ts +0 -53
  555. package/src/components/chord-diagram/index.ts +0 -401
  556. package/src/components/chord-diagram/modules/label.ts +0 -155
  557. package/src/components/chord-diagram/modules/link.ts +0 -91
  558. package/src/components/chord-diagram/modules/node.ts +0 -80
  559. package/src/components/chord-diagram/types.ts +0 -68
  560. package/src/components/crosshair/config.ts +0 -48
  561. package/src/components/crosshair/index.ts +0 -220
  562. package/src/components/crosshair/types.ts +0 -15
  563. package/src/components/donut/config.ts +0 -65
  564. package/src/components/donut/index.ts +0 -148
  565. package/src/components/donut/modules/arc.ts +0 -86
  566. package/src/components/donut/types.ts +0 -17
  567. package/src/components/flow-legend/config.ts +0 -31
  568. package/src/components/flow-legend/index.ts +0 -103
  569. package/src/components/flow-legend/types.ts +0 -10
  570. package/src/components/free-brush/config.ts +0 -54
  571. package/src/components/free-brush/index.ts +0 -207
  572. package/src/components/free-brush/types.ts +0 -8
  573. package/src/components/graph/config.ts +0 -280
  574. package/src/components/graph/index.ts +0 -809
  575. package/src/components/graph/modules/layout-helpers.ts +0 -96
  576. package/src/components/graph/modules/layout.ts +0 -502
  577. package/src/components/graph/modules/link/helper.ts +0 -105
  578. package/src/components/graph/modules/link/index.ts +0 -302
  579. package/src/components/graph/modules/node/helper.ts +0 -162
  580. package/src/components/graph/modules/node/index.ts +0 -343
  581. package/src/components/graph/modules/panel/helper.ts +0 -160
  582. package/src/components/graph/modules/panel/index.ts +0 -137
  583. package/src/components/graph/modules/shape.ts +0 -108
  584. package/src/components/graph/modules/zoom-levels.ts +0 -6
  585. package/src/components/graph/style.ts +0 -72
  586. package/src/components/graph/types.ts +0 -152
  587. package/src/components/grouped-bar/config.ts +0 -40
  588. package/src/components/grouped-bar/index.ts +0 -325
  589. package/src/components/leaflet-flow-map/config.ts +0 -60
  590. package/src/components/leaflet-flow-map/index.ts +0 -279
  591. package/src/components/leaflet-flow-map/renderer-utils.ts +0 -14
  592. package/src/components/leaflet-flow-map/renderer.ts +0 -146
  593. package/src/components/leaflet-flow-map/types.ts +0 -18
  594. package/src/components/leaflet-map/config.ts +0 -234
  595. package/src/components/leaflet-map/index.ts +0 -808
  596. package/src/components/leaflet-map/leaflet.css +0 -625
  597. package/src/components/leaflet-map/modules/clusterBackground.ts +0 -34
  598. package/src/components/leaflet-map/modules/donut.ts +0 -37
  599. package/src/components/leaflet-map/modules/map.ts +0 -178
  600. package/src/components/leaflet-map/modules/node.ts +0 -208
  601. package/src/components/leaflet-map/modules/selectionRing.ts +0 -63
  602. package/src/components/leaflet-map/modules/utils.ts +0 -290
  603. package/src/components/leaflet-map/renderer/map-style.ts +0 -24
  604. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +0 -35
  605. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +0 -35
  606. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +0 -2185
  607. package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +0 -43
  608. package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +0 -40
  609. package/src/components/leaflet-map/style.ts +0 -217
  610. package/src/components/leaflet-map/types.ts +0 -75
  611. package/src/components/line/config.ts +0 -34
  612. package/src/components/line/index.ts +0 -188
  613. package/src/components/line/types.ts +0 -3
  614. package/src/components/nested-donut/config.ts +0 -75
  615. package/src/components/nested-donut/index.ts +0 -176
  616. package/src/components/nested-donut/modules/arc.ts +0 -78
  617. package/src/components/nested-donut/modules/label.ts +0 -63
  618. package/src/components/nested-donut/style.ts +0 -82
  619. package/src/components/nested-donut/types.ts +0 -29
  620. package/src/components/sankey/config.ts +0 -195
  621. package/src/components/sankey/index.ts +0 -387
  622. package/src/components/sankey/modules/label.ts +0 -228
  623. package/src/components/sankey/modules/link.ts +0 -141
  624. package/src/components/sankey/modules/node.ts +0 -221
  625. package/src/components/sankey/types.ts +0 -95
  626. package/src/components/scatter/config.ts +0 -49
  627. package/src/components/scatter/index.ts +0 -220
  628. package/src/components/scatter/modules/point.ts +0 -123
  629. package/src/components/scatter/modules/utils.ts +0 -150
  630. package/src/components/scatter/types.ts +0 -21
  631. package/src/components/stacked-bar/config.ts +0 -42
  632. package/src/components/stacked-bar/index.ts +0 -267
  633. package/src/components/stacked-bar/types.ts +0 -5
  634. package/src/components/timeline/config.ts +0 -49
  635. package/src/components/timeline/index.ts +0 -302
  636. package/src/components/tooltip/config.ts +0 -69
  637. package/src/components/tooltip/index.ts +0 -220
  638. package/src/components/topojson-map/config.ts +0 -124
  639. package/src/components/topojson-map/index.ts +0 -436
  640. package/src/components/topojson-map/types.ts +0 -123
  641. package/src/components/topojson-map/utils.ts +0 -29
  642. package/src/components/vis-controls/config.ts +0 -16
  643. package/src/components/vis-controls/index.ts +0 -68
  644. package/src/components/vis-controls/types.ts +0 -14
  645. package/src/components/xy-labels/config.ts +0 -56
  646. package/src/components/xy-labels/index.ts +0 -109
  647. package/src/components/xy-labels/modules/label.ts +0 -140
  648. package/src/components/xy-labels/types.ts +0 -26
  649. package/src/components.ts +0 -56
  650. package/src/containers/single-container/config.ts +0 -15
  651. package/src/containers/single-container/index.ts +0 -150
  652. package/src/containers/xy-container/config.ts +0 -112
  653. package/src/containers/xy-container/index.ts +0 -407
  654. package/src/containers.ts +0 -6
  655. package/src/core/component/config.ts +0 -61
  656. package/src/core/component/index.ts +0 -154
  657. package/src/core/component/types.ts +0 -9
  658. package/src/core/config/index.ts +0 -12
  659. package/src/core/container/config.ts +0 -56
  660. package/src/core/container/index.ts +0 -136
  661. package/src/core/xy-component/config.ts +0 -46
  662. package/src/core/xy-component/index.ts +0 -90
  663. package/src/data-models/core.ts +0 -15
  664. package/src/data-models/graph.ts +0 -138
  665. package/src/data-models/map-graph.ts +0 -72
  666. package/src/data-models/map.ts +0 -18
  667. package/src/data-models/series.ts +0 -16
  668. package/src/index.ts +0 -7
  669. package/src/maps/china-provinces.json +0 -1
  670. package/src/maps/fr-regions.json +0 -1
  671. package/src/maps/germany-regions.json +0 -1
  672. package/src/maps/ind-regions.json +0 -1
  673. package/src/maps/uk-regions.json +0 -1
  674. package/src/maps/us-counties.json +0 -1
  675. package/src/maps/us-states.json +0 -1
  676. package/src/maps/world-110m-alpha.json +0 -1
  677. package/src/maps/world-simple.json +0 -1
  678. package/src/maps/world-simplest.json +0 -1
  679. package/src/maps.ts +0 -34
  680. package/src/styles/colors.ts +0 -28
  681. package/src/styles/index.ts +0 -38
  682. package/src/types/accessor.ts +0 -5
  683. package/src/types/component.ts +0 -15
  684. package/src/types/curve.ts +0 -62
  685. package/src/types/data.ts +0 -5
  686. package/src/types/direction.ts +0 -6
  687. package/src/types/graph.ts +0 -40
  688. package/src/types/map.ts +0 -5
  689. package/src/types/misc.ts +0 -10
  690. package/src/types/position.ts +0 -23
  691. package/src/types/scale.ts +0 -47
  692. package/src/types/shape.ts +0 -7
  693. package/src/types/spacing.ts +0 -6
  694. package/src/types/svg.ts +0 -32
  695. package/src/types/symbol.ts +0 -21
  696. package/src/types/text.ts +0 -71
  697. package/src/types.ts +0 -31
  698. package/src/utils/color.ts +0 -41
  699. package/src/utils/d3.ts +0 -15
  700. package/src/utils/data.ts +0 -328
  701. package/src/utils/html.ts +0 -13
  702. package/src/utils/map.ts +0 -29
  703. package/src/utils/misc.ts +0 -54
  704. package/src/utils/path.ts +0 -196
  705. package/src/utils/scale.ts +0 -1
  706. package/src/utils/style.ts +0 -37
  707. package/src/utils/svg.ts +0 -49
  708. package/src/utils/text.ts +0 -529
  709. package/src/utils/type.ts +0 -9
  710. package/tsconfig.json +0 -29
@@ -1,108 +0,0 @@
1
- import { Selection, select } from 'd3-selection'
2
-
3
- // Types
4
- import { NumericAccessor, StringAccessor } from 'types/accessor'
5
-
6
- // Utils
7
- import { polygon } from 'utils/path'
8
- import { getString } from 'utils/data'
9
-
10
- // Types
11
-
12
- // Local Types
13
- import { GraphNodeShape } from '../types'
14
-
15
- // Helpers
16
- import { getNodeSize } from './node/helper'
17
-
18
- export function isCustomXml (shape: GraphNodeShape): boolean {
19
- return /<[a-z][\s\S]*>/i.test(shape)
20
- }
21
-
22
- export function appendShape<T> (
23
- selection: Selection<SVGGElement, T, SVGGElement, unknown>,
24
- shapeAccessor: StringAccessor<T>,
25
- shapeSelector: string,
26
- customShapeSelector: string,
27
- index?: number,
28
- insertSelector = ':last-child'
29
- ): void {
30
- selection.each((d, i, elements) => {
31
- const element = select(elements[i])
32
- const shape = getString(d, shapeAccessor, index) as GraphNodeShape
33
-
34
- let shapeElement
35
- const isCustomXmlShape = isCustomXml(shape)
36
- if (isCustomXmlShape) {
37
- shapeElement = element.insert('g', insertSelector)
38
- .html(shape)
39
- } else {
40
- switch (shape) {
41
- case GraphNodeShape.Square:
42
- shapeElement = element.insert('rect', insertSelector)
43
- .attr('rx', 5)
44
- .attr('ry', 5)
45
- break
46
- case GraphNodeShape.Hexagon:
47
- case GraphNodeShape.Triangle:
48
- shapeElement = element.insert('path', insertSelector)
49
- break
50
- case GraphNodeShape.Circle:
51
- default:
52
- shapeElement = element.insert('circle', insertSelector)
53
- }
54
- }
55
-
56
- return shapeElement.attr('class', shapeSelector)
57
- .classed(customShapeSelector, isCustomXmlShape)
58
- })
59
- }
60
-
61
- export function updateShape<T> (
62
- selection: Selection<SVGGElement, T, SVGGElement, unknown>,
63
- shape: StringAccessor<T>,
64
- size: NumericAccessor<T>,
65
- index: number
66
- ): void {
67
- if (selection.size() === 0) return
68
-
69
- const d: T = selection.datum()
70
- const nodeSize = getNodeSize(d, size, index)
71
- selection.filter('circle')
72
- .attr('r', nodeSize / 2)
73
-
74
- selection.filter('rect')
75
- .attr('width', nodeSize)
76
- .attr('height', nodeSize)
77
- .attr('x', -nodeSize / 2)
78
- .attr('y', -nodeSize / 2)
79
-
80
- selection.filter('path')
81
- .attr('d', () => {
82
- let n: number
83
- switch (getString(d, shape, index)) {
84
- case GraphNodeShape.Square:
85
- n = 4
86
- break
87
- case GraphNodeShape.Triangle:
88
- n = 3
89
- break
90
- case GraphNodeShape.Hexagon:
91
- default:
92
- n = 6
93
- }
94
-
95
- return polygon(nodeSize, n)
96
- })
97
-
98
- selection.filter('g')
99
- .filter(() => !isCustomXml(getString(d, shape, index) as GraphNodeShape))
100
- .html(getString(d, shape, index))
101
-
102
- selection.filter('g')
103
- .each((d, i, elements) => {
104
- const el = select(elements[i])
105
- const bBox = el.node().getBBox()
106
- el.attr('transform', `translate(${-bBox.width / 2},${-bBox.height / 2})`)
107
- })
108
- }
@@ -1,6 +0,0 @@
1
- export enum ZoomLevel {
2
- Level0 = 1.0,
3
- Level1 = 0.6,
4
- Level2 = 0.4,
5
- Level3 = 0.2,
6
- }
@@ -1,72 +0,0 @@
1
- import { css, injectGlobal } from '@emotion/css'
2
- import { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from 'styles/index'
3
-
4
- // Nodes
5
- import * as nodeSelectors from './modules/node/style'
6
-
7
- // Links
8
- import * as linkSelectors from './modules/link/style'
9
-
10
- export const variables = injectGlobal`
11
- :root {
12
- --vis-graph-icon-font-family: ${UNOVIS_ICON_FONT_FAMILY_DEFAULT};
13
- }
14
- `
15
-
16
- // General
17
- export const root = css`
18
- label: graph-component;
19
- `
20
-
21
- export const background = css`
22
- label: background;
23
- `
24
-
25
- export const graphGroup = css`
26
- label: graph-group;
27
- `
28
-
29
- export const zoomOutLevel1 = css`
30
- label: zoom-out-level-1;
31
-
32
- ${`.${nodeSelectors.label}`} {
33
- rect {
34
- stroke: none;
35
- }
36
- }
37
- `
38
-
39
- export const zoomOutLevel2 = css`
40
- label: zoom-out-level-2;
41
-
42
- ${`.${nodeSelectors.label}`} {
43
- visibility: visible;
44
- }
45
-
46
- ${`.${nodeSelectors.nodeGauge}`} {
47
- visibility: visible;
48
- }
49
-
50
- ${`.${nodeSelectors.node}`} {
51
- stroke-width: 4px;
52
- }
53
-
54
- rect${`.${nodeSelectors.node}`} {
55
- stroke-width: 2px;
56
- }
57
-
58
- ${`.${linkSelectors.gLink}`} {
59
- animation: none;
60
- stroke-dasharray: none;
61
- }
62
-
63
- ${`.${linkSelectors.flowCircle}`} {
64
- display: none;
65
- }
66
-
67
- ${`.${nodeSelectors.nodeSelection}`} {
68
- &${`.${nodeSelectors.nodeSelectionActive}`} {
69
- transform: scale(1.15);
70
- }
71
- }
72
- `
@@ -1,152 +0,0 @@
1
- // Types
2
- import { Position } from 'types/position'
3
- import { GraphInputLink, GraphInputNode, GraphNodeCore, GraphLinkCore } from 'types/graph'
4
- import { Spacing } from 'types/spacing'
5
-
6
- export type GraphNode<
7
- N extends GraphInputNode = GraphInputNode,
8
- L extends GraphInputLink = GraphInputLink,
9
- > = GraphNodeCore<N, L> & {
10
- x?: number;
11
- y?: number;
12
-
13
- _id?: number | string;
14
- _index?: number;
15
- _state?: {
16
- isDragged?: boolean;
17
- fx?: number;
18
- fy?: number;
19
- selected?: boolean;
20
- greyout?: boolean;
21
- };
22
-
23
- _panels?: GraphPanel<N, L>[];
24
- _isConnected?: boolean;
25
- }
26
-
27
- export type GraphLink<
28
- N extends GraphInputNode = GraphInputNode,
29
- L extends GraphInputLink = GraphInputLink,
30
- > = GraphLinkCore<N, L> & {
31
- id?: number | string;
32
- source: number | string | GraphNode<N>;
33
- target: number | string | GraphNode<N>;
34
-
35
- _id?: number | string;
36
- _direction?: number;
37
- _index?: number;
38
- _neighbours?: number;
39
-
40
- _state?: {
41
- flowAnimTime?: number;
42
- hovered?: boolean;
43
- selected?: boolean;
44
- greyout?: boolean;
45
- };
46
- }
47
-
48
- export enum GraphLayoutType {
49
- Circular = 'circular',
50
- Concentric = 'concentric',
51
- Parallel = 'parallel',
52
- ParallelHorizontal = 'parallel horizontal',
53
- Dagre = 'dagre',
54
- Force = 'force',
55
- Elk = 'elk',
56
- }
57
-
58
- export type GraphCircleLabel = {
59
- text: string;
60
- textColor?: string | null;
61
- color?: string | null;
62
- cursor?: string | null;
63
- fontSize?: string | null;
64
- radius?: number;
65
- }
66
-
67
- export enum GraphLinkStyle {
68
- Dashed = 'dashed',
69
- Solid = 'solid',
70
- }
71
-
72
- export enum GraphLinkArrowStyle {
73
- Single = 'single',
74
- Double = 'double',
75
- }
76
-
77
- export enum GraphNodeShape {
78
- Circle = 'circle',
79
- Square = 'square',
80
- Hexagon = 'hexagon',
81
- Triangle = 'triangle',
82
- }
83
-
84
- export type GraphPanelConfig = {
85
- /** Panel nodes references by unique ids */
86
- nodes: (string|number)[];
87
- /** Panel label */
88
- label?: string;
89
- /** Position of the label */
90
- labelPosition?: Position.Top | Position.Bottom | string;
91
- /** Color of the panel's border */
92
- borderColor?: string;
93
- /** Border width of the panel in pixels */
94
- borderWidth?: number;
95
- /** Inner padding */
96
- padding?: number | Spacing;
97
- /** Dashed outline showing that the panel is selected */
98
- dashedOutline?: boolean;
99
- /** Side icon symbol */
100
- sideIconSymbol?: string;
101
- /** Size of the icon as a CSS string. e.g.: `12pt` or `12px` */
102
- sideIconFontSize?: string;
103
- /** Color of the icon */
104
- sideIconSymbolColor?: string;
105
- /** Shape of the icon's background */
106
- sideIconShape?: GraphNodeShape | string;
107
- /** Size of the icon's background shape */
108
- sideIconShapeSize?: number;
109
- /** Stroke color of the icon's background shape */
110
- sideIconShapeStroke?: string;
111
- /** Cursor, when hovering over the icon */
112
- sideIconCursor?: string;
113
- }
114
-
115
- export type GraphPanel<
116
- N extends GraphInputNode = GraphInputNode,
117
- L extends GraphInputLink = GraphInputLink,
118
- > = GraphPanelConfig & {
119
- _numNodes?: number;
120
- _x?: number;
121
- _y?: number;
122
- _width?: number;
123
- _height?: number;
124
- _disabled?: boolean;
125
- _padding?: Spacing;
126
- }
127
-
128
- export type GraphNodeAnimationState = {
129
- endAngle: number;
130
- nodeIndex: number;
131
- nodeSize?: number;
132
- borderWidth?: number;
133
- }
134
-
135
- export type GraphNodeAnimatedElement<T = SVGElement> = T & {
136
- _animState: GraphNodeAnimationState;
137
- }
138
-
139
- export type GraphForceLayoutSettings = {
140
- /** Preferred Link Distance. Default: `60` */
141
- linkDistance?: number;
142
- /** Link Strength [0:1]. Default: `0.45` */
143
- linkStrength?: number;
144
- /** Charge Force (<0 repulsion, >0 attraction). Default: `-500` */
145
- charge?: number;
146
- /** X-centring force. Default: `0.15` */
147
- forceXStrength?: number;
148
- /** Y-centring force. Default: `0.25` */
149
- forceYStrength?: number;
150
- }
151
-
152
- export type GraphElkLayoutSettings = Record<string, string>
@@ -1,40 +0,0 @@
1
- import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'
2
-
3
- // Types
4
- import { StringAccessor } from 'types/accessor'
5
- import { Orientation } from 'types/position'
6
-
7
- export interface GroupedBarConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
8
- /** Force set the group width in pixels. Default: `undefined` */
9
- groupWidth?: number;
10
- /** Maximum group width for dynamic sizing. Limits the groupWidth property from the top. Default: `undefined` */
11
- groupMaxWidth?: number;
12
- /** Expected step between the bar groups in the X axis units.
13
- * Needed to correctly calculate the width of the bar groups when there are gaps in the data.
14
- * Default: `undefined` */
15
- dataStep?: number;
16
- /** Fractional padding between the groups in the range of [0,1). Default: `0.05` */
17
- groupPadding?: number;
18
- /** Fractional padding between the bars in the range of [0,1). Default: `0` */
19
- barPadding?: number;
20
- /** Rounded bar corners. Boolean or number (to set the radius in pixels explicitly). Default: `2` */
21
- roundedCorners?: number | boolean;
22
- /** Sets the minimum bar height for better visibility of small values. Default: `1` */
23
- barMinHeight?: number;
24
- /** Configurable bar cursor when hovering over. Default: `null` */
25
- cursor?: StringAccessor<Datum>;
26
- /** Chart orientation: `Orientation.Vertical` or `Orientation.Horizontal`. Default `Orientation.Vertical` */
27
- orientation?: Orientation | string;
28
- }
29
-
30
- export class GroupedBarConfig<Datum> extends XYComponentConfig<Datum> implements GroupedBarConfigInterface<Datum> {
31
- groupMaxWidth = undefined
32
- groupWidth = undefined
33
- dataStep = undefined
34
- groupPadding = 0.05
35
- barPadding = 0.0
36
- roundedCorners = 2
37
- barMinHeight = 2
38
- cursor = null
39
- orientation = Orientation.Vertical
40
- }
@@ -1,325 +0,0 @@
1
- import { scaleBand } from 'd3-scale'
2
- import { min, max, range } from 'd3-array'
3
- import { select } from 'd3'
4
-
5
- // Core
6
- import { XYComponentCore } from 'core/xy-component'
7
-
8
- // Utils
9
- import { clamp, getExtent, getMax, getMin, getNumber, getString, isArray, isEmpty, isNumber } from 'utils/data'
10
- import { roundedRectPath } from 'utils/path'
11
- import { smartTransition } from 'utils/d3'
12
- import { getColor } from 'utils/color'
13
-
14
- // Types
15
- import { NumericAccessor } from 'types/accessor'
16
- import { Spacing } from 'types/spacing'
17
- import { Direction } from 'types/direction'
18
- import { Orientation } from 'types/position'
19
- import { ContinuousScale } from 'types/scale'
20
-
21
- // Config
22
- import { GroupedBarConfig, GroupedBarConfigInterface } from './config'
23
-
24
- // Styles
25
- import * as s from './style'
26
-
27
- export class GroupedBar<Datum> extends XYComponentCore<Datum, GroupedBarConfig<Datum>, GroupedBarConfigInterface<Datum>> {
28
- static selectors = s
29
- config: GroupedBarConfig<Datum> = new GroupedBarConfig()
30
- getAccessors = (): NumericAccessor<Datum>[] =>
31
- isArray(this.config.y) ? this.config.y : [this.config.y]
32
-
33
- events = {
34
- [GroupedBar.selectors.barGroup]: {
35
- mouseover: this._raiseSelection,
36
- },
37
- [GroupedBar.selectors.bar]: {
38
- mouseover: this._raiseSelection,
39
- },
40
- }
41
-
42
- private _barData: Datum[] = []
43
-
44
- constructor (config?: GroupedBarConfigInterface<Datum>) {
45
- super()
46
- if (config) this.config.init(config)
47
- }
48
-
49
- get bleed (): Spacing {
50
- this._barData = this._getVisibleData()
51
- if (this._barData.length === 0) return { top: 0, bottom: 0, left: 0, right: 0 }
52
-
53
- // By default, horizontal orientation is "flipped", i.e. the `yDirection` of `XYContainer` is set to `Direction.North`
54
- const isHorizontalAndFlipped = !this.isVertical() && (this.dataScale.range()[0] > this.dataScale.range()[1])
55
- const dataDomain = this.dataScale.domain()
56
- const halfGroupWidth = this._getGroupWidth() / 2
57
-
58
- const dataScaleValues = this._barData.map((d, i) => getNumber(d, this.config.x, i))
59
- const firstDataValue = min(dataScaleValues)
60
- const lastDataValue = max(dataScaleValues)
61
- const firstValuePx = this.dataScale(firstDataValue)
62
- const lastValuePx = this.dataScale(lastDataValue)
63
-
64
- const dataDomainRequiredStart = this.dataScale.invert(firstValuePx + (isHorizontalAndFlipped ? halfGroupWidth : -halfGroupWidth))
65
- const dataDomainRequiredEnd = this.dataScale.invert(lastValuePx + (isHorizontalAndFlipped ? -halfGroupWidth : halfGroupWidth))
66
- const bleedPxStart = dataDomainRequiredStart <= dataDomain[0] ? this.dataScale(dataDomain[0]) - this.dataScale(dataDomainRequiredStart) : 0
67
- const bleedPxEnd = dataDomainRequiredEnd > dataDomain[1] ? this.dataScale(dataDomainRequiredEnd) - this.dataScale(dataDomain[1]) : 0
68
-
69
- return {
70
- top: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxEnd : bleedPxStart),
71
- bottom: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxStart : bleedPxEnd),
72
- left: this.isVertical() ? bleedPxStart : 0,
73
- right: this.isVertical() ? bleedPxEnd : 0,
74
- }
75
- }
76
-
77
- private get dataScale (): ContinuousScale {
78
- return this.isVertical() ? this.xScale : this.yScale
79
- }
80
-
81
- private get valueScale (): ContinuousScale {
82
- return this.isVertical() ? this.yScale : this.xScale
83
- }
84
-
85
- private isVertical (): boolean {
86
- return this.config.orientation === Orientation.Vertical
87
- }
88
-
89
- _render (customDuration?: number): void {
90
- const { config } = this
91
- const duration = isNumber(customDuration)
92
- ? customDuration
93
- : config.duration
94
- const groupWidth = this._getGroupWidth()
95
-
96
- const yAccessors = this.getAccessors()
97
- const innerBandScaleRange = [-groupWidth / 2, groupWidth / 2] as [
98
- number,
99
- number,
100
- ]
101
- const innerBandScale = scaleBand<number>()
102
- .domain(range(yAccessors.length))
103
- .range(innerBandScaleRange)
104
- .paddingInner(config.barPadding)
105
- .paddingOuter(config.barPadding)
106
-
107
- const barGroups = this.g
108
- .selectAll<SVGGElement, Datum>(`.${s.barGroup}`)
109
- .data(this._barData, (d, i) => `${getString(d, config.id, i) ?? i}`)
110
-
111
- const getBarGroupsTransform = (d: Datum, i: number): string => {
112
- const v = this.dataScale(getNumber(d, config.x, i))
113
- const x = this.isVertical() ? v : 0
114
- const y = this.isVertical() ? 0 : v
115
- return `translate(${x},${y})`
116
- }
117
-
118
- const barGroupsEnter = barGroups
119
- .enter()
120
- .append('g')
121
- .attr('class', s.barGroup)
122
- .attr('transform', getBarGroupsTransform)
123
- .style('opacity', 1)
124
-
125
- const barGroupsMerged = barGroupsEnter.merge(barGroups)
126
- smartTransition(barGroupsMerged, duration)
127
- .attr('transform', getBarGroupsTransform)
128
- .style('opacity', 1)
129
-
130
- const barGroupExit = barGroups.exit().attr('class', s.barGroupExit)
131
- smartTransition(barGroupExit, duration).style('opacity', 0).remove()
132
-
133
- // Animate exiting bars going down
134
- smartTransition(barGroupExit.selectAll<SVGPathElement, Datum>(`.${s.bar}`), duration)
135
- .attr('transform', (d, i, e) => {
136
- return this.isVertical()
137
- ? `translate(0,${this.yScale(0)}) scale(1,0)`
138
- : `translate(${this.xScale(0)},0) scale(0,1)`
139
- })
140
-
141
- const barWidth = innerBandScale.bandwidth()
142
- const bars = barGroupsMerged
143
- .selectAll<SVGPathElement, Datum>(`.${s.bar}`)
144
- .data((d) => yAccessors.map(() => d))
145
-
146
- const valueAxisDirection = this._getValueAxisDirection()
147
- const barsEnter = bars
148
- .enter()
149
- .append('path')
150
- .attr('class', s.bar)
151
- .attr('d', (d, i) => {
152
- const x = innerBandScale(i)
153
- const y = this.valueScale(0)
154
- const width = barWidth
155
- const height = 0
156
- return this._getBarPath(x, y, width, height, false, valueAxisDirection)
157
- })
158
- .style('fill', (d, i) => getColor(d, config.color, i))
159
-
160
- const barsMerged = barsEnter.merge(bars)
161
- smartTransition(barsMerged, duration)
162
- .attr('d', (d, j) => {
163
- const x = innerBandScale(j)
164
- const width = barWidth
165
-
166
- // Todo: Find a way to pass the datum index to `getNumber` below
167
- const value = getNumber(d, yAccessors[j])
168
- const isNegative = value < 0
169
- let y = isNegative ? this.valueScale(0) : this.valueScale(value || 0)
170
- let height = Math.abs(this.valueScale(0) - this.valueScale(value)) || 0
171
-
172
- // Optionally set minimum bar height
173
- if (height < config.barMinHeight) {
174
- const dir = valueAxisDirection === Direction.North ? -1 : 1
175
- y = this.valueScale(0) + dir * config.barMinHeight
176
- height = config.barMinHeight
177
- }
178
- return this._getBarPath(x, y, width, height, isNegative, valueAxisDirection)
179
- })
180
- .style('fill', (d, i) => getColor(d, config.color, i))
181
- .style('cursor', (d, i) => getString(d, config.cursor, i))
182
-
183
- smartTransition(bars.exit(), duration).remove()
184
- }
185
-
186
- _getValueAxisDirection (): Direction.North | Direction.South {
187
- return this.valueScale.range()[0] > this.valueScale.range()[1]
188
- ? Direction.North
189
- : Direction.South
190
- }
191
-
192
- _getVisibleData (): Datum[] {
193
- const {
194
- config,
195
- datamodel: { data },
196
- } = this
197
- const groupWidth = this._getGroupWidth()
198
- const halfGroupWidth = data.length < 2 ? 0 : groupWidth / 2
199
-
200
- const dataScale = this.dataScale
201
- const xHalfGroupWidth = Math.abs(
202
- (dataScale.invert(halfGroupWidth) as number) -
203
- (dataScale.invert(0) as number)
204
- )
205
- const filtered = data?.filter((d, i) => {
206
- const v = getNumber(d, config.x, i)
207
- const domain: number[] | Date[] = dataScale.domain()
208
- const domainMin = +domain[0]
209
- const domainMax = +domain[1]
210
- return (
211
- v >= domainMin - xHalfGroupWidth && v <= domainMax + xHalfGroupWidth
212
- )
213
- })
214
-
215
- return filtered
216
- }
217
-
218
- _getBarPath (
219
- x: number,
220
- y: number,
221
- width: number,
222
- height: number,
223
- isNegative: boolean,
224
- direction: Direction.North | Direction.South
225
- ): string {
226
- const { config } = this
227
-
228
- const cornerRadius = config.roundedCorners
229
- ? isNumber(config.roundedCorners)
230
- ? +config.roundedCorners
231
- : width / 2
232
- : 0
233
- const cornerRadiusClamped = clamp(
234
- cornerRadius,
235
- 0,
236
- Math.min(height, width) / 2
237
- )
238
-
239
- const isNorthDirected = direction === Direction.North
240
- const roundedTop = this.isVertical() && isNegative !== isNorthDirected
241
- const roundedBottom = this.isVertical() && isNegative === isNorthDirected
242
- const roundedLeft = !this.isVertical() && isNegative
243
- const roundedRight = !this.isVertical() && !isNegative
244
-
245
- return roundedRectPath({
246
- x: this.isVertical() ? x : y + (isNorthDirected ? 0 : -height),
247
- y: this.isVertical() ? y + (isNorthDirected ? 0 : -height) : x,
248
- w: this.isVertical() ? width : height,
249
- h: this.isVertical() ? height : width,
250
- tl: roundedTop || roundedLeft,
251
- tr: roundedTop || roundedRight,
252
- bl: roundedBottom || roundedLeft,
253
- br: roundedBottom || roundedRight,
254
- r: cornerRadiusClamped,
255
- })
256
- }
257
-
258
- _getGroupWidth (): number {
259
- const {
260
- config,
261
- datamodel: { data },
262
- } = this
263
- if (isEmpty(data)) return 0
264
- if (config.groupWidth) { return min([config.groupWidth, config.groupMaxWidth]) }
265
-
266
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
267
- // @ts-ignore
268
- const isOrdinal = this.dataScale.bandwidth
269
- const domain = (
270
- this.dataScale.domain ? this.dataScale.domain() : []
271
- ) as number[]
272
- const domainLength = isOrdinal ? domain.length : domain[1] - domain[0]
273
-
274
- // If the dataStep property is provided the amount of data elements is calculates as domainLength / dataStep
275
- // otherwise we get the number of data elements within the domain range
276
- // Or if the scale is ordinal we use data.length
277
- let dataSize =
278
- 1 + domainLength / config.dataStep ||
279
- (!isOrdinal &&
280
- data.filter((d, i) => {
281
- const value = getNumber(d, config.x, i)
282
- return value >= domain[0] && value <= domain[1]
283
- }).length) ||
284
- data.length
285
-
286
- // We increase the dataSize by 1 to take into account possible additional domain space
287
- if (!isOrdinal && dataSize >= 2) dataSize += 1
288
-
289
- const c = dataSize < 2 ? 1 : 1 - config.groupPadding
290
- const groupWidth =
291
- (c * (this.isVertical() ? this._width : this._height)) / dataSize
292
- return min([groupWidth, config.groupMaxWidth])
293
- }
294
-
295
- getValueScaleExtent (scaleByVisibleData: boolean): number[] {
296
- const { datamodel } = this
297
- const yAccessors = this.getAccessors()
298
-
299
- const data = scaleByVisibleData ? this._getVisibleData() : datamodel.data
300
- const min = getMin(data, ...yAccessors)
301
- const max = getMax(data, ...yAccessors)
302
- return [min > 0 ? 0 : min, max < 0 ? 0 : max]
303
- }
304
-
305
- _raiseSelection (d, i, els): void {
306
- select(els[i]).raise()
307
- }
308
-
309
- getDataScaleExtent (): number[] {
310
- const { config, datamodel } = this
311
- return getExtent(datamodel.data, config.x)
312
- }
313
-
314
- getYDataExtent (scaleByVisibleData: boolean): number[] {
315
- return this.isVertical()
316
- ? this.getValueScaleExtent(scaleByVisibleData)
317
- : this.getDataScaleExtent()
318
- }
319
-
320
- getXDataExtent (): number[] {
321
- return this.isVertical()
322
- ? this.getDataScaleExtent()
323
- : this.getValueScaleExtent(false)
324
- }
325
- }