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

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/declaration.d.ts +1 -0
  2. package/index.ts +1 -0
  3. package/licences.txt +43 -0
  4. package/maps.ts +1 -0
  5. package/package.json +1 -1
  6. package/rollup.config.js +71 -0
  7. package/rules/ts-getter-setter.js +35 -0
  8. package/src/components/area/config.ts +29 -0
  9. package/src/components/area/index.ts +133 -0
  10. package/{components/area/style.js → src/components/area/style.ts} +9 -10
  11. package/src/components/area/types.ts +2 -0
  12. package/src/components/axis/config.ts +76 -0
  13. package/src/components/axis/index.ts +363 -0
  14. package/{components/axis/style.js → src/components/axis/style.ts} +27 -22
  15. package/src/components/axis/types.ts +4 -0
  16. package/src/components/brush/config.ts +51 -0
  17. package/src/components/brush/index.ts +233 -0
  18. package/{components/brush/style.js → src/components/brush/style.ts} +15 -14
  19. package/src/components/brush/types.ts +8 -0
  20. package/src/components/bullet-legend/config.ts +38 -0
  21. package/src/components/bullet-legend/index.ts +104 -0
  22. package/{components/bullet-legend/style.js → src/components/bullet-legend/style.ts} +18 -16
  23. package/src/components/bullet-legend/types.ts +7 -0
  24. package/src/components/chord-diagram/config.ts +53 -0
  25. package/src/components/chord-diagram/index.ts +401 -0
  26. package/src/components/chord-diagram/modules/label.ts +155 -0
  27. package/src/components/chord-diagram/modules/link.ts +91 -0
  28. package/src/components/chord-diagram/modules/node.ts +80 -0
  29. package/{components/chord-diagram/style.js → src/components/chord-diagram/style.ts} +39 -30
  30. package/src/components/chord-diagram/types.ts +68 -0
  31. package/src/components/crosshair/config.ts +48 -0
  32. package/src/components/crosshair/index.ts +220 -0
  33. package/{components/crosshair/style.js → src/components/crosshair/style.ts} +12 -12
  34. package/src/components/crosshair/types.ts +15 -0
  35. package/src/components/donut/config.ts +65 -0
  36. package/src/components/donut/index.ts +148 -0
  37. package/src/components/donut/modules/arc.ts +86 -0
  38. package/{components/donut/style.js → src/components/donut/style.ts} +20 -18
  39. package/src/components/donut/types.ts +17 -0
  40. package/src/components/flow-legend/config.ts +31 -0
  41. package/src/components/flow-legend/index.ts +103 -0
  42. package/{components/flow-legend/style.js → src/components/flow-legend/style.ts} +25 -21
  43. package/src/components/flow-legend/types.ts +10 -0
  44. package/src/components/free-brush/config.ts +54 -0
  45. package/src/components/free-brush/index.ts +207 -0
  46. package/{components/free-brush/style.js → src/components/free-brush/style.ts} +12 -12
  47. package/src/components/free-brush/types.ts +8 -0
  48. package/src/components/graph/config.ts +280 -0
  49. package/src/components/graph/index.ts +809 -0
  50. package/src/components/graph/modules/layout-helpers.ts +96 -0
  51. package/src/components/graph/modules/layout.ts +502 -0
  52. package/src/components/graph/modules/link/helper.ts +105 -0
  53. package/src/components/graph/modules/link/index.ts +302 -0
  54. package/{components/graph/modules/link/style.js → src/components/graph/modules/link/style.ts} +45 -34
  55. package/src/components/graph/modules/node/helper.ts +162 -0
  56. package/src/components/graph/modules/node/index.ts +343 -0
  57. package/{components/graph/modules/node/style.js → src/components/graph/modules/node/style.ts} +72 -52
  58. package/src/components/graph/modules/panel/helper.ts +160 -0
  59. package/src/components/graph/modules/panel/index.ts +137 -0
  60. package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts} +42 -32
  61. package/src/components/graph/modules/shape.ts +108 -0
  62. package/src/components/graph/modules/zoom-levels.ts +6 -0
  63. package/src/components/graph/style.ts +72 -0
  64. package/src/components/graph/types.ts +152 -0
  65. package/src/components/grouped-bar/config.ts +40 -0
  66. package/src/components/grouped-bar/index.ts +325 -0
  67. package/{components/grouped-bar/style.js → src/components/grouped-bar/style.ts} +15 -14
  68. package/src/components/leaflet-flow-map/config.ts +60 -0
  69. package/src/components/leaflet-flow-map/index.ts +279 -0
  70. package/src/components/leaflet-flow-map/renderer-utils.ts +14 -0
  71. package/src/components/leaflet-flow-map/renderer.ts +146 -0
  72. package/{components/leaflet-flow-map/shaders.js → src/components/leaflet-flow-map/shaders.ts} +4 -7
  73. package/src/components/leaflet-flow-map/types.ts +18 -0
  74. package/src/components/leaflet-map/config.ts +234 -0
  75. package/src/components/leaflet-map/index.ts +808 -0
  76. package/src/components/leaflet-map/leaflet.css +625 -0
  77. package/src/components/leaflet-map/modules/clusterBackground.ts +34 -0
  78. package/src/components/leaflet-map/modules/donut.ts +37 -0
  79. package/src/components/leaflet-map/modules/map.ts +178 -0
  80. package/src/components/leaflet-map/modules/node.ts +208 -0
  81. package/src/components/leaflet-map/modules/selectionRing.ts +63 -0
  82. package/src/components/leaflet-map/modules/utils.ts +290 -0
  83. package/{components → src/components}/leaflet-map/renderer/leaflet-maplibre-gl.js +76 -78
  84. package/src/components/leaflet-map/renderer/map-style.ts +24 -0
  85. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +35 -0
  86. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +35 -0
  87. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +2185 -0
  88. package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +43 -0
  89. package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +40 -0
  90. package/{components → src/components}/leaflet-map/renderer/maplibre-gl.css.js +2 -4
  91. package/src/components/leaflet-map/style.ts +217 -0
  92. package/src/components/leaflet-map/types.ts +75 -0
  93. package/src/components/line/config.ts +34 -0
  94. package/src/components/line/index.ts +188 -0
  95. package/{components/line/style.js → src/components/line/style.ts} +18 -16
  96. package/src/components/line/types.ts +3 -0
  97. package/src/components/nested-donut/config.ts +75 -0
  98. package/src/components/nested-donut/index.ts +176 -0
  99. package/src/components/nested-donut/modules/arc.ts +78 -0
  100. package/src/components/nested-donut/modules/label.ts +63 -0
  101. package/src/components/nested-donut/style.ts +82 -0
  102. package/src/components/nested-donut/types.ts +29 -0
  103. package/src/components/sankey/config.ts +195 -0
  104. package/src/components/sankey/index.ts +387 -0
  105. package/src/components/sankey/modules/label.ts +228 -0
  106. package/src/components/sankey/modules/link.ts +141 -0
  107. package/src/components/sankey/modules/node.ts +221 -0
  108. package/{components/sankey/style.js → src/components/sankey/style.ts} +60 -44
  109. package/src/components/sankey/types.ts +95 -0
  110. package/src/components/scatter/config.ts +49 -0
  111. package/src/components/scatter/index.ts +220 -0
  112. package/src/components/scatter/modules/point.ts +123 -0
  113. package/src/components/scatter/modules/utils.ts +150 -0
  114. package/{components/scatter/style.js → src/components/scatter/style.ts} +15 -14
  115. package/src/components/scatter/types.ts +21 -0
  116. package/src/components/stacked-bar/config.ts +42 -0
  117. package/src/components/stacked-bar/index.ts +267 -0
  118. package/{components/stacked-bar/style.js → src/components/stacked-bar/style.ts} +15 -14
  119. package/src/components/stacked-bar/types.ts +5 -0
  120. package/src/components/timeline/config.ts +49 -0
  121. package/src/components/timeline/index.ts +302 -0
  122. package/{components/timeline/style.js → src/components/timeline/style.ts} +39 -30
  123. package/src/components/tooltip/config.ts +69 -0
  124. package/src/components/tooltip/index.ts +220 -0
  125. package/{components → src/components}/tooltip/style.js +11 -14
  126. package/src/components/topojson-map/config.ts +124 -0
  127. package/src/components/topojson-map/index.ts +436 -0
  128. package/{components/topojson-map/style.js → src/components/topojson-map/style.ts} +33 -26
  129. package/src/components/topojson-map/types.ts +123 -0
  130. package/src/components/topojson-map/utils.ts +29 -0
  131. package/src/components/vis-controls/config.ts +16 -0
  132. package/src/components/vis-controls/index.ts +68 -0
  133. package/{components/vis-controls/style.js → src/components/vis-controls/style.ts} +34 -27
  134. package/src/components/vis-controls/types.ts +14 -0
  135. package/src/components/xy-labels/config.ts +56 -0
  136. package/src/components/xy-labels/index.ts +109 -0
  137. package/src/components/xy-labels/modules/label.ts +140 -0
  138. package/{components/xy-labels/style.js → src/components/xy-labels/style.ts} +15 -14
  139. package/src/components/xy-labels/types.ts +26 -0
  140. package/src/components.ts +56 -0
  141. package/src/containers/single-container/config.ts +15 -0
  142. package/src/containers/single-container/index.ts +150 -0
  143. package/src/containers/xy-container/config.ts +112 -0
  144. package/src/containers/xy-container/index.ts +407 -0
  145. package/src/containers.ts +6 -0
  146. package/src/core/component/config.ts +61 -0
  147. package/src/core/component/index.ts +154 -0
  148. package/src/core/component/types.ts +9 -0
  149. package/src/core/config/index.ts +12 -0
  150. package/src/core/container/config.ts +56 -0
  151. package/src/core/container/index.ts +136 -0
  152. package/src/core/xy-component/config.ts +46 -0
  153. package/src/core/xy-component/index.ts +90 -0
  154. package/src/data-models/core.ts +15 -0
  155. package/src/data-models/graph.ts +138 -0
  156. package/src/data-models/map-graph.ts +72 -0
  157. package/src/data-models/map.ts +18 -0
  158. package/src/data-models/series.ts +16 -0
  159. package/src/index.ts +7 -0
  160. package/src/maps/china-provinces.json +1 -0
  161. package/src/maps/fr-regions.json +1 -0
  162. package/src/maps/germany-regions.json +1 -0
  163. package/src/maps/ind-regions.json +1 -0
  164. package/src/maps/uk-regions.json +1 -0
  165. package/src/maps/us-counties.json +1 -0
  166. package/src/maps/us-states.json +1 -0
  167. package/src/maps/world-110m-alpha.json +1 -0
  168. package/src/maps/world-simple.json +1 -0
  169. package/src/maps/world-simplest.json +1 -0
  170. package/src/maps.ts +34 -0
  171. package/src/styles/colors.ts +28 -0
  172. package/src/styles/index.ts +38 -0
  173. package/{styles/sizes.js → src/styles/sizes.ts} +6 -8
  174. package/src/types/accessor.ts +5 -0
  175. package/src/types/component.ts +15 -0
  176. package/src/types/curve.ts +62 -0
  177. package/src/types/data.ts +5 -0
  178. package/src/types/direction.ts +6 -0
  179. package/src/types/graph.ts +40 -0
  180. package/src/types/map.ts +5 -0
  181. package/src/types/misc.ts +10 -0
  182. package/src/types/position.ts +23 -0
  183. package/src/types/scale.ts +47 -0
  184. package/src/types/shape.ts +7 -0
  185. package/src/types/spacing.ts +6 -0
  186. package/src/types/svg.ts +32 -0
  187. package/src/types/symbol.ts +21 -0
  188. package/src/types/text.ts +71 -0
  189. package/src/types.ts +31 -0
  190. package/src/utils/color.ts +41 -0
  191. package/src/utils/d3.ts +15 -0
  192. package/src/utils/data.ts +328 -0
  193. package/src/utils/html.ts +13 -0
  194. package/src/utils/map.ts +29 -0
  195. package/src/utils/misc.ts +54 -0
  196. package/src/utils/path.ts +196 -0
  197. package/src/utils/scale.ts +1 -0
  198. package/src/utils/style.ts +37 -0
  199. package/src/utils/svg.ts +49 -0
  200. package/src/utils/text.ts +529 -0
  201. package/src/utils/type.ts +9 -0
  202. package/tsconfig.json +29 -0
  203. package/components/area/config.d.ts +0 -25
  204. package/components/area/config.js +0 -16
  205. package/components/area/config.js.map +0 -1
  206. package/components/area/index.d.ts +0 -19
  207. package/components/area/index.js +0 -102
  208. package/components/area/index.js.map +0 -1
  209. package/components/area/style.d.ts +0 -3
  210. package/components/area/style.js.map +0 -1
  211. package/components/area/types.d.ts +0 -6
  212. package/components/axis/config.d.ts +0 -71
  213. package/components/axis/config.js +0 -32
  214. package/components/axis/config.js.map +0 -1
  215. package/components/axis/index.d.ts +0 -44
  216. package/components/axis/index.js +0 -305
  217. package/components/axis/index.js.map +0 -1
  218. package/components/axis/style.d.ts +0 -9
  219. package/components/axis/style.js.map +0 -1
  220. package/components/axis/types.d.ts +0 -4
  221. package/components/axis/types.js +0 -8
  222. package/components/axis/types.js.map +0 -1
  223. package/components/brush/config.d.ts +0 -42
  224. package/components/brush/config.js +0 -24
  225. package/components/brush/config.js.map +0 -1
  226. package/components/brush/index.d.ts +0 -28
  227. package/components/brush/index.js +0 -199
  228. package/components/brush/index.js.map +0 -1
  229. package/components/brush/style.d.ts +0 -5
  230. package/components/brush/style.js.map +0 -1
  231. package/components/brush/types.d.ts +0 -7
  232. package/components/brush/types.js +0 -8
  233. package/components/brush/types.js.map +0 -1
  234. package/components/bullet-legend/config.d.ts +0 -34
  235. package/components/bullet-legend/config.js +0 -16
  236. package/components/bullet-legend/config.js.map +0 -1
  237. package/components/bullet-legend/index.d.ts +0 -19
  238. package/components/bullet-legend/index.js +0 -79
  239. package/components/bullet-legend/index.js.map +0 -1
  240. package/components/bullet-legend/style.d.ts +0 -6
  241. package/components/bullet-legend/style.js.map +0 -1
  242. package/components/bullet-legend/types.d.ts +0 -7
  243. package/components/bullet-legend/types.js +0 -2
  244. package/components/bullet-legend/types.js.map +0 -1
  245. package/components/chord-diagram/config.d.ts +0 -44
  246. package/components/chord-diagram/config.js +0 -25
  247. package/components/chord-diagram/config.js.map +0 -1
  248. package/components/chord-diagram/index.d.ts +0 -42
  249. package/components/chord-diagram/index.js +0 -305
  250. package/components/chord-diagram/index.js.map +0 -1
  251. package/components/chord-diagram/modules/label.d.ts +0 -8
  252. package/components/chord-diagram/modules/label.js +0 -115
  253. package/components/chord-diagram/modules/label.js.map +0 -1
  254. package/components/chord-diagram/modules/link.d.ts +0 -21
  255. package/components/chord-diagram/modules/link.js +0 -63
  256. package/components/chord-diagram/modules/link.js.map +0 -1
  257. package/components/chord-diagram/modules/node.d.ts +0 -17
  258. package/components/chord-diagram/modules/node.js +0 -52
  259. package/components/chord-diagram/modules/node.js.map +0 -1
  260. package/components/chord-diagram/style.d.ts +0 -13
  261. package/components/chord-diagram/style.js.map +0 -1
  262. package/components/chord-diagram/types.d.ts +0 -58
  263. package/components/chord-diagram/types.js +0 -8
  264. package/components/chord-diagram/types.js.map +0 -1
  265. package/components/crosshair/config.d.ts +0 -43
  266. package/components/crosshair/config.js +0 -19
  267. package/components/crosshair/config.js.map +0 -1
  268. package/components/crosshair/index.d.ts +0 -35
  269. package/components/crosshair/index.js +0 -183
  270. package/components/crosshair/index.js.map +0 -1
  271. package/components/crosshair/style.d.ts +0 -4
  272. package/components/crosshair/style.js.map +0 -1
  273. package/components/crosshair/types.d.ts +0 -13
  274. package/components/crosshair/types.js +0 -2
  275. package/components/crosshair/types.js.map +0 -1
  276. package/components/donut/config.d.ts +0 -59
  277. package/components/donut/config.js +0 -28
  278. package/components/donut/config.js.map +0 -1
  279. package/components/donut/index.d.ts +0 -21
  280. package/components/donut/index.js +0 -107
  281. package/components/donut/index.js.map +0 -1
  282. package/components/donut/modules/arc.d.ts +0 -10
  283. package/components/donut/modules/arc.js +0 -59
  284. package/components/donut/modules/arc.js.map +0 -1
  285. package/components/donut/style.d.ts +0 -7
  286. package/components/donut/style.js.map +0 -1
  287. package/components/donut/types.d.ts +0 -20
  288. package/components/flow-legend/config.d.ts +0 -29
  289. package/components/flow-legend/config.js +0 -18
  290. package/components/flow-legend/config.js.map +0 -1
  291. package/components/flow-legend/index.d.ts +0 -16
  292. package/components/flow-legend/index.js +0 -75
  293. package/components/flow-legend/index.js.map +0 -1
  294. package/components/flow-legend/style.d.ts +0 -8
  295. package/components/flow-legend/style.js.map +0 -1
  296. package/components/flow-legend/types.d.ts +0 -9
  297. package/components/flow-legend/types.js +0 -8
  298. package/components/flow-legend/types.js.map +0 -1
  299. package/components/free-brush/config.d.ts +0 -45
  300. package/components/free-brush/config.js +0 -24
  301. package/components/free-brush/config.js.map +0 -1
  302. package/components/free-brush/index.d.ts +0 -20
  303. package/components/free-brush/index.js +0 -192
  304. package/components/free-brush/index.js.map +0 -1
  305. package/components/free-brush/style.d.ts +0 -4
  306. package/components/free-brush/style.js.map +0 -1
  307. package/components/free-brush/types.d.ts +0 -7
  308. package/components/free-brush/types.js +0 -9
  309. package/components/free-brush/types.js.map +0 -1
  310. package/components/graph/config.d.ts +0 -238
  311. package/components/graph/config.js +0 -84
  312. package/components/graph/config.js.map +0 -1
  313. package/components/graph/index.d.ts +0 -126
  314. package/components/graph/index.js +0 -656
  315. package/components/graph/index.js.map +0 -1
  316. package/components/graph/modules/layout-helpers.d.ts +0 -21
  317. package/components/graph/modules/layout-helpers.js +0 -69
  318. package/components/graph/modules/layout-helpers.js.map +0 -1
  319. package/components/graph/modules/layout.d.ts +0 -10
  320. package/components/graph/modules/layout.js +0 -399
  321. package/components/graph/modules/layout.js.map +0 -1
  322. package/components/graph/modules/link/helper.d.ts +0 -25
  323. package/components/graph/modules/link/helper.js +0 -74
  324. package/components/graph/modules/link/helper.js.map +0 -1
  325. package/components/graph/modules/link/index.d.ts +0 -11
  326. package/components/graph/modules/link/index.js +0 -212
  327. package/components/graph/modules/link/index.js.map +0 -1
  328. package/components/graph/modules/link/style.d.ts +0 -15
  329. package/components/graph/modules/link/style.js.map +0 -1
  330. package/components/graph/modules/node/helper.d.ts +0 -21
  331. package/components/graph/modules/node/helper.js +0 -126
  332. package/components/graph/modules/node/helper.js.map +0 -1
  333. package/components/graph/modules/node/index.d.ts +0 -11
  334. package/components/graph/modules/node/index.js +0 -252
  335. package/components/graph/modules/node/index.js.map +0 -1
  336. package/components/graph/modules/node/style.d.ts +0 -24
  337. package/components/graph/modules/node/style.js.map +0 -1
  338. package/components/graph/modules/panel/helper.d.ts +0 -18
  339. package/components/graph/modules/panel/helper.js +0 -111
  340. package/components/graph/modules/panel/helper.js.map +0 -1
  341. package/components/graph/modules/panel/index.d.ts +0 -7
  342. package/components/graph/modules/panel/index.js +0 -98
  343. package/components/graph/modules/panel/index.js.map +0 -1
  344. package/components/graph/modules/panel/style.d.ts +0 -14
  345. package/components/graph/modules/panel/style.js.map +0 -1
  346. package/components/graph/modules/shape.d.ts +0 -6
  347. package/components/graph/modules/shape.js +0 -80
  348. package/components/graph/modules/shape.js.map +0 -1
  349. package/components/graph/modules/zoom-levels.d.ts +0 -6
  350. package/components/graph/modules/zoom-levels.js +0 -10
  351. package/components/graph/modules/zoom-levels.js.map +0 -1
  352. package/components/graph/style.d.ts +0 -6
  353. package/components/graph/style.js +0 -66
  354. package/components/graph/style.js.map +0 -1
  355. package/components/graph/types.d.ts +0 -125
  356. package/components/graph/types.js +0 -30
  357. package/components/graph/types.js.map +0 -1
  358. package/components/grouped-bar/config.d.ts +0 -36
  359. package/components/grouped-bar/config.js +0 -20
  360. package/components/grouped-bar/config.js.map +0 -1
  361. package/components/grouped-bar/index.d.ts +0 -32
  362. package/components/grouped-bar/index.js +0 -249
  363. package/components/grouped-bar/index.js.map +0 -1
  364. package/components/grouped-bar/style.d.ts +0 -5
  365. package/components/grouped-bar/style.js.map +0 -1
  366. package/components/leaflet-flow-map/config.d.ts +0 -46
  367. package/components/leaflet-flow-map/config.js +0 -25
  368. package/components/leaflet-flow-map/config.js.map +0 -1
  369. package/components/leaflet-flow-map/index.d.ts +0 -52
  370. package/components/leaflet-flow-map/index.js +0 -220
  371. package/components/leaflet-flow-map/index.js.map +0 -1
  372. package/components/leaflet-flow-map/renderer-utils.d.ts +0 -5
  373. package/components/leaflet-flow-map/renderer-utils.js +0 -15
  374. package/components/leaflet-flow-map/renderer-utils.js.map +0 -1
  375. package/components/leaflet-flow-map/renderer.d.ts +0 -26
  376. package/components/leaflet-flow-map/renderer.js +0 -117
  377. package/components/leaflet-flow-map/renderer.js.map +0 -1
  378. package/components/leaflet-flow-map/shaders.d.ts +0 -2
  379. package/components/leaflet-flow-map/shaders.js.map +0 -1
  380. package/components/leaflet-flow-map/types.d.ts +0 -23
  381. package/components/leaflet-map/config.d.ts +0 -193
  382. package/components/leaflet-map/config.js +0 -71
  383. package/components/leaflet-map/config.js.map +0 -1
  384. package/components/leaflet-map/index.d.ts +0 -130
  385. package/components/leaflet-map/index.js +0 -690
  386. package/components/leaflet-map/index.js.map +0 -1
  387. package/components/leaflet-map/leaflet.css.js +0 -5
  388. package/components/leaflet-map/leaflet.css.js.map +0 -1
  389. package/components/leaflet-map/modules/clusterBackground.d.ts +0 -5
  390. package/components/leaflet-map/modules/clusterBackground.js +0 -27
  391. package/components/leaflet-map/modules/clusterBackground.js.map +0 -1
  392. package/components/leaflet-map/modules/donut.d.ts +0 -3
  393. package/components/leaflet-map/modules/donut.js +0 -25
  394. package/components/leaflet-map/modules/donut.js.map +0 -1
  395. package/components/leaflet-map/modules/map.d.ts +0 -14
  396. package/components/leaflet-map/modules/map.js +0 -154
  397. package/components/leaflet-map/modules/map.js.map +0 -1
  398. package/components/leaflet-map/modules/node.d.ts +0 -9
  399. package/components/leaflet-map/modules/node.js +0 -162
  400. package/components/leaflet-map/modules/node.js.map +0 -1
  401. package/components/leaflet-map/modules/selectionRing.d.ts +0 -7
  402. package/components/leaflet-map/modules/selectionRing.js +0 -41
  403. package/components/leaflet-map/modules/selectionRing.js.map +0 -1
  404. package/components/leaflet-map/modules/utils.d.ts +0 -50
  405. package/components/leaflet-map/modules/utils.js +0 -210
  406. package/components/leaflet-map/modules/utils.js.map +0 -1
  407. package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +0 -1
  408. package/components/leaflet-map/renderer/map-style.d.ts +0 -4
  409. package/components/leaflet-map/renderer/map-style.js +0 -15
  410. package/components/leaflet-map/renderer/map-style.js.map +0 -1
  411. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +0 -40
  412. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +0 -1
  413. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +0 -40
  414. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +0 -1
  415. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +0 -4981
  416. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +0 -1
  417. package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +0 -8
  418. package/components/leaflet-map/renderer/mapboxgl-layer.js +0 -27
  419. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +0 -1
  420. package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -4
  421. package/components/leaflet-map/renderer/mapboxgl-utils.js +0 -39
  422. package/components/leaflet-map/renderer/mapboxgl-utils.js.map +0 -1
  423. package/components/leaflet-map/renderer/maplibre-gl.css.js.map +0 -1
  424. package/components/leaflet-map/style.d.ts +0 -52
  425. package/components/leaflet-map/style.js +0 -183
  426. package/components/leaflet-map/style.js.map +0 -1
  427. package/components/leaflet-map/types.d.ts +0 -75
  428. package/components/leaflet-map/types.js +0 -15
  429. package/components/leaflet-map/types.js.map +0 -1
  430. package/components/line/config.d.ts +0 -30
  431. package/components/line/config.js +0 -17
  432. package/components/line/config.js.map +0 -1
  433. package/components/line/index.d.ts +0 -27
  434. package/components/line/index.js +0 -152
  435. package/components/line/index.js.map +0 -1
  436. package/components/line/style.d.ts +0 -6
  437. package/components/line/style.js.map +0 -1
  438. package/components/line/types.d.ts +0 -12
  439. package/components/nested-donut/config.d.ts +0 -59
  440. package/components/nested-donut/config.js +0 -19
  441. package/components/nested-donut/config.js.map +0 -1
  442. package/components/nested-donut/index.d.ts +0 -38
  443. package/components/nested-donut/index.js +0 -133
  444. package/components/nested-donut/index.js.map +0 -1
  445. package/components/nested-donut/modules/arc.d.ts +0 -17
  446. package/components/nested-donut/modules/arc.js +0 -50
  447. package/components/nested-donut/modules/arc.js.map +0 -1
  448. package/components/nested-donut/modules/label.d.ts +0 -7
  449. package/components/nested-donut/modules/label.js +0 -34
  450. package/components/nested-donut/modules/label.js.map +0 -1
  451. package/components/nested-donut/style.d.ts +0 -26
  452. package/components/nested-donut/style.js +0 -70
  453. package/components/nested-donut/style.js.map +0 -1
  454. package/components/nested-donut/types.d.ts +0 -24
  455. package/components/nested-donut/types.js +0 -11
  456. package/components/nested-donut/types.js.map +0 -1
  457. package/components/sankey/config.d.ts +0 -162
  458. package/components/sankey/config.js +0 -65
  459. package/components/sankey/config.js.map +0 -1
  460. package/components/sankey/index.d.ts +0 -59
  461. package/components/sankey/index.js +0 -306
  462. package/components/sankey/index.js.map +0 -1
  463. package/components/sankey/modules/label.d.ts +0 -23
  464. package/components/sankey/modules/label.js +0 -168
  465. package/components/sankey/modules/label.js.map +0 -1
  466. package/components/sankey/modules/link.d.ts +0 -14
  467. package/components/sankey/modules/link.js +0 -108
  468. package/components/sankey/modules/link.js.map +0 -1
  469. package/components/sankey/modules/node.d.ts +0 -10
  470. package/components/sankey/modules/node.js +0 -156
  471. package/components/sankey/modules/node.js.map +0 -1
  472. package/components/sankey/style.d.ts +0 -20
  473. package/components/sankey/style.js.map +0 -1
  474. package/components/sankey/types.d.ts +0 -84
  475. package/components/sankey/types.js +0 -34
  476. package/components/sankey/types.js.map +0 -1
  477. package/components/scatter/config.d.ts +0 -44
  478. package/components/scatter/config.js +0 -23
  479. package/components/scatter/config.js.map +0 -1
  480. package/components/scatter/index.d.ts +0 -28
  481. package/components/scatter/index.js +0 -167
  482. package/components/scatter/index.js.map +0 -1
  483. package/components/scatter/modules/point.d.ts +0 -7
  484. package/components/scatter/modules/point.js +0 -86
  485. package/components/scatter/modules/point.js.map +0 -1
  486. package/components/scatter/modules/utils.d.ts +0 -11
  487. package/components/scatter/modules/utils.js +0 -112
  488. package/components/scatter/modules/utils.js.map +0 -1
  489. package/components/scatter/style.d.ts +0 -5
  490. package/components/scatter/style.js.map +0 -1
  491. package/components/scatter/types.d.ts +0 -19
  492. package/components/stacked-bar/config.d.ts +0 -38
  493. package/components/stacked-bar/config.js +0 -20
  494. package/components/stacked-bar/config.js.map +0 -1
  495. package/components/stacked-bar/index.d.ts +0 -28
  496. package/components/stacked-bar/index.js +0 -208
  497. package/components/stacked-bar/index.js.map +0 -1
  498. package/components/stacked-bar/style.d.ts +0 -5
  499. package/components/stacked-bar/style.js.map +0 -1
  500. package/components/stacked-bar/types.d.ts +0 -5
  501. package/components/timeline/config.d.ts +0 -43
  502. package/components/timeline/config.js +0 -24
  503. package/components/timeline/config.js.map +0 -1
  504. package/components/timeline/index.d.ts +0 -41
  505. package/components/timeline/index.js +0 -244
  506. package/components/timeline/index.js.map +0 -1
  507. package/components/timeline/style.d.ts +0 -13
  508. package/components/timeline/style.js.map +0 -1
  509. package/components/tooltip/config.d.ts +0 -68
  510. package/components/tooltip/config.js +0 -20
  511. package/components/tooltip/config.js.map +0 -1
  512. package/components/tooltip/index.d.ts +0 -36
  513. package/components/tooltip/index.js +0 -184
  514. package/components/tooltip/index.js.map +0 -1
  515. package/components/tooltip/style.js.map +0 -1
  516. package/components/topojson-map/config.d.ts +0 -99
  517. package/components/topojson-map/config.js +0 -42
  518. package/components/topojson-map/config.js.map +0 -1
  519. package/components/topojson-map/index.d.ts +0 -52
  520. package/components/topojson-map/index.js +0 -355
  521. package/components/topojson-map/index.js.map +0 -1
  522. package/components/topojson-map/style.d.ts +0 -11
  523. package/components/topojson-map/style.js.map +0 -1
  524. package/components/topojson-map/types.d.ts +0 -78
  525. package/components/topojson-map/types.js +0 -80
  526. package/components/topojson-map/types.js.map +0 -1
  527. package/components/topojson-map/utils.d.ts +0 -3
  528. package/components/topojson-map/utils.js +0 -30
  529. package/components/topojson-map/utils.js.map +0 -1
  530. package/components/vis-controls/config.d.ts +0 -12
  531. package/components/vis-controls/config.js +0 -13
  532. package/components/vis-controls/config.js.map +0 -1
  533. package/components/vis-controls/index.d.ts +0 -14
  534. package/components/vis-controls/index.js +0 -52
  535. package/components/vis-controls/index.js.map +0 -1
  536. package/components/vis-controls/style.d.ts +0 -11
  537. package/components/vis-controls/style.js.map +0 -1
  538. package/components/vis-controls/types.d.ts +0 -13
  539. package/components/vis-controls/types.js +0 -8
  540. package/components/vis-controls/types.js.map +0 -1
  541. package/components/xy-labels/config.d.ts +0 -48
  542. package/components/xy-labels/config.js +0 -25
  543. package/components/xy-labels/config.js.map +0 -1
  544. package/components/xy-labels/index.d.ts +0 -15
  545. package/components/xy-labels/index.js +0 -87
  546. package/components/xy-labels/index.js.map +0 -1
  547. package/components/xy-labels/modules/label.d.ts +0 -9
  548. package/components/xy-labels/modules/label.js +0 -107
  549. package/components/xy-labels/modules/label.js.map +0 -1
  550. package/components/xy-labels/style.d.ts +0 -5
  551. package/components/xy-labels/style.js.map +0 -1
  552. package/components/xy-labels/types.d.ts +0 -23
  553. package/components/xy-labels/types.js +0 -9
  554. package/components/xy-labels/types.js.map +0 -1
  555. package/components.d.ts +0 -51
  556. package/components.js +0 -29
  557. package/components.js.map +0 -1
  558. package/containers/single-container/config.d.ts +0 -12
  559. package/containers/single-container/config.js +0 -12
  560. package/containers/single-container/config.js.map +0 -1
  561. package/containers/single-container/index.d.ts +0 -19
  562. package/containers/single-container/index.js +0 -128
  563. package/containers/single-container/index.js.map +0 -1
  564. package/containers/xy-container/config.d.ts +0 -99
  565. package/containers/xy-container/config.js +0 -30
  566. package/containers/xy-container/config.js.map +0 -1
  567. package/containers/xy-container/index.d.ts +0 -34
  568. package/containers/xy-container/index.js +0 -330
  569. package/containers/xy-container/index.js.map +0 -1
  570. package/containers.d.ts +0 -6
  571. package/containers.js +0 -4
  572. package/containers.js.map +0 -1
  573. package/core/component/config.d.ts +0 -58
  574. package/core/component/config.js +0 -14
  575. package/core/component/config.js.map +0 -1
  576. package/core/component/index.d.ts +0 -43
  577. package/core/component/index.js +0 -118
  578. package/core/component/index.js.map +0 -1
  579. package/core/component/types.d.ts +0 -2
  580. package/core/component/types.js +0 -2
  581. package/core/component/types.js.map +0 -1
  582. package/core/config/index.d.ts +0 -3
  583. package/core/config/index.js +0 -16
  584. package/core/config/index.js.map +0 -1
  585. package/core/container/config.d.ts +0 -48
  586. package/core/container/config.js +0 -29
  587. package/core/container/config.js.map +0 -1
  588. package/core/container/index.d.ts +0 -26
  589. package/core/container/index.js +0 -105
  590. package/core/container/index.js.map +0 -1
  591. package/core/xy-component/config.d.ts +0 -38
  592. package/core/xy-component/config.js +0 -20
  593. package/core/xy-component/config.js.map +0 -1
  594. package/core/xy-component/index.d.ts +0 -27
  595. package/core/xy-component/index.js +0 -74
  596. package/core/xy-component/index.js.map +0 -1
  597. package/data-models/core.d.ts +0 -6
  598. package/data-models/core.js +0 -14
  599. package/data-models/core.js.map +0 -1
  600. package/data-models/graph.d.ts +0 -24
  601. package/data-models/graph.js +0 -107
  602. package/data-models/graph.js.map +0 -1
  603. package/data-models/map-graph.d.ts +0 -21
  604. package/data-models/map-graph.js +0 -62
  605. package/data-models/map-graph.js.map +0 -1
  606. package/data-models/map.d.ts +0 -5
  607. package/data-models/map.js +0 -12
  608. package/data-models/map.js.map +0 -1
  609. package/data-models/series.d.ts +0 -6
  610. package/data-models/series.js +0 -19
  611. package/data-models/series.js.map +0 -1
  612. package/index.d.ts +0 -7
  613. package/index.js +0 -55
  614. package/index.js.map +0 -1
  615. package/maps/china-provinces.json.js +0 -140373
  616. package/maps/fr-regions.json.js +0 -14162
  617. package/maps/germany-regions.json.js +0 -35760
  618. package/maps/ind-regions.json.js +0 -290584
  619. package/maps/uk-regions.json.js +0 -96233
  620. package/maps/us-counties.json.js +0 -206318
  621. package/maps/us-states.json.js +0 -16345
  622. package/maps/world-110m-alpha.json.js +0 -251366
  623. package/maps/world-simple.json.js +0 -89428
  624. package/maps/world-simplest.json.js +0 -28175
  625. package/maps.d.ts +0 -60
  626. package/maps.js +0 -23
  627. package/styles/colors.d.ts +0 -7
  628. package/styles/colors.js +0 -24
  629. package/styles/colors.js.map +0 -1
  630. package/styles/index.d.ts +0 -7
  631. package/styles/index.js +0 -38
  632. package/styles/index.js.map +0 -1
  633. package/styles/sizes.d.ts +0 -2
  634. package/styles/sizes.js.map +0 -1
  635. package/types/accessor.d.ts +0 -5
  636. package/types/accessor.js +0 -2
  637. package/types/accessor.js.map +0 -1
  638. package/types/component.d.ts +0 -13
  639. package/types/component.js +0 -14
  640. package/types/component.js.map +0 -1
  641. package/types/curve.d.ts +0 -40
  642. package/types/curve.js +0 -46
  643. package/types/curve.js.map +0 -1
  644. package/types/data.d.ts +0 -7
  645. package/types/data.js +0 -2
  646. package/types/data.js.map +0 -1
  647. package/types/direction.d.ts +0 -6
  648. package/types/direction.js +0 -10
  649. package/types/direction.js.map +0 -1
  650. package/types/graph.d.ts +0 -35
  651. package/types/graph.js +0 -2
  652. package/types/graph.js.map +0 -1
  653. package/types/map.d.ts +0 -4
  654. package/types/map.js +0 -2
  655. package/types/map.js.map +0 -1
  656. package/types/misc.d.ts +0 -8
  657. package/types/position.d.ts +0 -20
  658. package/types/position.js +0 -27
  659. package/types/position.js.map +0 -1
  660. package/types/scale.d.ts +0 -23
  661. package/types/scale.js +0 -27
  662. package/types/scale.js.map +0 -1
  663. package/types/shape.d.ts +0 -7
  664. package/types/shape.js +0 -11
  665. package/types/shape.js.map +0 -1
  666. package/types/spacing.d.ts +0 -6
  667. package/types/spacing.js +0 -2
  668. package/types/spacing.js.map +0 -1
  669. package/types/svg.d.ts +0 -18
  670. package/types/svg.js +0 -22
  671. package/types/svg.js.map +0 -1
  672. package/types/symbol.d.ts +0 -18
  673. package/types/symbol.js +0 -24
  674. package/types/symbol.js.map +0 -1
  675. package/types/text.d.ts +0 -47
  676. package/types/text.js +0 -26
  677. package/types/text.js.map +0 -1
  678. package/types.d.ts +0 -27
  679. package/types.js +0 -30
  680. package/types.js.map +0 -1
  681. package/utils/color.d.ts +0 -10
  682. package/utils/color.js +0 -32
  683. package/utils/color.js.map +0 -1
  684. package/utils/d3.d.ts +0 -3
  685. package/utils/d3.js +0 -16
  686. package/utils/d3.js.map +0 -1
  687. package/utils/data.d.ts +0 -45
  688. package/utils/data.js +0 -274
  689. package/utils/data.js.map +0 -1
  690. package/utils/html.d.ts +0 -1
  691. package/utils/html.js +0 -16
  692. package/utils/html.js.map +0 -1
  693. package/utils/map.d.ts +0 -2
  694. package/utils/map.js +0 -20
  695. package/utils/map.js.map +0 -1
  696. package/utils/misc.d.ts +0 -9
  697. package/utils/misc.js +0 -47
  698. package/utils/misc.js.map +0 -1
  699. package/utils/path.d.ts +0 -23
  700. package/utils/path.js +0 -144
  701. package/utils/path.js.map +0 -1
  702. package/utils/scale.d.ts +0 -1
  703. package/utils/style.d.ts +0 -6
  704. package/utils/style.js +0 -24
  705. package/utils/style.js.map +0 -1
  706. package/utils/svg.d.ts +0 -3
  707. package/utils/text.d.ts +0 -139
  708. package/utils/text.js +0 -443
  709. package/utils/text.js.map +0 -1
  710. package/utils/type.d.ts +0 -5
@@ -1,107 +0,0 @@
1
- import { select } from 'd3-selection';
2
- import { mean } from 'd3-array';
3
- import { color } from 'd3-color';
4
- import { smartTransition } from '../../../utils/d3.js';
5
- import { isStringCSSVariable, getCSSVariableValue, getCSSVariableValueInPixels } from '../../../utils/misc.js';
6
- import { hexToBrightness, getColor } from '../../../utils/color.js';
7
- import { getNumber, getString, getValue } from '../../../utils/data.js';
8
- import { XYLabelPositioning } from '../types.js';
9
-
10
- function createLabels(selection) {
11
- selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`);
12
- selection.append('rect').style('fill', d => d._screen.backgroundColor);
13
- selection.append('text')
14
- .style('text-anchor', 'middle')
15
- .style('dominant-baseline', 'central')
16
- .style('fill', d => d._screen.backgroundColor)
17
- .style('pointer-events', 'none');
18
- selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`);
19
- }
20
- function updateLabels(selection, config, duration) {
21
- selection.each((d, i, elements) => {
22
- var _a, _b;
23
- const group = select(elements[i]);
24
- const text = group.select('text');
25
- const rect = group.select('rect');
26
- const backgroundColor = d._screen.backgroundColor;
27
- const labelText = (_a = d._screen.labelText) !== null && _a !== void 0 ? _a : '';
28
- const labelFontSize = d._screen.fontSize;
29
- let labelColor = d._screen.labelColor;
30
- // Label background
31
- const backgroundHeight = labelFontSize * 1.7;
32
- let backgroundWidth = labelFontSize * labelText.length * 0.7;
33
- if (backgroundWidth < backgroundHeight)
34
- backgroundWidth = backgroundHeight;
35
- smartTransition(rect, duration)
36
- .attr('width', backgroundWidth)
37
- .attr('height', backgroundHeight)
38
- .attr('x', -backgroundWidth / 2)
39
- .attr('y', -backgroundHeight / 2)
40
- .attr('rx', labelFontSize)
41
- .attr('ry', labelFontSize)
42
- .style('fill', backgroundColor);
43
- // Label
44
- if (!labelColor) {
45
- const hex = (_b = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)) === null || _b === void 0 ? void 0 : _b.hex();
46
- const brightness = hexToBrightness(hex);
47
- labelColor = brightness > config.labelTextBrightnessRatio
48
- ? 'var(--vis-xy-label-text-color-dark)'
49
- : 'var(--vis-xy-label-text-color-light)';
50
- }
51
- text.html(labelText)
52
- .attr('font-size', labelFontSize);
53
- smartTransition(text, duration)
54
- .style('fill', labelColor);
55
- rect.style('cursor', d._screen.cursor);
56
- });
57
- smartTransition(selection, duration)
58
- .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`);
59
- }
60
- function removeLabels(selection, duration) {
61
- smartTransition(selection, duration)
62
- .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
63
- .remove();
64
- }
65
- function getLabelPosition(value, positioning, scale) {
66
- var _a;
67
- switch (positioning) {
68
- case XYLabelPositioning.DataSpace: return (_a = scale(value)) !== null && _a !== void 0 ? _a : 0;
69
- case XYLabelPositioning.AbsolutePx: return value;
70
- case XYLabelPositioning.AbsolutePercentage: {
71
- const scaleRange = scale.range();
72
- return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100;
73
- }
74
- }
75
- }
76
- function getLabelRenderProps(data, el, config, xScale, yScale) {
77
- var _a, _b;
78
- const isCluster = Array.isArray(data);
79
- const fontSize = isCluster
80
- ? ((_a = getNumber(data, config.clusterFontSize)) !== null && _a !== void 0 ? _a : getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))
81
- : ((_b = getNumber(data, config.labelFontSize)) !== null && _b !== void 0 ? _b : getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el));
82
- const labelText = (isCluster ? config.clusterLabel(data) : getString(data, config.label)) || '';
83
- const backgroundHeight = fontSize * 1.7;
84
- let backgroundWidth = fontSize * labelText.length * 0.7;
85
- if (backgroundWidth < backgroundHeight)
86
- backgroundWidth = backgroundHeight;
87
- const x = isCluster
88
- ? mean(data, d => d._screen.x)
89
- : getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale);
90
- const y = isCluster
91
- ? mean(data, d => d._screen.y)
92
- : getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale);
93
- return {
94
- x,
95
- y,
96
- fontSize,
97
- labelText,
98
- labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),
99
- backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),
100
- cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),
101
- width: backgroundWidth,
102
- height: backgroundHeight,
103
- };
104
- }
105
-
106
- export { createLabels, getLabelPosition, getLabelRenderProps, removeLabels, updateLabels };
107
- //# sourceMappingURL=label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.js","sources":["../../../../src/components/xy-labels/modules/label.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\nimport { mean } from 'd3-array'\nimport { color } from 'd3-color'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels, getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getNumber, getString, getValue } from 'utils/data'\n\n// Types\nimport { ContinuousScale } from 'types/scale'\n\n// Config\nimport { XYLabelsConfig } from '../config'\n\n// Local Types\nimport { XYLabel, XYLabelCluster, XYLabelPositioning, XYLabelRenderProps } from '../types'\n\nexport function createLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>\n): void {\n selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`)\n selection.append('rect').style('fill', d => d._screen.backgroundColor)\n selection.append('text')\n .style('text-anchor', 'middle')\n .style('dominant-baseline', 'central')\n .style('fill', d => d._screen.backgroundColor)\n .style('pointer-events', 'none')\n\n selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)\n}\n\nexport function updateLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,\n config: XYLabelsConfig<Datum>,\n duration: number\n): void {\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any> = select(elements[i])\n const text = group.select('text')\n const rect = group.select('rect')\n\n const backgroundColor = d._screen.backgroundColor\n const labelText = d._screen.labelText ?? ''\n const labelFontSize = d._screen.fontSize\n let labelColor = d._screen.labelColor\n\n // Label background\n const backgroundHeight = labelFontSize * 1.7\n let backgroundWidth = labelFontSize * labelText.length * 0.7\n if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight\n smartTransition(rect, duration)\n .attr('width', backgroundWidth)\n .attr('height', backgroundHeight)\n .attr('x', -backgroundWidth / 2)\n .attr('y', -backgroundHeight / 2)\n .attr('rx', labelFontSize)\n .attr('ry', labelFontSize)\n .style('fill', backgroundColor)\n\n // Label\n if (!labelColor) {\n const hex = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)?.hex()\n const brightness = hexToBrightness(hex)\n labelColor = brightness > config.labelTextBrightnessRatio\n ? 'var(--vis-xy-label-text-color-dark)'\n : 'var(--vis-xy-label-text-color-light)'\n }\n\n text.html(labelText)\n .attr('font-size', labelFontSize)\n\n smartTransition(text, duration)\n .style('fill', labelColor)\n\n rect.style('cursor', d._screen.cursor)\n })\n\n smartTransition(selection, duration)\n .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`)\n}\n\nexport function removeLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,\n duration: number\n): void {\n smartTransition(selection, duration)\n .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)\n .remove()\n}\n\nexport function getLabelPosition (value: number, positioning: XYLabelPositioning, scale: ContinuousScale): number {\n switch (positioning) {\n case XYLabelPositioning.DataSpace: return scale(value) ?? 0\n case XYLabelPositioning.AbsolutePx: return value\n case XYLabelPositioning.AbsolutePercentage: {\n const scaleRange = scale.range()\n return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100\n }\n }\n}\n\nexport function getLabelRenderProps<Datum> (\n data: Datum | XYLabel<Datum>[],\n el: SVGGraphicsElement,\n config: XYLabelsConfig<Datum>,\n xScale: ContinuousScale,\n yScale: ContinuousScale\n): XYLabelRenderProps {\n const isCluster = Array.isArray(data)\n const fontSize = isCluster\n ? (getNumber(data, config.clusterFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))\n : (getNumber(data, config.labelFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el))\n\n const labelText = (isCluster ? config.clusterLabel(data as XYLabel<Datum>[]) : getString(data, config.label)) || ''\n const backgroundHeight = fontSize * 1.7\n let backgroundWidth = fontSize * labelText.length * 0.7\n if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight\n\n const x = isCluster\n ? mean(data as XYLabel<Datum>[], d => d._screen.x)\n : getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale)\n\n const y = isCluster\n ? mean(data as XYLabel<Datum>[], d => d._screen.y)\n : getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale)\n\n return {\n x,\n y,\n fontSize,\n labelText,\n labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),\n backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),\n cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),\n width: backgroundWidth,\n height: backgroundHeight,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAmBM,SAAU,YAAY,CAC1B,SAAmF,EAAA;IAEnF,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAa,UAAA,EAAA,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA,CAAA,EAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAG,CAAA,CAAA,CAAC,CAAA;IAC5E,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;AACtE,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC9B,SAAA,KAAK,CAAC,mBAAmB,EAAE,SAAS,CAAC;AACrC,SAAA,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,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E,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC;QAC/F,eAAe,EAAE,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC;QACnH,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;AAC1F,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,MAAM,EAAE,gBAAgB;KACzB,CAAA;AACH;;;;"}
@@ -1,5 +0,0 @@
1
- export declare const globalStyles: void;
2
- export declare const root: string;
3
- export declare const labelGroup: string;
4
- export declare const cluster: string;
5
- export declare const label: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.js","sources":["../../../src/components/xy-labels/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-xy-label-cursor: default;\n // Undefined by default to allow proper fallback to var(--vis-color-main)\n /* --vis-xy-label-fill-color */\n --vis-xy-label-stroke-color: none;\n --vis-xy-label-stroke-width: 0px;\n --vis-xy-label-fill-opacity: 1;\n --vis-xy-label-stroke-opacity: 1;\n --vis-xy-label-hover-stroke-width: 1px;\n --vis-xy-label-font-size: 12px;\n --vis-xy-label-cluster-font-size: 14px;\n\n --vis-xy-label-text-color-dark: #5b5f6d;\n --vis-xy-label-text-color-light: #fff;\n --vis-xy-label-text-font-weight: 500;\n }\n`\n\nexport const root = css`\n label: xy-labels-component;\n`\n\nexport const labelGroup = css`\n label: label-g;\n\n > rect, text {\n cursor: var(--vis-xy-label-cursor);\n fill: var(--vis-xy-label-fill-color, var(--vis-color-main));\n fill-opacity: var(--vis-xy-label-fill-opacity);\n stroke-opacity: var(--vis-xy-label-stroke-opacity);\n }\n\n > text {\n font-weight: var(--vis-xy-label-text-font-weight);\n user-select: none;\n }\n\n > rect {\n stroke-width: var(--vis-xy-label-stroke-width);\n stroke: var(--vis-xy-label-stroke-color);\n\n &:hover {\n stroke-width: var(--vis-xy-label-hover-stroke-width);\n }\n }\n`\n\nexport const cluster = css`\n label: cluster;\n`\n\nexport const label = css`\n label: label;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;EAiBvC;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;EAuB5B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA,CAAA;;EAEzB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;"}
@@ -1,23 +0,0 @@
1
- export declare type XYLabelRenderProps = {
2
- x: number;
3
- y: number;
4
- fontSize: number;
5
- backgroundColor: string | null;
6
- labelText: string | null;
7
- labelColor: string | null;
8
- cursor: string | null;
9
- width: number;
10
- height: number;
11
- };
12
- export declare type XYLabel<D> = D & {
13
- _screen: XYLabelRenderProps;
14
- };
15
- export declare type XYLabelCluster<D> = {
16
- _screen: XYLabelRenderProps;
17
- records: XYLabel<D>[];
18
- };
19
- export declare enum XYLabelPositioning {
20
- AbsolutePx = "absolute_px",
21
- AbsolutePercentage = "absolute_percentage",
22
- DataSpace = "data_space"
23
- }
@@ -1,9 +0,0 @@
1
- var XYLabelPositioning;
2
- (function (XYLabelPositioning) {
3
- XYLabelPositioning["AbsolutePx"] = "absolute_px";
4
- XYLabelPositioning["AbsolutePercentage"] = "absolute_percentage";
5
- XYLabelPositioning["DataSpace"] = "data_space";
6
- })(XYLabelPositioning || (XYLabelPositioning = {}));
7
-
8
- export { XYLabelPositioning };
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/xy-labels/types.ts"],"sourcesContent":["export type XYLabelRenderProps = {\n x: number;\n y: number;\n fontSize: number;\n backgroundColor: string | null;\n labelText: string | null;\n labelColor: string | null;\n cursor: string | null;\n width: number;\n height: number;\n}\n\nexport type XYLabel<D> = D & {\n _screen: XYLabelRenderProps;\n}\n\nexport type XYLabelCluster<D> = {\n _screen: XYLabelRenderProps;\n records: XYLabel<D>[];\n}\n\nexport enum XYLabelPositioning {\n AbsolutePx = 'absolute_px',\n AbsolutePercentage = 'absolute_percentage',\n DataSpace = 'data_space',\n}\n"],"names":[],"mappings":"IAqBY,mBAIX;AAJD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,YAAA,CAAA,GAAA,aAA0B,CAAA;AAC1B,IAAA,kBAAA,CAAA,oBAAA,CAAA,GAAA,qBAA0C,CAAA;AAC1C,IAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,YAAwB,CAAA;AAC1B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,GAI7B,EAAA,CAAA,CAAA;;;;"}
package/components.d.ts DELETED
@@ -1,51 +0,0 @@
1
- export { ComponentCore } from "./core/component";
2
- export { ComponentConfigInterface } from "./core/component/config";
3
- export { XYComponentCore } from "./core/xy-component";
4
- export { XYComponentConfigInterface } from "./core/xy-component/config";
5
- export { Tooltip } from "./components/tooltip";
6
- export { Line } from './components/line';
7
- export { StackedBar } from './components/stacked-bar';
8
- export { GroupedBar } from './components/grouped-bar';
9
- export { Axis } from './components/axis';
10
- export { Scatter } from './components/scatter';
11
- export { Brush } from './components/brush';
12
- export { BulletLegend } from './components/bullet-legend';
13
- export { FlowLegend } from './components/flow-legend';
14
- export { Crosshair } from './components/crosshair';
15
- export { Timeline } from './components/timeline';
16
- export { Sankey } from './components/sankey';
17
- export { Area } from './components/area';
18
- export { TopoJSONMap } from './components/topojson-map';
19
- export { LeafletMap } from './components/leaflet-map';
20
- export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style';
21
- export { LeafletFlowMap } from './components/leaflet-flow-map';
22
- export { ChordDiagram } from './components/chord-diagram';
23
- export { Graph } from './components/graph';
24
- export { VisControls } from './components/vis-controls';
25
- export { Donut } from './components/donut';
26
- export { FreeBrush } from './components/free-brush';
27
- export { XYLabels } from './components/xy-labels';
28
- export { NestedDonut } from './components/nested-donut';
29
- export type { LineConfigInterface } from './components/line/config';
30
- export type { StackedBarConfigInterface } from './components/stacked-bar/config';
31
- export type { GroupedBarConfigInterface } from './components/grouped-bar/config';
32
- export type { ScatterConfigInterface } from './components/scatter/config';
33
- export type { TooltipConfigInterface } from './components/tooltip/config';
34
- export type { BrushConfigInterface } from './components/brush/config';
35
- export type { AxisConfigInterface } from './components/axis/config';
36
- export type { BulletLegendConfigInterface } from './components/bullet-legend/config';
37
- export type { FlowLegendConfigInterface } from './components/flow-legend/config';
38
- export type { CrosshairConfigInterface } from './components/crosshair/config';
39
- export type { TimelineConfigInterface } from './components/timeline/config';
40
- export type { SankeyConfigInterface } from './components/sankey/config';
41
- export type { AreaConfigInterface } from './components/area/config';
42
- export type { TopoJSONMapConfigInterface } from './components/topojson-map/config';
43
- export type { LeafletMapConfigInterface } from './components/leaflet-map/config';
44
- export type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config';
45
- export type { ChordDiagramConfigInterface } from './components/chord-diagram/config';
46
- export type { GraphConfigInterface } from './components/graph/config';
47
- export type { VisControlsConfigInterface } from './components/vis-controls/config';
48
- export type { DonutConfigInterface } from './components/donut/config';
49
- export type { FreeBrushConfigInterface } from './components/free-brush/config';
50
- export type { XYLabelsConfigInterface } from './components/xy-labels/config';
51
- export type { NestedDonutConfigInterface } from './components/nested-donut/config';
package/components.js DELETED
@@ -1,29 +0,0 @@
1
- export { ComponentCore } from './core/component/index.js';
2
- export { XYComponentCore } from './core/xy-component/index.js';
3
- export { Tooltip } from './components/tooltip/index.js';
4
- export { Line } from './components/line/index.js';
5
- export { StackedBar } from './components/stacked-bar/index.js';
6
- export { GroupedBar } from './components/grouped-bar/index.js';
7
- export { Axis } from './components/axis/index.js';
8
- export { Scatter } from './components/scatter/index.js';
9
- export { Brush } from './components/brush/index.js';
10
- export { BulletLegend } from './components/bullet-legend/index.js';
11
- export { FlowLegend } from './components/flow-legend/index.js';
12
- export { Crosshair } from './components/crosshair/index.js';
13
- export { Timeline } from './components/timeline/index.js';
14
- export { Sankey } from './components/sankey/index.js';
15
- export { Area } from './components/area/index.js';
16
- export { TopoJSONMap } from './components/topojson-map/index.js';
17
- export { LeafletMap } from './components/leaflet-map/index.js';
18
- export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style.js';
19
- export { LeafletFlowMap } from './components/leaflet-flow-map/index.js';
20
- export { ChordDiagram } from './components/chord-diagram/index.js';
21
- export { Graph } from './components/graph/index.js';
22
- export { VisControls } from './components/vis-controls/index.js';
23
- export { Donut } from './components/donut/index.js';
24
- export { FreeBrush } from './components/free-brush/index.js';
25
- export { XYLabels } from './components/xy-labels/index.js';
26
- export { NestedDonut } from './components/nested-donut/index.js';
27
-
28
- // Core
29
- //# sourceMappingURL=components.js.map
package/components.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sources":["../src/components.ts"],"sourcesContent":["// Core\nexport { ComponentCore } from 'core/component'\nexport type { ComponentConfigInterface } from 'core/component/config'\nexport { XYComponentCore } from 'core/xy-component'\nexport type { XYComponentConfigInterface } from 'core/xy-component/config'\n\n// Components\nexport { Tooltip } from 'components/tooltip'\nexport { Line } from './components/line'\nexport { StackedBar } from './components/stacked-bar'\nexport { GroupedBar } from './components/grouped-bar'\nexport { Axis } from './components/axis'\nexport { Scatter } from './components/scatter'\nexport { Brush } from './components/brush'\nexport { BulletLegend } from './components/bullet-legend'\nexport { FlowLegend } from './components/flow-legend'\nexport { Crosshair } from './components/crosshair'\nexport { Timeline } from './components/timeline'\nexport { Sankey } from './components/sankey'\nexport { Area } from './components/area'\nexport { TopoJSONMap } from './components/topojson-map'\nexport { LeafletMap } from './components/leaflet-map'\nexport { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style'\nexport { LeafletFlowMap } from './components/leaflet-flow-map'\nexport { ChordDiagram } from './components/chord-diagram'\nexport { Graph } from './components/graph'\nexport { VisControls } from './components/vis-controls'\nexport { Donut } from './components/donut'\nexport { FreeBrush } from './components/free-brush'\nexport { XYLabels } from './components/xy-labels'\nexport { NestedDonut } from './components/nested-donut'\n\n// Config Interfaces\nexport type { LineConfigInterface } from './components/line/config'\nexport type { StackedBarConfigInterface } from './components/stacked-bar/config'\nexport type { GroupedBarConfigInterface } from './components/grouped-bar/config'\nexport type { ScatterConfigInterface } from './components/scatter/config'\nexport type { TooltipConfigInterface } from './components/tooltip/config'\nexport type { BrushConfigInterface } from './components/brush/config'\nexport type { AxisConfigInterface } from './components/axis/config'\nexport type { BulletLegendConfigInterface } from './components/bullet-legend/config'\nexport type { FlowLegendConfigInterface } from './components/flow-legend/config'\nexport type { CrosshairConfigInterface } from './components/crosshair/config'\nexport type { TimelineConfigInterface } from './components/timeline/config'\nexport type { SankeyConfigInterface } from './components/sankey/config'\nexport type { AreaConfigInterface } from './components/area/config'\nexport type { TopoJSONMapConfigInterface } from './components/topojson-map/config'\nexport type { LeafletMapConfigInterface } from './components/leaflet-map/config'\nexport type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config'\nexport type { ChordDiagramConfigInterface } from './components/chord-diagram/config'\nexport type { GraphConfigInterface } from './components/graph/config'\nexport type { VisControlsConfigInterface } from './components/vis-controls/config'\nexport type { DonutConfigInterface } from './components/donut/config'\nexport type { FreeBrushConfigInterface } from './components/free-brush/config'\nexport type { XYLabelsConfigInterface } from './components/xy-labels/config'\nexport type { NestedDonutConfigInterface } from './components/nested-donut/config'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA"}
@@ -1,12 +0,0 @@
1
- import { ContainerConfig, ContainerConfigInterface } from "../../core/container/config";
2
- import { ComponentCore } from "../../core/component";
3
- import { Tooltip } from "../../components/tooltip";
4
- export interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {
5
- /** Visualization component. Default: `undefined` */
6
- component?: ComponentCore<Datum>;
7
- /** Tooltip component. Default: `undefined` */
8
- tooltip?: Tooltip;
9
- }
10
- export declare class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {
11
- tooltip: any;
12
- }
@@ -1,12 +0,0 @@
1
- import { ContainerConfig } from '../../core/container/config.js';
2
-
3
- // Core
4
- class SingleContainerConfig extends ContainerConfig {
5
- constructor() {
6
- super(...arguments);
7
- this.tooltip = undefined;
8
- }
9
- }
10
-
11
- export { SingleContainerConfig };
12
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/containers/single-container/config.ts"],"sourcesContent":["// Core\nimport { ContainerConfig, ContainerConfigInterface } from 'core/container/config'\nimport { ComponentCore } from 'core/component'\nimport { Tooltip } from 'components/tooltip'\n\nexport interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {\n /** Visualization component. Default: `undefined` */\n component?: ComponentCore<Datum>;\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n}\n\nexport class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {\n tooltip = undefined\n}\n"],"names":[],"mappings":";;AAAA;AAYM,MAAO,qBAA6B,SAAQ,eAAe,CAAA;AAAjE,IAAA,WAAA,GAAA;;QACE,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;KACpB;AAAA;;;;"}
@@ -1,19 +0,0 @@
1
- import "../../styles/index";
2
- import { ContainerCore } from "../../core/container";
3
- import { ComponentCore } from "../../core/component";
4
- import { ComponentConfigInterface } from "../../core/component/config";
5
- import { SingleContainerConfig, SingleContainerConfigInterface } from './config';
6
- export declare class SingleContainer<Data> extends ContainerCore {
7
- component: ComponentCore<Data>;
8
- config: SingleContainerConfig<Data>;
9
- constructor(element: HTMLElement, config?: SingleContainerConfigInterface<Data>, data?: Data);
10
- setData(data: Data, preventRender?: boolean): void;
11
- updateContainer(containerConfig: SingleContainerConfigInterface<Data>, preventRender?: boolean): void;
12
- updateComponent(componentConfig: ComponentConfigInterface, preventRender?: boolean): void;
13
- update(containerConfig: SingleContainerConfigInterface<Data>, componentConfig?: ComponentConfigInterface, data?: Data): void;
14
- getFitWidthScale(): number;
15
- _render(duration?: number): void;
16
- render(duration?: any): void;
17
- _onResize(): void;
18
- destroy(): void;
19
- }
@@ -1,128 +0,0 @@
1
- import '../../styles/index.js';
2
- import { ContainerCore } from '../../core/container/index.js';
3
- import { smartTransition } from '../../utils/d3.js';
4
- import { Sizing } from '../../types/component.js';
5
- import { SingleContainerConfig } from './config.js';
6
-
7
- // Global CSS variables (side effects import)
8
- class SingleContainer extends ContainerCore {
9
- constructor(element, config, data) {
10
- var _a;
11
- super(element);
12
- this.config = new SingleContainerConfig();
13
- if (config) {
14
- this.updateContainer(config, true);
15
- this.component = config.component;
16
- }
17
- if (data) {
18
- this.setData(data, true);
19
- }
20
- // Render if component exists and has data
21
- if ((_a = this.component) === null || _a === void 0 ? void 0 : _a.datamodel.data)
22
- this.render();
23
- }
24
- setData(data, preventRender) {
25
- var _a;
26
- const { config } = this;
27
- if (this.component)
28
- this.component.setData(data);
29
- if (!preventRender)
30
- this.render();
31
- (_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
32
- }
33
- updateContainer(containerConfig, preventRender) {
34
- super.updateContainer(containerConfig);
35
- this.removeAllChildren();
36
- this.component = containerConfig.component;
37
- if (containerConfig.sizing)
38
- this.component.sizing = containerConfig.sizing;
39
- this.element.appendChild(this.component.element);
40
- const tooltip = containerConfig.tooltip;
41
- if (tooltip) {
42
- if (!tooltip.hasContainer())
43
- tooltip.setContainer(this._container);
44
- tooltip.setComponents([this.component]);
45
- }
46
- if (!preventRender)
47
- this.render();
48
- }
49
- updateComponent(componentConfig, preventRender) {
50
- this.component.setConfig(componentConfig);
51
- if (!preventRender)
52
- this.render();
53
- }
54
- update(containerConfig, componentConfig, data) {
55
- if (containerConfig)
56
- this.updateContainer(containerConfig, true);
57
- if (componentConfig)
58
- this.updateComponent(componentConfig, true);
59
- if (data)
60
- this.setData(data, true);
61
- this.render();
62
- }
63
- getFitWidthScale() {
64
- const { config, component } = this;
65
- const extendedSizeComponent = component;
66
- if (!extendedSizeComponent.getWidth)
67
- return 1;
68
- const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right;
69
- return this.width / componentWidth;
70
- }
71
- _render(duration) {
72
- const { config, component } = this;
73
- super._render(duration);
74
- component.setSize(this.width, this.height, this.containerWidth, this.containerHeight);
75
- component.g.attr('transform', `translate(${config.margin.left},${config.margin.top})`);
76
- component.render(duration);
77
- if (config.tooltip)
78
- config.tooltip.update();
79
- }
80
- // Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)
81
- // Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.
82
- render(duration = this.config.duration) {
83
- const { config, component } = this;
84
- if (config.sizing === Sizing.Extend || config.sizing === Sizing.FitWidth) {
85
- const fitToWidth = config.sizing === Sizing.FitWidth;
86
- const extendedSizeComponent = component;
87
- const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right;
88
- const componentHeight = extendedSizeComponent.getHeight() + config.margin.top + config.margin.bottom;
89
- const scale = fitToWidth ? this.getFitWidthScale() : 1;
90
- const currentWidth = this.svg.attr('width');
91
- const currentHeight = this.svg.attr('height');
92
- const scaledWidth = componentWidth * scale;
93
- const scaledHeight = componentHeight * scale;
94
- const animated = currentWidth || currentHeight;
95
- smartTransition(this.svg, animated ? duration : 0)
96
- .attr('width', scaledWidth)
97
- .attr('height', scaledHeight)
98
- .attr('viewBox', `${0} ${0} ${componentWidth} ${fitToWidth ? scaledHeight : componentHeight}`)
99
- .attr('preserveAspectRatio', 'xMinYMin');
100
- }
101
- else {
102
- this.svg
103
- .attr('width', this.config.width || this.containerWidth)
104
- .attr('height', this.config.height || this.containerHeight);
105
- }
106
- // Schedule the actual rendering in the next frame
107
- cancelAnimationFrame(this._requestedAnimationFrame);
108
- this._requestedAnimationFrame = requestAnimationFrame(() => {
109
- this._render(duration);
110
- });
111
- }
112
- _onResize() {
113
- var _a;
114
- const { config } = this;
115
- super._onResize();
116
- (_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
117
- }
118
- destroy() {
119
- var _a;
120
- const { component, config } = this;
121
- super.destroy();
122
- component === null || component === void 0 ? void 0 : component.destroy();
123
- (_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.destroy();
124
- }
125
- }
126
-
127
- export { SingleContainer };
128
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.ts"],"sourcesContent":["// Global CSS variables (side effects import)\nimport 'styles/index'\n\n// Core\nimport { ContainerCore } from 'core/container'\nimport { ComponentCore } from 'core/component'\nimport { ComponentConfigInterface } from 'core/component/config'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\n\n// Types\nimport { Sizing, ExtendedSizeComponent } from 'types/component'\n\n// Config\nimport { SingleContainerConfig, SingleContainerConfigInterface } from './config'\n\nexport class SingleContainer<Data> extends ContainerCore {\n component: ComponentCore<Data>\n config: SingleContainerConfig<Data> = new SingleContainerConfig()\n\n constructor (element: HTMLElement, config?: SingleContainerConfigInterface<Data>, data?: Data) {\n super(element)\n\n if (config) {\n this.updateContainer(config, true)\n this.component = config.component\n }\n\n if (data) {\n this.setData(data, true)\n }\n\n // Render if component exists and has data\n if (this.component?.datamodel.data) this.render()\n }\n\n public setData (data: Data, preventRender?: boolean): void {\n const { config } = this\n\n if (this.component) this.component.setData(data)\n if (!preventRender) this.render()\n config.tooltip?.hide()\n }\n\n public updateContainer (containerConfig: SingleContainerConfigInterface<Data>, preventRender?: boolean): void {\n super.updateContainer(containerConfig)\n this.removeAllChildren()\n\n this.component = containerConfig.component\n if (containerConfig.sizing) this.component.sizing = containerConfig.sizing\n this.element.appendChild(this.component.element)\n\n const tooltip = containerConfig.tooltip\n if (tooltip) {\n if (!tooltip.hasContainer()) tooltip.setContainer(this._container)\n tooltip.setComponents([this.component])\n }\n\n if (!preventRender) this.render()\n }\n\n public updateComponent (componentConfig: ComponentConfigInterface, preventRender?: boolean): void {\n this.component.setConfig(componentConfig)\n if (!preventRender) this.render()\n }\n\n public update (\n containerConfig: SingleContainerConfigInterface<Data>,\n componentConfig?: ComponentConfigInterface,\n data?: Data\n ): void {\n if (containerConfig) this.updateContainer(containerConfig, true)\n if (componentConfig) this.updateComponent(componentConfig, true)\n if (data) this.setData(data, true)\n this.render()\n }\n\n public getFitWidthScale (): number {\n const { config, component } = this\n\n const extendedSizeComponent = component as ExtendedSizeComponent\n if (!extendedSizeComponent.getWidth) return 1\n\n const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right\n return this.width / componentWidth\n }\n\n _render (duration?: number): void {\n const { config, component } = this\n super._render(duration)\n\n component.setSize(this.width, this.height, this.containerWidth, this.containerHeight)\n component.g.attr('transform', `translate(${config.margin.left},${config.margin.top})`)\n component.render(duration)\n\n if (config.tooltip) config.tooltip.update()\n }\n\n // Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)\n // Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.\n render (duration = this.config.duration): void {\n const { config, component } = this\n\n if (config.sizing === Sizing.Extend || config.sizing === Sizing.FitWidth) {\n const fitToWidth = config.sizing === Sizing.FitWidth\n const extendedSizeComponent = component as ExtendedSizeComponent\n\n const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right\n const componentHeight = extendedSizeComponent.getHeight() + config.margin.top + config.margin.bottom\n const scale = fitToWidth ? this.getFitWidthScale() : 1\n\n const currentWidth = this.svg.attr('width')\n const currentHeight = this.svg.attr('height')\n const scaledWidth = componentWidth * scale\n const scaledHeight = componentHeight * scale\n const animated = currentWidth || currentHeight\n\n smartTransition(this.svg, animated ? duration : 0)\n .attr('width', scaledWidth)\n .attr('height', scaledHeight)\n .attr('viewBox', `${0} ${0} ${componentWidth} ${fitToWidth ? scaledHeight : componentHeight}`)\n .attr('preserveAspectRatio', 'xMinYMin')\n } else {\n this.svg\n .attr('width', this.config.width || this.containerWidth)\n .attr('height', this.config.height || this.containerHeight)\n }\n\n // Schedule the actual rendering in the next frame\n cancelAnimationFrame(this._requestedAnimationFrame)\n this._requestedAnimationFrame = requestAnimationFrame(() => {\n this._render(duration)\n })\n }\n\n _onResize (): void {\n const { config } = this\n super._onResize()\n config.tooltip?.hide()\n }\n\n public destroy (): void {\n const { component, config } = this\n super.destroy()\n\n component?.destroy()\n config.tooltip?.destroy()\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;AAiBM,MAAO,eAAsB,SAAQ,aAAa,CAAA;AAItD,IAAA,WAAA,CAAa,OAAoB,EAAE,MAA6C,EAAE,IAAW,EAAA;;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAA;AAHhB,QAAA,IAAA,CAAA,MAAM,GAAgC,IAAI,qBAAqB,EAAE,CAAA;AAK/D,QAAA,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,YAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;AAClC,SAAA;AAED,QAAA,IAAI,IAAI,EAAE;AACR,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACzB,SAAA;;AAGD,QAAA,IAAI,MAAA,IAAI,CAAC,SAAS,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAS,CAAC,IAAI;YAAE,IAAI,CAAC,MAAM,EAAE,CAAA;KAClD;IAEM,OAAO,CAAE,IAAU,EAAE,a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,CAAA;QAClC,KAAK,CAAC,OAAO,EAAE,CAAA;AAEf,QAAA,SAAS,aAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,EAAE,CAAA;AACpB,QAAA,CAAA,EAAA,GAAA,MAAM,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;KAC1B;AACF;;;;"}
@@ -1,99 +0,0 @@
1
- import { XYComponentCore } from "../../core/xy-component";
2
- import { ContainerConfig, ContainerConfigInterface } from "../../core/container/config";
3
- import { Tooltip } from "../../components/tooltip";
4
- import { Axis } from "../../components/axis";
5
- import { Crosshair } from "../../components/crosshair";
6
- import { ContinuousScale } from "../../types/scale";
7
- import { Direction } from "../../types/direction";
8
- export interface XYContainerConfigInterface<Datum> extends ContainerConfigInterface {
9
- /** An array of visualization components. Default: `[]` */
10
- components?: XYComponentCore<Datum>[];
11
- /** Scale for X dimension, e.g. Scale.scaleLinear().
12
- * If set, this value will override the components' xScale and they will have a single shared xScale instance.
13
- * By default the components have their own scale instances but their `domain` and `range` values are synchronized.
14
- * Default: `undefined` */
15
- xScale?: ContinuousScale;
16
- /** Scale domain (data extent) for X dimension. By default this value is calculated automatically based on data. */
17
- xDomain?: [number | undefined, number | undefined];
18
- /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.
19
- * For example, imagine that you have a chart with dynamic data that has negative values. When values are small
20
- * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can
21
- * be achieved by setting `xDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
22
- * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
23
- * Default: `undefined` */
24
- xDomainMinConstraint?: [number | undefined, number | undefined];
25
- /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.
26
- * For example, imagine that you have a chart with dynamic data. When values are small
27
- * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
28
- * be achieved by setting `xDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
29
- * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
30
- * Default: `undefined` */
31
- xDomainMaxConstraint?: [number | undefined, number | undefined];
32
- /** Force set the X scale range (in the screen space). By default the range is calculated automatically based on the
33
- * chart's set up */
34
- xRange?: [number, number];
35
- /** Scale for Y dimension, e.g. Scale.scaleLinear().
36
- * If set, this value will override the components' yScale and they will have a single shared yScale instance.
37
- * By default the components have their own scale instances but their `domain` and `range` values are synchronized.
38
- * Default: `undefined` */
39
- yScale?: ContinuousScale;
40
- /** Scale domain (data extent) for Y dimension. By default this value is calculated automatically based on data. */
41
- yDomain?: [number | undefined, number | undefined];
42
- /** Constraint the minimum value of the Y scale domain.
43
- * For example, imagine that you have a chart with dynamic data that has negative values. When values are small
44
- * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can
45
- * be achieved by setting `yDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
46
- * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
47
- * Default: `undefined` */
48
- yDomainMinConstraint?: [number | undefined, number | undefined];
49
- /** Constraint the minimum value of the Y scale domain.
50
- * For example, imagine that you have a chart with dynamic data. When values are small
51
- * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
52
- * be achieved by setting `yDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
53
- * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
54
- * Default: `undefined` */
55
- yDomainMaxConstraint?: [number | undefined, number | undefined];
56
- /** Force set the Y scale range (in the screen space). By default the range is calculated automatically based on the
57
- * chart's set up */
58
- yRange?: [number, number];
59
- /** Y Axis direction. Default: `Direction.North` */
60
- yDirection?: Direction.South | Direction.North | string;
61
- /** X Axis component instance. Default: `undefined` */
62
- xAxis?: Axis<Datum>;
63
- /** Y Axis component instance. Default: `undefined` */
64
- yAxis?: Axis<Datum>;
65
- /** Enables automatic calculation of chart margins based on the size of the axes. Default: `true` */
66
- autoMargin?: boolean;
67
- /** Tooltip component. Default: `undefined` */
68
- tooltip?: Tooltip | undefined;
69
- /** Crosshair component. Default: `undefined` */
70
- crosshair?: Crosshair<Datum> | undefined;
71
- /** Prevents the chart domain from being empty (when domain's min and max values are equal).
72
- * That usually happens when all the data values are the same.
73
- * Setting to `true` will automatically extend the domain by `+1` when needed.
74
- * Default: `true` */
75
- preventEmptyDomain?: boolean;
76
- /** Sets the Y scale domain based on the current X scale domain (not the whole dataset). Default: `false` */
77
- scaleByDomain?: boolean;
78
- }
79
- export declare class XYContainerConfig<Datum> extends ContainerConfig implements XYContainerConfigInterface<Datum> {
80
- components: any[];
81
- tooltip: Tooltip;
82
- crosshair: Crosshair<Datum>;
83
- xAxis: Axis<Datum>;
84
- yAxis: Axis<Datum>;
85
- autoMargin: boolean;
86
- xScale: any;
87
- xDomain: any;
88
- xDomainMinConstraint: any;
89
- xDomainMaxConstraint: any;
90
- xRange: any;
91
- yScale: any;
92
- yDomain: any;
93
- yDomainMinConstraint: any;
94
- yDomainMaxConstraint: any;
95
- yRange: any;
96
- yDirection: Direction;
97
- preventEmptyDomain: boolean;
98
- scaleByDomain: boolean;
99
- }
@@ -1,30 +0,0 @@
1
- import { ContainerConfig } from '../../core/container/config.js';
2
- import { Direction } from '../../types/direction.js';
3
-
4
- class XYContainerConfig extends ContainerConfig {
5
- constructor() {
6
- super(...arguments);
7
- this.components = [];
8
- this.tooltip = undefined;
9
- this.crosshair = undefined;
10
- this.xAxis = undefined;
11
- this.yAxis = undefined;
12
- this.autoMargin = true;
13
- this.xScale = undefined;
14
- this.xDomain = undefined;
15
- this.xDomainMinConstraint = undefined;
16
- this.xDomainMaxConstraint = undefined;
17
- this.xRange = undefined;
18
- this.yScale = undefined;
19
- this.yDomain = undefined;
20
- this.yDomainMinConstraint = undefined;
21
- this.yDomainMaxConstraint = undefined;
22
- this.yRange = undefined;
23
- this.yDirection = Direction.North;
24
- this.preventEmptyDomain = true;
25
- this.scaleByDomain = false;
26
- }
27
- }
28
-
29
- export { XYContainerConfig };
30
- //# sourceMappingURL=config.js.map