@orbcharts/plugins-basic 3.0.0-beta.15 → 3.0.0-beta.17

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 (228) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-plugins-basic.es.js +11839 -10485
  3. package/dist/orbcharts-plugins-basic.umd.js +231 -171
  4. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBars.d.ts +3 -3
  5. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBarsTriangle.d.ts +3 -3
  6. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseDots.d.ts +3 -3
  7. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLineAreas.d.ts +3 -3
  8. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLines.d.ts +3 -3
  9. package/dist/src/base/BaseRacingBars.d.ts +23 -0
  10. package/dist/src/base/BaseRacingLabels.d.ts +20 -0
  11. package/dist/src/base/BaseRacingValueLabels.d.ts +20 -0
  12. package/dist/{orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts → src/base/BaseStackedBars.d.ts} +7 -7
  13. package/dist/{orbcharts-plugins-basic/src → src}/base/BaseValueAxis.d.ts +4 -7
  14. package/dist/src/base/BaseXAxis.d.ts +20 -0
  15. package/dist/src/base/BaseYAxis.d.ts +18 -0
  16. package/dist/{orbcharts-plugins-basic/src → src}/grid/defaults.d.ts +3 -3
  17. package/dist/{orbcharts-plugins-basic/src → src}/grid/gridObservables.d.ts +8 -1
  18. package/dist/{orbcharts-plugins-basic/src → src}/grid/index.d.ts +2 -2
  19. package/dist/src/grid/plugins/GroupZoom.d.ts +1 -0
  20. package/dist/src/grid/plugins/StackedBars.d.ts +1 -0
  21. package/dist/src/index.d.ts +7 -1
  22. package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/defaults.d.ts +2 -2
  23. package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/index.d.ts +1 -1
  24. package/dist/src/multiGrid/plugins/MultiStackedBars.d.ts +1 -0
  25. package/dist/src/multiValue/defaults.d.ts +13 -0
  26. package/dist/{orbcharts-plugins-basic/src → src}/multiValue/index.d.ts +5 -1
  27. package/dist/src/multiValue/multiValueObservables.d.ts +56 -0
  28. package/dist/src/multiValue/plugins/RacingBars.d.ts +1 -0
  29. package/dist/src/multiValue/plugins/RacingCounterTexts.d.ts +3 -0
  30. package/dist/src/multiValue/plugins/RacingValueAxis.d.ts +1 -0
  31. package/dist/src/multiValue/plugins/XAxis.d.ts +1 -0
  32. package/dist/src/multiValue/plugins/XYAxes.d.ts +1 -0
  33. package/dist/src/multiValue/plugins/XZoom.d.ts +1 -0
  34. package/dist/{orbcharts-plugins-basic/src → src}/utils/commonUtils.d.ts +1 -0
  35. package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Graphics.d.ts +2 -1
  36. package/lib/core-types.ts +7 -7
  37. package/lib/core.ts +6 -6
  38. package/lib/plugins-basic-types.ts +6 -6
  39. package/package.json +44 -44
  40. package/src/base/BaseBars.ts +765 -765
  41. package/src/base/BaseBarsTriangle.ts +676 -676
  42. package/src/base/BaseDots.ts +464 -464
  43. package/src/base/BaseGroupAxis.ts +691 -679
  44. package/src/base/BaseLegend.ts +684 -684
  45. package/src/base/BaseLineAreas.ts +629 -629
  46. package/src/base/BaseLines.ts +706 -706
  47. package/src/base/BaseRacingBars.ts +552 -0
  48. package/src/base/BaseRacingLabels.ts +396 -0
  49. package/src/base/BaseRacingValueLabels.ts +403 -0
  50. package/src/base/{BaseStackedBar.ts → BaseStackedBars.ts} +782 -782
  51. package/src/base/BaseTooltip.ts +386 -385
  52. package/src/base/BaseValueAxis.ts +600 -583
  53. package/src/base/BaseXAxis.ts +427 -0
  54. package/src/base/BaseYAxis.ts +389 -0
  55. package/src/base/types.ts +2 -2
  56. package/src/const.ts +30 -30
  57. package/src/grid/defaults.ts +213 -250
  58. package/src/grid/gridObservables.ts +612 -554
  59. package/src/grid/index.ts +16 -16
  60. package/src/grid/plugins/Bars.ts +69 -69
  61. package/src/grid/plugins/BarsPN.ts +66 -66
  62. package/src/grid/plugins/BarsTriangle.ts +73 -73
  63. package/src/grid/plugins/Dots.ts +68 -68
  64. package/src/grid/plugins/GridLegend.ts +107 -107
  65. package/src/grid/plugins/GridTooltip.ts +66 -66
  66. package/src/grid/plugins/GroupAux.ts +1120 -1103
  67. package/src/grid/plugins/GroupAxis.ts +73 -97
  68. package/src/grid/plugins/{GridZoom.ts → GroupZoom.ts} +218 -218
  69. package/src/grid/plugins/LineAreas.ts +65 -65
  70. package/src/grid/plugins/Lines.ts +59 -59
  71. package/src/grid/plugins/{StackedBar.ts → StackedBars.ts} +64 -64
  72. package/src/grid/plugins/StackedValueAxis.ts +96 -96
  73. package/src/grid/plugins/ValueAxis.ts +94 -94
  74. package/src/index.ts +6 -6
  75. package/src/multiGrid/defaults.ts +244 -228
  76. package/src/multiGrid/index.ts +14 -14
  77. package/src/multiGrid/multiGridObservables.ts +50 -49
  78. package/src/multiGrid/plugins/MultiBars.ts +108 -108
  79. package/src/multiGrid/plugins/MultiBarsTriangle.ts +114 -114
  80. package/src/multiGrid/plugins/MultiDots.ts +102 -102
  81. package/src/multiGrid/plugins/MultiGridLegend.ts +169 -159
  82. package/src/multiGrid/plugins/MultiGridTooltip.ts +66 -66
  83. package/src/multiGrid/plugins/MultiGroupAxis.ts +137 -137
  84. package/src/multiGrid/plugins/MultiLineAreas.ts +107 -107
  85. package/src/multiGrid/plugins/MultiLines.ts +101 -101
  86. package/src/multiGrid/plugins/{MultiStackedBar.ts → MultiStackedBars.ts} +106 -106
  87. package/src/multiGrid/plugins/MultiStackedValueAxis.ts +134 -134
  88. package/src/multiGrid/plugins/MultiValueAxis.ts +134 -134
  89. package/src/multiGrid/plugins/OverlappingStackedValueAxes.ts +300 -299
  90. package/src/multiGrid/plugins/OverlappingValueAxes.ts +300 -300
  91. package/src/multiValue/defaults.ts +388 -166
  92. package/src/multiValue/index.ts +13 -9
  93. package/src/multiValue/multiValueObservables.ts +667 -297
  94. package/src/multiValue/plugins/MultiValueLegend.ts +107 -107
  95. package/src/multiValue/plugins/MultiValueTooltip.ts +66 -66
  96. package/src/multiValue/plugins/OrdinalBubbles.ts +0 -0
  97. package/src/multiValue/plugins/OrdinalXAxis.ts +0 -0
  98. package/src/multiValue/plugins/RacingBars.ts +373 -0
  99. package/src/multiValue/plugins/RacingCounterAxis.ts +0 -0
  100. package/src/multiValue/plugins/RacingCounterTexts.ts +300 -0
  101. package/src/multiValue/plugins/RacingValueAxis.ts +115 -0
  102. package/src/multiValue/plugins/RankingAxis_legacy.ts +109 -0
  103. package/src/multiValue/plugins/Scatter.ts +426 -426
  104. package/src/multiValue/plugins/ScatterBubbles.ts +554 -554
  105. package/src/multiValue/plugins/XAxis.ts +108 -0
  106. package/src/multiValue/plugins/XYAux.ts +682 -681
  107. package/src/multiValue/plugins/XYAxes.ts +194 -684
  108. package/src/multiValue/plugins/XYAxes_legacy.ts +684 -0
  109. package/src/multiValue/plugins/{XYZoom.ts → XZoom.ts} +299 -299
  110. package/src/noneData/defaults.ts +102 -102
  111. package/src/noneData/index.ts +3 -3
  112. package/src/noneData/plugins/Container.ts +27 -27
  113. package/src/noneData/plugins/Tooltip.ts +373 -373
  114. package/src/relationship/defaults.ts +220 -218
  115. package/src/relationship/index.ts +5 -5
  116. package/src/relationship/plugins/ForceDirected.ts +1168 -1168
  117. package/src/relationship/plugins/ForceDirectedBubbles.ts +1403 -1403
  118. package/src/relationship/plugins/RelationshipLegend.ts +100 -100
  119. package/src/relationship/plugins/RelationshipTooltip.ts +66 -66
  120. package/src/relationship/relationshipObservables.ts +49 -49
  121. package/src/series/defaults.ts +221 -230
  122. package/src/series/index.ts +9 -9
  123. package/src/series/plugins/Bubbles.ts +636 -620
  124. package/src/series/plugins/Pie.ts +623 -623
  125. package/src/series/plugins/PieEventTexts.ts +284 -284
  126. package/src/series/plugins/PieLabels.ts +640 -640
  127. package/src/series/plugins/Rose.ts +516 -516
  128. package/src/series/plugins/RoseLabels.ts +600 -600
  129. package/src/series/plugins/SeriesLegend.ts +107 -107
  130. package/src/series/plugins/SeriesTooltip.ts +66 -66
  131. package/src/series/seriesObservables.ts +145 -145
  132. package/src/series/seriesUtils.ts +51 -51
  133. package/src/tree/defaults.ts +102 -100
  134. package/src/tree/index.ts +4 -4
  135. package/src/tree/plugins/TreeLegend.ts +100 -100
  136. package/src/tree/plugins/TreeMap.ts +341 -341
  137. package/src/tree/plugins/TreeTooltip.ts +66 -66
  138. package/src/utils/commonUtils.ts +31 -22
  139. package/src/utils/d3Graphics.ts +176 -174
  140. package/src/utils/d3Utils.ts +92 -92
  141. package/src/utils/observables.ts +14 -14
  142. package/src/utils/orbchartsUtils.ts +129 -129
  143. package/tsconfig.base.json +13 -13
  144. package/tsconfig.json +2 -2
  145. package/vite.config.js +22 -22
  146. package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +0 -1
  147. package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +0 -1
  148. package/dist/orbcharts-plugins-basic/src/index.d.ts +0 -7
  149. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +0 -1
  150. package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +0 -9
  151. package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +0 -33
  152. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +0 -1
  153. /package/dist/{orbcharts-plugins-basic/lib → lib}/core-types.d.ts +0 -0
  154. /package/dist/{orbcharts-plugins-basic/lib → lib}/core.d.ts +0 -0
  155. /package/dist/{orbcharts-plugins-basic/lib → lib}/plugins-basic-types.d.ts +0 -0
  156. /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseGroupAxis.d.ts +0 -0
  157. /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLegend.d.ts +0 -0
  158. /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseTooltip.d.ts +0 -0
  159. /package/dist/{orbcharts-plugins-basic/src → src}/base/types.d.ts +0 -0
  160. /package/dist/{orbcharts-plugins-basic/src → src}/const.d.ts +0 -0
  161. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Bars.d.ts +0 -0
  162. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsPN.d.ts +0 -0
  163. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsTriangle.d.ts +0 -0
  164. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Dots.d.ts +0 -0
  165. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridLegend.d.ts +0 -0
  166. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridTooltip.d.ts +0 -0
  167. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAux.d.ts +0 -0
  168. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAxis.d.ts +0 -0
  169. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/LineAreas.d.ts +0 -0
  170. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Lines.d.ts +0 -0
  171. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/StackedValueAxis.d.ts +0 -0
  172. /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/ValueAxis.d.ts +0 -0
  173. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/multiGridObservables.d.ts +0 -0
  174. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBars.d.ts +0 -0
  175. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
  176. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiDots.d.ts +0 -0
  177. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
  178. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
  179. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
  180. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
  181. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLines.d.ts +0 -0
  182. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiStackedValueAxis.d.ts +0 -0
  183. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
  184. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +0 -0
  185. /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
  186. /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueLegend.d.ts +0 -0
  187. /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueTooltip.d.ts +0 -0
  188. /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/Ranking.d.ts → src/multiValue/plugins/OrdinalBubbles.d.ts} +0 -0
  189. /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/RankingAxis.d.ts → src/multiValue/plugins/OrdinalXAxis.d.ts} +0 -0
  190. /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts → src/multiValue/plugins/RacingCounterAxis.d.ts} +0 -0
  191. /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts → src/multiValue/plugins/RankingAxis_legacy.d.ts} +0 -0
  192. /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/Scatter.d.ts +0 -0
  193. /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/ScatterBubbles.d.ts +0 -0
  194. /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/XYAux.d.ts +0 -0
  195. /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts → src/multiValue/plugins/XYAxes_legacy.d.ts} +0 -0
  196. /package/dist/{orbcharts-plugins-basic/src → src}/noneData/defaults.d.ts +0 -0
  197. /package/dist/{orbcharts-plugins-basic/src → src}/noneData/index.d.ts +0 -0
  198. /package/dist/{orbcharts-plugins-basic/src/series/plugins/Waffle.d.ts → src/noneData/plugins/Container.d.ts} +0 -0
  199. /package/{src/multiValue/plugins/Ranking.ts → dist/src/noneData/plugins/Tooltip.d.ts} +0 -0
  200. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/defaults.d.ts +0 -0
  201. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/index.d.ts +0 -0
  202. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirected.d.ts +0 -0
  203. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirectedBubbles.d.ts +0 -0
  204. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipLegend.d.ts +0 -0
  205. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipTooltip.d.ts +0 -0
  206. /package/dist/{orbcharts-plugins-basic/src → src}/relationship/relationshipObservables.d.ts +0 -0
  207. /package/dist/{orbcharts-plugins-basic/src → src}/series/defaults.d.ts +0 -0
  208. /package/dist/{orbcharts-plugins-basic/src → src}/series/index.d.ts +0 -0
  209. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Bubbles.d.ts +0 -0
  210. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Pie.d.ts +0 -0
  211. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieEventTexts.d.ts +0 -0
  212. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieLabels.d.ts +0 -0
  213. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Rose.d.ts +0 -0
  214. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/RoseLabels.d.ts +0 -0
  215. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesLegend.d.ts +0 -0
  216. /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesTooltip.d.ts +0 -0
  217. /package/{src/multiValue/plugins/RankingAxis.ts → dist/src/series/plugins/Waffle.d.ts} +0 -0
  218. /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesObservables.d.ts +0 -0
  219. /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesUtils.d.ts +0 -0
  220. /package/dist/{orbcharts-plugins-basic/src → src}/tree/defaults.d.ts +0 -0
  221. /package/dist/{orbcharts-plugins-basic/src → src}/tree/index.d.ts +0 -0
  222. /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeLegend.d.ts +0 -0
  223. /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeMap.d.ts +0 -0
  224. /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeTooltip.d.ts +0 -0
  225. /package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Utils.d.ts +0 -0
  226. /package/dist/{orbcharts-plugins-basic/src → src}/utils/observables.d.ts +0 -0
  227. /package/dist/{orbcharts-plugins-basic/src → src}/utils/orbchartsUtils.d.ts +0 -0
  228. /package/dist/{orbcharts-plugins-basic/vite.config.d.ts → vite.config.d.ts} +0 -0
@@ -1,167 +1,389 @@
1
- import type {
2
- MultiValueLegendParams,
3
- MultiValueTooltipParams,
4
- ScatterParams,
5
- ScatterBubblesParams,
6
- XYAuxParams,
7
- XYAxesParams,
8
- XYZoomParams
9
- } from '../../lib/plugins-basic-types'
10
-
11
-
12
- export const DEFAULT_MULTI_VALUE_LEGEND_PARAMS: MultiValueLegendParams = {
13
- // position: 'right',
14
- // justify: 'end',
15
- placement: 'bottom',
16
- padding: 28,
17
- // offset: [0, 0],
18
- backgroundFill: 'none',
19
- backgroundStroke: 'none',
20
- gap: 10,
21
- listRectWidth: 14,
22
- listRectHeight: 14,
23
- listRectRadius: 0,
24
- // highlightEvent: false
25
- textColorType: 'primary'
26
- }
27
-
28
- export const DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS: MultiValueTooltipParams = {
29
- backgroundColorType: 'background',
30
- strokeColorType: 'primary',
31
- backgroundOpacity: 0.8,
32
- textColorType: 'primary',
33
- offset: [20, 5],
34
- padding: 10,
35
- renderFn: (eventData, { styles, utils }) => {
36
- const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
37
- const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
38
- const bulletWidth = styles.textSizePx * 0.7
39
- const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
40
- const categorySvg = hasCategoryLabel
41
- ? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>
42
- <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
43
- <tspan>${eventData.categoryLabel}</tspan>
44
- </text>`
45
- : ''
46
- const datumLabelSvg = hasDatumLabel
47
- ? `<tspan>${eventData.datum.label}</tspan> `
48
- : ''
49
- const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
50
- ${datumLabelSvg}<tspan font-weight="bold">${eventData.datum.value}</tspan>
51
- </text>`
52
-
53
- return `${categorySvg}
54
- <g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : ''}>
55
- ${datumSvg}
56
- </g>`
57
- },
58
- }
59
- DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles, utils }) => {
60
- const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
61
- const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
62
- const bulletWidth = styles.textSizePx * 0.7
63
- const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
64
- const categorySvg = hasCategoryLabel
65
- ? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.datum.color}"></rect>
66
- <text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
67
- <tspan>\${eventData.categoryLabel}</tspan>
68
- </text>\`
69
- : ''
70
- const datumLabelSvg = hasDatumLabel
71
- ? \`<tspan>\${eventData.datum.label}</tspan> \`
72
- : ''
73
- const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
74
- \${datumLabelSvg}<tspan font-weight="bold">\${eventData.datum.value}</tspan>
75
- </text>\`
76
-
77
- return \`\${categorySvg}
78
- <g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
79
- \${datumSvg}
80
- </g>\`
81
- }`
82
-
83
- export const DEFAULT_SCATTER_PARAMS: ScatterParams = {
84
- radius: 5,
85
- fillColorType: 'label',
86
- strokeColorType: 'label',
87
- strokeWidth: 0,
88
- }
89
-
90
- export const DEFAULT_SCATTER_BUBBLES_PARAMS: ScatterBubblesParams = {
91
- // radius: 5,
92
- fillColorType: 'label',
93
- strokeColorType: 'label',
94
- strokeWidth: 0,
95
- valueLinearOpacity: [0.8, 0.8],
96
- arcScaleType: 'area',
97
- sizeAdjust: 0.5
98
- }
99
-
100
- export const DEFAULT_X_Y_AUX_PARAMS: XYAuxParams = {
101
- xAxis: {
102
- showLine: true,
103
- showLabel: true,
104
- lineDashArray: '3, 3',
105
- lineColorType: 'primary',
106
- labelColorType: 'primary',
107
- labelTextColorType: 'background',
108
- // labelTextFormat: text => text,
109
- labelTextFormat: (value: number) => String(Math.round(value)),
110
- labelPadding: 20,
111
- // labelRotate: 0
112
- },
113
- yAxis: {
114
- showLine: true,
115
- showLabel: true,
116
- lineDashArray: '3, 3',
117
- lineColorType: 'primary',
118
- labelColorType: 'primary',
119
- labelTextColorType: 'background',
120
- // labelTextFormat: text => text,
121
- labelTextFormat: (value: number) => String(Math.round(value)),
122
- labelPadding: 20,
123
- // labelRotate: 0
124
- }
125
- }
126
- DEFAULT_X_Y_AUX_PARAMS.xAxis.labelTextFormat.toString = () => `(value: number) => String(Math.round(value))`
127
- DEFAULT_X_Y_AUX_PARAMS.yAxis.labelTextFormat.toString = () => `(value: number) => String(Math.round(value))`
128
-
129
-
130
- export const DEFAULT_X_Y_AXES_PARAMS: XYAxesParams = {
131
- xAxis: {
132
- labelOffset: [0, 0],
133
- labelColorType: 'primary',
134
- axisLineVisible: false,
135
- axisLineColorType: 'primary',
136
- ticks: null,
137
- // tickFormat: ',.0f',
138
- tickFormat: v => v,
139
- tickLineVisible: true,
140
- tickPadding: 20,
141
- tickFullLine: true,
142
- tickFullLineDasharray: 'none',
143
- tickColorType: 'secondary',
144
- tickTextColorType: 'primary'
145
- },
146
- yAxis: {
147
- labelOffset: [0, 0],
148
- labelColorType: 'primary',
149
- axisLineVisible: false,
150
- axisLineColorType: 'primary',
151
- ticks: null,
152
- // tickFormat: ',.0f',
153
- tickFormat: v => v,
154
- tickLineVisible: true,
155
- tickPadding: 20,
156
- tickFullLine: true,
157
- tickFullLineDasharray: 'none',
158
- tickColorType: 'secondary',
159
- tickTextColorType: 'primary'
160
- }
161
- }
162
- DEFAULT_X_Y_AXES_PARAMS.xAxis.tickFormat.toString = () => `v => v`
163
- DEFAULT_X_Y_AXES_PARAMS.yAxis.tickFormat.toString = () => `v => v`
164
-
165
- export const DEFAULT_X_Y_ZOOM_PARAMS: XYZoomParams = {
166
-
1
+ import type { ComputedDataTypeMap } from '../../lib/core-types'
2
+ import type {
3
+ MultiValueLegendParams,
4
+ MultiValueTooltipParams,
5
+ RacingBarsParams,
6
+ RacingCounterTextsParams,
7
+ RacingValueAxisParams,
8
+ ScatterParams,
9
+ ScatterBubblesParams,
10
+ XAxisParams,
11
+ XYAuxParams,
12
+ XYAxesParams,
13
+ XZoomParams
14
+ } from '../../lib/plugins-basic-types'
15
+
16
+
17
+ export const DEFAULT_MULTI_VALUE_LEGEND_PARAMS: MultiValueLegendParams = {
18
+ // position: 'right',
19
+ // justify: 'end',
20
+ placement: 'bottom',
21
+ padding: 28,
22
+ // offset: [0, 0],
23
+ backgroundFill: 'none',
24
+ backgroundStroke: 'none',
25
+ gap: 10,
26
+ listRectWidth: 14,
27
+ listRectHeight: 14,
28
+ listRectRadius: 0,
29
+ // highlightEvent: false
30
+ textColorType: 'primary'
31
+ }
32
+
33
+ export const DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS: MultiValueTooltipParams = {
34
+ backgroundColorType: 'background',
35
+ strokeColorType: 'primary',
36
+ backgroundOpacity: 0.8,
37
+ textColorType: 'primary',
38
+ offset: [20, 5],
39
+ padding: 10,
40
+ renderFn: (eventData, { styles, utils }) => {
41
+ const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
42
+ const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
43
+ const valueText = eventData.datum._visibleValue.map(d => utils.toCurrency(d))
44
+ const bulletWidth = styles.textSizePx * 0.7
45
+ const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
46
+ const categorySvg = hasCategoryLabel
47
+ ? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>
48
+ <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
49
+ <tspan>${eventData.categoryLabel}</tspan>
50
+ </text>`
51
+ : ''
52
+ const datumLabelSvg = hasDatumLabel
53
+ ? `<tspan>${eventData.datum.label}</tspan> `
54
+ : ''
55
+ const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
56
+ ${datumLabelSvg}<tspan font-weight="bold">${valueText}</tspan>
57
+ </text>`
58
+
59
+ return `${categorySvg}
60
+ <g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : ''}>
61
+ ${datumSvg}
62
+ </g>`
63
+ },
64
+ }
65
+ DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles, utils }) => {
66
+ const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
67
+ const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
68
+ const valueText = eventData.datum._visibleValue.map(d => utils.toCurrency(d))
69
+ const bulletWidth = styles.textSizePx * 0.7
70
+ const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
71
+ const categorySvg = hasCategoryLabel
72
+ ? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.datum.color}"></rect>
73
+ <text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
74
+ <tspan>\${eventData.categoryLabel}</tspan>
75
+ </text>\`
76
+ : ''
77
+ const datumLabelSvg = hasDatumLabel
78
+ ? \`<tspan>\${eventData.datum.label}</tspan> \`
79
+ : ''
80
+ const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
81
+ \${datumLabelSvg}<tspan font-weight="bold">\${valueText}</tspan>
82
+ </text>\`
83
+
84
+ return \`\${categorySvg}
85
+ <g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
86
+ \${datumSvg}
87
+ </g>\`
88
+ }`
89
+
90
+ // export const DEFAULT_RANKING_AXIS_PARAMS: RacingAxisParams = {
91
+ // labelOffset: [0, 0],
92
+ // labelColorType: 'primary',
93
+ // axisLineVisible: false,
94
+ // axisLineColorType: 'primary',
95
+ // // ticks: null,
96
+ // // tickFormat: v => v,
97
+ // tickLineVisible: true,
98
+ // tickPadding: 20,
99
+ // // tickFullLine: true,
100
+ // // tickFullLineDasharray: 'none',
101
+ // tickColorType: 'secondary',
102
+ // tickTextRotate: 0,
103
+ // tickTextColorType: 'primary'
104
+ // }
105
+
106
+ export const DEFAULT_RACING_BARS_PARAMS: RacingBarsParams = {
107
+ bar: {
108
+ barWidth: 0,
109
+ barPadding: 8,
110
+ barRadius: false,
111
+ },
112
+ barLabel: {
113
+ position: 'inside',
114
+ padding: 20,
115
+ rotate: 0,
116
+ colorType: 'labelContrast'
117
+ },
118
+ valueLabel: {
119
+ padding: 20,
120
+ colorType: 'primary',
121
+ // format: num => {
122
+ // if (num === null || Number.isNaN(num) == true) {
123
+ // return num || 0
124
+ // }
125
+ // var parts = num.toString().split('.')
126
+ // parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
127
+ // return parts.join('.')
128
+ // }
129
+ format: v => v
130
+ },
131
+ axisLabel: {
132
+ offset: [0, 0],
133
+ colorType: 'primary'
134
+ },
135
+ // rankingAmount: 'auto'
136
+ rankingAmount: 10,
137
+ autorun: false,
138
+ loop: false
139
+ }
140
+ // DEFAULT_RACING_BARS_PARAMS.valueLabel.format.toString = () => `num => {
141
+ // if (num === null || Number.isNaN(num) == true) {
142
+ // return num || 0
143
+ // }
144
+ // var parts = num.toString().split('.')
145
+ // parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
146
+ // return parts.join('.')
147
+ // }
148
+ // }`
149
+ DEFAULT_RACING_BARS_PARAMS.valueLabel.format.toString = () => `v => v`
150
+
151
+ export const DEFAULT_RACING_COUNTER_TEXTS_PARAMS: RacingCounterTextsParams = {
152
+ renderFn: (valueLabel: string, valueIndex: number, data: ComputedDataTypeMap<'multiValue'>) => {
153
+ return valueLabel
154
+ },
155
+ textAttrs: [
156
+ {
157
+ "transform": "translate(0, 0)"
158
+ }
159
+ ],
160
+ textStyles: [
161
+ {
162
+ "font-weight": "bold",
163
+ "text-anchor": "end",
164
+ "pointer-events": "none",
165
+ "dominant-baseline": "auto",
166
+ "font-size": 64,
167
+ "fill": "#bebebe"
168
+ },
169
+ {
170
+ "text-anchor": "end",
171
+ "pointer-events": "none",
172
+ "dominant-baseline": "auto",
173
+ "font-size": 24,
174
+ "fill": "#bebebe"
175
+ },
176
+ ],
177
+ paddingRight: 0,
178
+ paddingBottom: 0
179
+ }
180
+
181
+ export const DEFAULT_RACING_VALUE_AXIS_PARAMS: RacingValueAxisParams = {
182
+ labelOffset: [0, 0],
183
+ labelColorType: 'primary',
184
+ axisLineVisible: false,
185
+ axisLineColorType: 'secondary',
186
+ ticks: null,
187
+ // tickFormat: ',.0f',
188
+ // tickFormat: v => v,
189
+ tickFormat: num => {
190
+ if (num === null || Number.isNaN(num) == true) {
191
+ return num || 0
192
+ }
193
+ var parts = num.toString().split('.')
194
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
195
+ return parts.join('.')
196
+ },
197
+ tickLineVisible: true,
198
+ tickPadding: 20,
199
+ tickFullLine: true,
200
+ tickFullLineDasharray: 'none',
201
+ tickColorType: 'secondary',
202
+ tickTextColorType: 'primary'
203
+ }
204
+ DEFAULT_RACING_VALUE_AXIS_PARAMS.tickFormat.toString = () => `num => {
205
+ if (num === null || Number.isNaN(num) == true) {
206
+ return num || 0
207
+ }
208
+ var parts = num.toString().split('.')
209
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
210
+ return parts.join('.')
211
+ }`
212
+
213
+ export const DEFAULT_SCATTER_PARAMS: ScatterParams = {
214
+ radius: 5,
215
+ fillColorType: 'label',
216
+ strokeColorType: 'label',
217
+ strokeWidth: 0,
218
+ }
219
+
220
+ export const DEFAULT_SCATTER_BUBBLES_PARAMS: ScatterBubblesParams = {
221
+ // radius: 5,
222
+ fillColorType: 'label',
223
+ strokeColorType: 'label',
224
+ strokeWidth: 0,
225
+ valueLinearOpacity: [0.8, 0.8],
226
+ arcScaleType: 'area',
227
+ sizeAdjust: 0.5
228
+ }
229
+
230
+ export const DEFAULT_X_AXIS_PARAMS: XAxisParams = {
231
+ labelOffset: [0, 0],
232
+ labelColorType: 'primary',
233
+ axisLineVisible: false,
234
+ axisLineColorType: 'secondary',
235
+ ticks: null,
236
+ // tickFormat: ',.0f',
237
+ // tickFormat: v => v,
238
+ tickFormat: num => {
239
+ if (num === null || Number.isNaN(num) == true) {
240
+ return num || 0
241
+ }
242
+ var parts = num.toString().split('.')
243
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
244
+ return parts.join('.')
245
+ },
246
+ tickLineVisible: true,
247
+ tickPadding: 20,
248
+ tickFullLine: true,
249
+ tickFullLineDasharray: 'none',
250
+ tickColorType: 'secondary',
251
+ tickTextColorType: 'primary'
252
+ }
253
+ DEFAULT_X_AXIS_PARAMS.tickFormat.toString = () => `num => {
254
+ if (num === null || Number.isNaN(num) == true) {
255
+ return num || 0
256
+ }
257
+ var parts = num.toString().split('.')
258
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
259
+ return parts.join('.')
260
+ }`
261
+
262
+ export const DEFAULT_X_Y_AUX_PARAMS: XYAuxParams = {
263
+ xAxis: {
264
+ showLine: true,
265
+ showLabel: true,
266
+ lineDashArray: '3, 3',
267
+ lineColorType: 'primary',
268
+ labelColorType: 'primary',
269
+ labelTextColorType: 'background',
270
+ // labelTextFormat: text => text,
271
+ // labelTextFormat: (value: number) => String(Math.round(value)),
272
+ labelTextFormat: num => {
273
+ if (num === null || Number.isNaN(num) == true) {
274
+ return num || 0
275
+ }
276
+ var parts = num.toString().split('.')
277
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
278
+ return parts.join('.')
279
+ },
280
+ labelPadding: 20,
281
+ // labelRotate: 0
282
+ },
283
+ yAxis: {
284
+ showLine: true,
285
+ showLabel: true,
286
+ lineDashArray: '3, 3',
287
+ lineColorType: 'primary',
288
+ labelColorType: 'primary',
289
+ labelTextColorType: 'background',
290
+ // labelTextFormat: text => text,
291
+ // labelTextFormat: (value: number) => String(Math.round(value)),
292
+ labelTextFormat: num => {
293
+ if (num === null || Number.isNaN(num) == true) {
294
+ return num || 0
295
+ }
296
+ var parts = num.toString().split('.')
297
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
298
+ return parts.join('.')
299
+ },
300
+ labelPadding: 20,
301
+ // labelRotate: 0
302
+ }
303
+ }
304
+ DEFAULT_X_Y_AUX_PARAMS.xAxis.labelTextFormat.toString = () => `num => {
305
+ if (num === null || Number.isNaN(num) == true) {
306
+ return num || 0
307
+ }
308
+ var parts = num.toString().split('.')
309
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
310
+ return parts.join('.')
311
+ }`
312
+ DEFAULT_X_Y_AUX_PARAMS.yAxis.labelTextFormat.toString = () => `num => {
313
+ if (num === null || Number.isNaN(num) == true) {
314
+ return num || 0
315
+ }
316
+ var parts = num.toString().split('.')
317
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
318
+ return parts.join('.')
319
+ }`
320
+
321
+
322
+ export const DEFAULT_X_Y_AXES_PARAMS: XYAxesParams = {
323
+ xAxis: {
324
+ labelOffset: [0, 0],
325
+ labelColorType: 'primary',
326
+ axisLineVisible: false,
327
+ axisLineColorType: 'primary',
328
+ ticks: null,
329
+ // tickFormat: ',.0f',
330
+ // tickFormat: v => v,
331
+ tickFormat: num => {
332
+ if (num === null || Number.isNaN(num) == true) {
333
+ return num || 0
334
+ }
335
+ var parts = num.toString().split('.')
336
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
337
+ return parts.join('.')
338
+ },
339
+ tickLineVisible: true,
340
+ tickPadding: 20,
341
+ tickFullLine: true,
342
+ tickFullLineDasharray: 'none',
343
+ tickColorType: 'secondary',
344
+ tickTextColorType: 'primary'
345
+ },
346
+ yAxis: {
347
+ labelOffset: [0, 0],
348
+ labelColorType: 'primary',
349
+ axisLineVisible: false,
350
+ axisLineColorType: 'primary',
351
+ ticks: null,
352
+ // tickFormat: ',.0f',
353
+ // tickFormat: v => v,
354
+ tickFormat: num => {
355
+ if (num === null || Number.isNaN(num) == true) {
356
+ return num || 0
357
+ }
358
+ var parts = num.toString().split('.')
359
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
360
+ return parts.join('.')
361
+ },
362
+ tickLineVisible: true,
363
+ tickPadding: 20,
364
+ tickFullLine: true,
365
+ tickFullLineDasharray: 'none',
366
+ tickColorType: 'secondary',
367
+ tickTextColorType: 'primary'
368
+ }
369
+ }
370
+ DEFAULT_X_Y_AXES_PARAMS.xAxis.tickFormat.toString = () => `num => {
371
+ if (num === null || Number.isNaN(num) == true) {
372
+ return num || 0
373
+ }
374
+ var parts = num.toString().split('.')
375
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
376
+ return parts.join('.')
377
+ }`
378
+ DEFAULT_X_Y_AXES_PARAMS.yAxis.tickFormat.toString = () => `num => {
379
+ if (num === null || Number.isNaN(num) == true) {
380
+ return num || 0
381
+ }
382
+ var parts = num.toString().split('.')
383
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
384
+ return parts.join('.')
385
+ }`
386
+
387
+ export const DEFAULT_X_Y_ZOOM_PARAMS: XZoomParams = {
388
+
167
389
  }
@@ -1,9 +1,13 @@
1
- export * from './defaults'
2
- // export * from './types'
3
- export { MultiValueLegend } from './plugins/MultiValueLegend'
4
- export { MultiValueTooltip } from './plugins/MultiValueTooltip'
5
- export { Scatter } from './plugins/Scatter'
6
- export { ScatterBubbles } from './plugins/ScatterBubbles'
7
- export { XYAux } from './plugins/XYAux'
8
- export { XYAxes } from './plugins/XYAxes'
9
- export { XYZoom } from './plugins/XYZoom'
1
+ export * from './defaults'
2
+ // export * from './types'
3
+ export { MultiValueLegend } from './plugins/MultiValueLegend'
4
+ export { MultiValueTooltip } from './plugins/MultiValueTooltip'
5
+ export { RacingBars } from './plugins/RacingBars'
6
+ export { RacingCounterTexts } from './plugins/RacingCounterTexts'
7
+ export { RacingValueAxis } from './plugins/RacingValueAxis'
8
+ export { Scatter } from './plugins/Scatter'
9
+ export { ScatterBubbles } from './plugins/ScatterBubbles'
10
+ export { XAxis } from './plugins/XAxis'
11
+ export { XYAux } from './plugins/XYAux'
12
+ export { XYAxes } from './plugins/XYAxes'
13
+ export { XZoom } from './plugins/XZoom'