@orbcharts/presets-basic 3.0.0-alpha.4 → 3.0.0-alpha.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-presets-basic.es.js +1383 -362
  3. package/dist/orbcharts-presets-basic.umd.js +1 -1
  4. package/dist/src/grid/PRESET_BARS_HORIZONTAL_AND_ROUND.d.ts +4 -0
  5. package/dist/src/grid/PRESET_BARS_HORIZONTAL_AND_THIN.d.ts +4 -0
  6. package/dist/src/grid/PRESET_BARS_ROUND.d.ts +4 -0
  7. package/dist/src/grid/PRESET_BARS_THIN.d.ts +4 -0
  8. package/dist/src/grid/PRESET_GRID_BASIC.d.ts +4 -0
  9. package/dist/src/grid/PRESET_GRID_HORIZONTAL.d.ts +4 -0
  10. package/dist/src/grid/PRESET_GRID_PN_SCALE.d.ts +4 -0
  11. package/dist/src/grid/PRESET_GRID_ROTATE_AXIS_LABEL.d.ts +4 -0
  12. package/dist/src/grid/PRESET_GRID_SEPARATE_SERIES.d.ts +4 -0
  13. package/dist/src/grid/PRESET_LINES_BASIC.d.ts +4 -0
  14. package/dist/src/grid/PRESET_LINES_CURVE.d.ts +4 -0
  15. package/dist/src/grid/PRESET_LINES_HIGHLIGHT_GROUP_DOTS.d.ts +4 -0
  16. package/dist/src/grid/PRESET_LINES_HORIZONTAL.d.ts +4 -0
  17. package/dist/src/grid/PRESET_LINES_LOOSE_TICKS.d.ts +4 -0
  18. package/dist/src/grid/PRESET_LINES_ROTATE_AXIS_LABEL.d.ts +4 -0
  19. package/dist/src/grid/PRESET_LINES_WITH_SOLID_DOTS.d.ts +4 -0
  20. package/dist/src/grid/PRESET_LINE_AREAS_BASIC.d.ts +4 -0
  21. package/dist/src/grid/PRESET_LINE_AREAS_CURVE.d.ts +4 -0
  22. package/dist/src/grid/PRESET_LINE_AREAS_HIGHLIGHT_GROUP_DOTS.d.ts +4 -0
  23. package/dist/src/grid/PRESET_LINE_AREAS_HORIZONTAL.d.ts +4 -0
  24. package/dist/src/grid/PRESET_LINE_AREAS_LOOSE_TICKS.d.ts +4 -0
  25. package/dist/src/grid/PRESET_LINE_AREAS_ROTATE_AXIS_LABEL.d.ts +4 -0
  26. package/dist/src/grid/PRESET_LINE_AREAS_SEPARATE_SERIES.d.ts +4 -0
  27. package/dist/src/grid/index.d.ts +23 -0
  28. package/dist/src/index.d.ts +4 -18
  29. package/dist/src/multiGrid/PRESET_MULTI_GRID_BASIC.d.ts +4 -0
  30. package/dist/src/multiGrid/PRESET_MULTI_GRID_DIVERGING.d.ts +4 -0
  31. package/dist/src/multiGrid/PRESET_MULTI_GRID_ROUND_STYLE.d.ts +6 -0
  32. package/dist/src/multiGrid/PRESET_MULTI_GRID_SEPARATE_GRID.d.ts +4 -0
  33. package/dist/src/multiGrid/PRESET_MULTI_LINES_SEPARATE_GRID.d.ts +4 -0
  34. package/dist/src/multiGrid/PRESET_MULTI_LINE_AREAS_SEPARATE_GRID.d.ts +4 -0
  35. package/dist/src/multiGrid/index.d.ts +6 -0
  36. package/dist/src/params.d.ts +7 -0
  37. package/dist/src/series/PRESET_BUBBLES_SCALING_BY_RADIUS.d.ts +4 -0
  38. package/dist/src/series/PRESET_BUBBLES_SEPARATE_SERIES.d.ts +4 -0
  39. package/dist/src/series/PRESET_PIE_BASIC.d.ts +4 -0
  40. package/dist/src/series/PRESET_PIE_DONUT.d.ts +4 -0
  41. package/dist/src/series/PRESET_PIE_HALF_DONUT.d.ts +4 -0
  42. package/dist/src/series/PRESET_PIE_WITH_INNER_LABELS.d.ts +4 -0
  43. package/dist/src/series/PRESET_ROSE_BASIC.d.ts +4 -0
  44. package/dist/src/series/PRESET_ROSE_SCALING_BY_RADIUS.d.ts +4 -0
  45. package/dist/src/series/PRESET_SERIES_BASIC.d.ts +4 -0
  46. package/dist/src/series/PRESET_SERIES_SEPARATE_SERIES.d.ts +4 -0
  47. package/dist/src/series/PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES.d.ts +4 -0
  48. package/dist/src/series/PRESET_SERIES_SUM_SERIES.d.ts +4 -0
  49. package/dist/src/series/index.d.ts +12 -0
  50. package/dist/src/tree/PRESET_TREE_BASIC.d.ts +4 -0
  51. package/dist/src/tree/index.d.ts +1 -0
  52. package/dist/src/types.d.ts +116 -37
  53. package/dist/vite.config.d.ts +1 -1
  54. package/package.json +43 -43
  55. package/src/grid/PRESET_BARS_HORIZONTAL_AND_ROUND.ts +62 -0
  56. package/src/grid/PRESET_BARS_HORIZONTAL_AND_THIN.ts +59 -0
  57. package/src/grid/PRESET_BARS_ROUND.ts +46 -0
  58. package/src/grid/PRESET_BARS_THIN.ts +43 -0
  59. package/src/grid/PRESET_GRID_BASIC.ts +25 -0
  60. package/src/grid/PRESET_GRID_HORIZONTAL.ts +42 -0
  61. package/src/grid/PRESET_GRID_PN_SCALE.ts +33 -0
  62. package/src/grid/PRESET_GRID_ROTATE_AXIS_LABEL.ts +33 -0
  63. package/src/grid/PRESET_GRID_SEPARATE_SERIES.ts +38 -0
  64. package/src/grid/PRESET_LINES_BASIC.ts +44 -0
  65. package/src/grid/PRESET_LINES_CURVE.ts +47 -0
  66. package/src/grid/PRESET_LINES_HIGHLIGHT_GROUP_DOTS.ts +46 -0
  67. package/src/grid/PRESET_LINES_HORIZONTAL.ts +60 -0
  68. package/src/grid/PRESET_LINES_LOOSE_TICKS.ts +46 -0
  69. package/src/grid/PRESET_LINES_ROTATE_AXIS_LABEL.ts +49 -0
  70. package/src/grid/PRESET_LINES_WITH_SOLID_DOTS.ts +48 -0
  71. package/src/grid/PRESET_LINE_AREAS_BASIC.ts +54 -0
  72. package/src/grid/PRESET_LINE_AREAS_CURVE.ts +59 -0
  73. package/src/grid/PRESET_LINE_AREAS_HIGHLIGHT_GROUP_DOTS.ts +58 -0
  74. package/src/grid/PRESET_LINE_AREAS_HORIZONTAL.ts +58 -0
  75. package/src/grid/PRESET_LINE_AREAS_LOOSE_TICKS.ts +56 -0
  76. package/src/grid/PRESET_LINE_AREAS_ROTATE_AXIS_LABEL.ts +59 -0
  77. package/src/grid/PRESET_LINE_AREAS_SEPARATE_SERIES.ts +61 -0
  78. package/src/grid/index.ts +23 -0
  79. package/src/index.ts +4 -133
  80. package/src/multiGrid/PRESET_MULTI_GRID_BASIC.ts +36 -0
  81. package/src/multiGrid/PRESET_MULTI_GRID_DIVERGING.ts +85 -0
  82. package/src/multiGrid/PRESET_MULTI_GRID_ROUND_STYLE.ts +57 -0
  83. package/src/multiGrid/PRESET_MULTI_GRID_SEPARATE_GRID.ts +59 -0
  84. package/src/multiGrid/PRESET_MULTI_LINES_SEPARATE_GRID.ts +103 -0
  85. package/src/multiGrid/PRESET_MULTI_LINE_AREAS_SEPARATE_GRID.ts +121 -0
  86. package/src/multiGrid/index.ts +6 -0
  87. package/src/params.ts +57 -0
  88. package/src/series/PRESET_BUBBLES_SCALING_BY_RADIUS.ts +19 -0
  89. package/src/series/PRESET_BUBBLES_SEPARATE_SERIES.ts +29 -0
  90. package/src/series/PRESET_PIE_BASIC.ts +19 -0
  91. package/src/series/PRESET_PIE_DONUT.ts +27 -0
  92. package/src/series/PRESET_PIE_HALF_DONUT.ts +40 -0
  93. package/src/series/PRESET_PIE_WITH_INNER_LABELS.ts +28 -0
  94. package/src/series/PRESET_ROSE_BASIC.ts +19 -0
  95. package/src/series/PRESET_ROSE_SCALING_BY_RADIUS.ts +27 -0
  96. package/src/series/PRESET_SERIES_BASIC.ts +15 -0
  97. package/src/series/PRESET_SERIES_SEPARATE_SERIES.ts +17 -0
  98. package/src/series/PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES.ts +18 -0
  99. package/src/series/PRESET_SERIES_SUM_SERIES.ts +17 -0
  100. package/src/series/index.ts +13 -0
  101. package/src/tree/PRESET_TREE_BASIC.ts +25 -0
  102. package/src/tree/index.ts +1 -0
  103. package/src/types.ts +242 -58
  104. package/tsconfig.base.json +14 -0
  105. package/tsconfig.json +2 -13
  106. package/vite.config.js +22 -44
  107. package/dist/src/chartParamsFiles/CP_BOTTOM_AND_LEFT_PADDING.d.ts +0 -3
  108. package/dist/src/chartParamsFiles/CP_BOTTOM_AND_LEFT_PADDING_WITH_SERIES_HIGHLIGHT.d.ts +0 -3
  109. package/dist/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING.d.ts +0 -3
  110. package/dist/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING_WITH_SERIES_HIGHLIGHT.d.ts +0 -3
  111. package/dist/src/chartParamsFiles/CP_BOTTOM_PADDING.d.ts +0 -3
  112. package/dist/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_GROUP_HIGHLIGHT.d.ts +0 -3
  113. package/dist/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_SERIES_HIGHLIGHT.d.ts +0 -3
  114. package/dist/src/chartParamsFiles/CP_LEFT_PADDING.d.ts +0 -3
  115. package/dist/src/chartParamsFiles/CP_RIGHT_PADDING.d.ts +0 -3
  116. package/dist/src/chartParamsFiles/CP_TOP_AND_NO_BOTTOM_PADDING.d.ts +0 -3
  117. package/dist/src/chartParamsFiles/index.d.ts +0 -10
  118. package/dist/src/createPreset.d.ts +0 -9
  119. package/dist/src/gridDataFormatterFiles/DF_BOTTOM_VALUE_AXIS.d.ts +0 -3
  120. package/dist/src/gridDataFormatterFiles/index.d.ts +0 -1
  121. package/dist/src/gridPluginParamsFiles/Bars/PP_BARS_ROUND.d.ts +0 -4
  122. package/dist/src/gridPluginParamsFiles/Bars/PP_BARS_THIN.d.ts +0 -4
  123. package/dist/src/gridPluginParamsFiles/Bars/index.d.ts +0 -2
  124. package/dist/src/gridPluginParamsFiles/Dots/PP_DOTS_ONLY_SHOW_HIGHLIGHTED.d.ts +0 -4
  125. package/dist/src/gridPluginParamsFiles/Dots/PP_DOTS_SOLID.d.ts +0 -4
  126. package/dist/src/gridPluginParamsFiles/Dots/index.d.ts +0 -2
  127. package/dist/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM.d.ts +0 -4
  128. package/dist/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST.d.ts +0 -4
  129. package/dist/src/gridPluginParamsFiles/GridLegend/index.d.ts +0 -2
  130. package/dist/src/gridPluginParamsFiles/GroupAxis/PP_GROUP_AXIS_ROTATE_LABEL.d.ts +0 -4
  131. package/dist/src/gridPluginParamsFiles/GroupAxis/index.d.ts +0 -1
  132. package/dist/src/gridPluginParamsFiles/Lines/PP_LINES_CURVE.d.ts +0 -4
  133. package/dist/src/gridPluginParamsFiles/Lines/index.d.ts +0 -1
  134. package/dist/src/gridPluginParamsFiles/index.d.ts +0 -5
  135. package/dist/src/multiGridDataFormatterFiles/index.d.ts +0 -1
  136. package/dist/src/multiGridPluginParamsFiles/index.d.ts +0 -1
  137. package/dist/src/multiValueDataFormatterFiles/index.d.ts +0 -1
  138. package/dist/src/multiValuePluginParamsFiles/index.d.ts +0 -1
  139. package/dist/src/relationshipDataFormatterFiles/index.d.ts +0 -1
  140. package/dist/src/relationshipPluginParamsFiles/index.d.ts +0 -1
  141. package/dist/src/seriesDataFormatterFiles/index.d.ts +0 -1
  142. package/dist/src/seriesPluginParamsFiles/Bubbles/PP_BUBBLES_SCALING_BY_RADIUS.d.ts +0 -4
  143. package/dist/src/seriesPluginParamsFiles/Bubbles/index.d.ts +0 -1
  144. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_BLACK_STROKE.d.ts +0 -0
  145. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_DONUT.d.ts +0 -4
  146. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_HALF_DONUT.d.ts +0 -4
  147. package/dist/src/seriesPluginParamsFiles/Pie/index.d.ts +0 -2
  148. package/dist/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_HALF_ANGLE.d.ts +0 -4
  149. package/dist/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_INNER.d.ts +0 -4
  150. package/dist/src/seriesPluginParamsFiles/PieLabels/index.d.ts +0 -2
  151. package/dist/src/seriesPluginParamsFiles/SeriesLegend/PP_SERIES_LEGEND_ROUND.d.ts +0 -4
  152. package/dist/src/seriesPluginParamsFiles/SeriesLegend/index.d.ts +0 -1
  153. package/dist/src/seriesPluginParamsFiles/index.d.ts +0 -4
  154. package/dist/src/treeDataFormatterFiles/index.d.ts +0 -1
  155. package/dist/src/treePluginParamsFiles/index.d.ts +0 -1
  156. package/src/chartParamsFiles/CP_BOTTOM_AND_LEFT_PADDING.ts +0 -14
  157. package/src/chartParamsFiles/CP_BOTTOM_AND_LEFT_PADDING_WITH_SERIES_HIGHLIGHT.ts +0 -15
  158. package/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING.ts +0 -14
  159. package/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING_WITH_SERIES_HIGHLIGHT.ts +0 -15
  160. package/src/chartParamsFiles/CP_BOTTOM_PADDING.ts +0 -14
  161. package/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_GROUP_HIGHLIGHT.ts +0 -15
  162. package/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_SERIES_HIGHLIGHT.ts +0 -15
  163. package/src/chartParamsFiles/CP_LEFT_PADDING.ts +0 -14
  164. package/src/chartParamsFiles/CP_RIGHT_PADDING.ts +0 -14
  165. package/src/chartParamsFiles/CP_TOP_AND_NO_BOTTOM_PADDING.ts +0 -14
  166. package/src/chartParamsFiles/index.ts +0 -10
  167. package/src/createPreset.ts +0 -88
  168. package/src/gridDataFormatterFiles/DF_BOTTOM_VALUE_AXIS.ts +0 -16
  169. package/src/gridDataFormatterFiles/index.ts +0 -1
  170. package/src/gridPluginParamsFiles/Bars/PP_BARS_ROUND.ts +0 -15
  171. package/src/gridPluginParamsFiles/Bars/PP_BARS_THIN.ts +0 -14
  172. package/src/gridPluginParamsFiles/Bars/index.ts +0 -2
  173. package/src/gridPluginParamsFiles/Dots/PP_DOTS_ONLY_SHOW_HIGHLIGHTED.ts +0 -12
  174. package/src/gridPluginParamsFiles/Dots/PP_DOTS_SOLID.ts +0 -14
  175. package/src/gridPluginParamsFiles/Dots/index.ts +0 -2
  176. package/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM.ts +0 -14
  177. package/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST.ts +0 -15
  178. package/src/gridPluginParamsFiles/GridLegend/index.ts +0 -2
  179. package/src/gridPluginParamsFiles/GroupAxis/PP_GROUP_AXIS_ROTATE_LABEL.ts +0 -12
  180. package/src/gridPluginParamsFiles/GroupAxis/index.ts +0 -1
  181. package/src/gridPluginParamsFiles/Lines/PP_LINES_CURVE.ts +0 -13
  182. package/src/gridPluginParamsFiles/Lines/index.ts +0 -1
  183. package/src/gridPluginParamsFiles/index.ts +0 -6
  184. package/src/multiGridDataFormatterFiles/index.ts +0 -1
  185. package/src/multiGridPluginParamsFiles/index.ts +0 -1
  186. package/src/multiValueDataFormatterFiles/index.ts +0 -1
  187. package/src/multiValuePluginParamsFiles/index.ts +0 -1
  188. package/src/relationshipDataFormatterFiles/index.ts +0 -1
  189. package/src/relationshipPluginParamsFiles/index.ts +0 -1
  190. package/src/seriesDataFormatterFiles/index.ts +0 -1
  191. package/src/seriesPluginParamsFiles/Bubbles/PP_BUBBLES_SCALING_BY_RADIUS.ts +0 -12
  192. package/src/seriesPluginParamsFiles/Bubbles/index.ts +0 -1
  193. package/src/seriesPluginParamsFiles/Pie/PP_PIE_BLACK_STROKE.ts +0 -0
  194. package/src/seriesPluginParamsFiles/Pie/PP_PIE_DONUT.ts +0 -12
  195. package/src/seriesPluginParamsFiles/Pie/PP_PIE_HALF_DONUT.ts +0 -14
  196. package/src/seriesPluginParamsFiles/Pie/index.ts +0 -2
  197. package/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_HALF_ANGLE.ts +0 -13
  198. package/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_INNER.ts +0 -13
  199. package/src/seriesPluginParamsFiles/PieLabels/index.ts +0 -2
  200. package/src/seriesPluginParamsFiles/SeriesLegend/PP_SERIES_LEGEND_ROUND.ts +0 -12
  201. package/src/seriesPluginParamsFiles/SeriesLegend/index.ts +0 -1
  202. package/src/seriesPluginParamsFiles/index.ts +0 -4
  203. package/src/treeDataFormatterFiles/index.ts +0 -1
  204. package/src/treePluginParamsFiles/index.ts +0 -1
@@ -0,0 +1,29 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetBubblesParams, PresetSeriesLegendParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_BUBBLES_SEPARATE_SERIES: PresetPartial<'series', PresetBubblesParams
6
+ & PresetSeriesLegendParams
7
+ & PresetNoneDataPluginParams> = {
8
+ name: 'PRESET_BUBBLES_SEPARATE_SERIES',
9
+ description: '分開顯示Series泡泡',
10
+ chartParams: {
11
+ // 加長留空
12
+ padding: {
13
+ top: 160,
14
+ right: 160,
15
+ bottom: 160,
16
+ left: 160
17
+ },
18
+ },
19
+ dataFormatter: {
20
+ separateSeries: true,
21
+ },
22
+ allPluginParams: {
23
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
24
+ Bubbles: {},
25
+ SeriesLegend: {
26
+ listRectRadius: 7 // 圓型圖例列點
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,19 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_BASIC: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_PIE_BASIC',
7
+ description: '基本Pie參數',
8
+ dataFormatter: {
9
+ sort: (a, b) => b.value - a.value
10
+ },
11
+ allPluginParams: {
12
+ ...ALL_PLUGIN_PARAMS_SERIES,
13
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
+ SeriesLegend: {
15
+ listRectRadius: 7 // 圓型圖例列點
16
+ }
17
+ }
18
+ }
19
+ PRESET_PIE_BASIC.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,27 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetPieParams, PresetPieLabelsParams, PresetPieEventTextsParams, PresetSeriesLegendParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_DONUT: PresetPartial<'series', PresetPieParams
6
+ & PresetPieLabelsParams
7
+ & PresetPieEventTextsParams
8
+ & PresetSeriesLegendParams
9
+ & PresetNoneDataPluginParams> = {
10
+ name: 'PRESET_PIE_DONUT',
11
+ description: '甜甜圈圖',
12
+ dataFormatter: {
13
+ sort: (a, b) => b.value - a.value
14
+ },
15
+ allPluginParams: {
16
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
17
+ Pie: {
18
+ innerRadius: 0.5
19
+ },
20
+ PieLabels: {},
21
+ PieEventTexts: {},
22
+ SeriesLegend: {
23
+ listRectRadius: 7 // 圓型圖例列點
24
+ }
25
+ }
26
+ }
27
+ PRESET_PIE_DONUT.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,40 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetPieParams, PresetPieLabelsParams, PresetPieEventTextsParams, PresetSeriesLegendParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_HALF_DONUT: PresetPartial<'series', PresetPieParams
6
+ & PresetPieLabelsParams
7
+ & PresetPieEventTextsParams
8
+ & PresetSeriesLegendParams
9
+ & PresetNoneDataPluginParams> = {
10
+ name: 'PRESET_PIE_HALF_DONUT',
11
+ description: '半圓甜甜圈圖',
12
+ chartParams: {
13
+ padding: {
14
+ top: 120,
15
+ right: 120,
16
+ bottom: 0,
17
+ left: 60
18
+ },
19
+ },
20
+ dataFormatter: {
21
+ sort: (a, b) => b.value - a.value
22
+ },
23
+ allPluginParams: {
24
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
25
+ Pie: {
26
+ innerRadius: 0.5,
27
+ startAngle: - Math.PI / 2,
28
+ endAngle: Math.PI / 2,
29
+ },
30
+ PieLabels: {
31
+ startAngle: - Math.PI / 2,
32
+ endAngle: Math.PI / 2,
33
+ },
34
+ PieEventTexts: {},
35
+ SeriesLegend: {
36
+ listRectRadius: 7 // 圓型圖例列點
37
+ }
38
+ }
39
+ }
40
+ PRESET_PIE_HALF_DONUT.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,28 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetPieParams, PresetPieLabelsParams, PresetPieEventTextsParams, PresetSeriesLegendParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_WITH_INNER_LABELS: PresetPartial<'series', PresetPieParams
6
+ & PresetPieLabelsParams
7
+ & PresetPieEventTextsParams
8
+ & PresetSeriesLegendParams
9
+ & PresetNoneDataPluginParams> = {
10
+ name: 'PRESET_PIE_WITH_INNER_LABELS',
11
+ description: '圓餅圖及內部資料標籤',
12
+ dataFormatter: {
13
+ sort: (a, b) => b.value - a.value
14
+ },
15
+ allPluginParams: {
16
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
17
+ Pie: {},
18
+ PieLabels: {
19
+ "labelCentroid": 1.3, // 圖內資料標籤
20
+ "labelColorType": "primary"
21
+ },
22
+ PieEventTexts: {},
23
+ SeriesLegend: {
24
+ listRectRadius: 7 // 圓型圖例列點
25
+ }
26
+ }
27
+ }
28
+ PRESET_PIE_WITH_INNER_LABELS.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,19 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_ROSE_BASIC: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_ROSE_BASIC',
7
+ description: '基本Rose參數',
8
+ dataFormatter: {
9
+ sort: (a, b) => b.value - a.value
10
+ },
11
+ allPluginParams: {
12
+ ...ALL_PLUGIN_PARAMS_SERIES,
13
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
+ SeriesLegend: {
15
+ listRectRadius: 7 // 圓型圖例列點
16
+ }
17
+ }
18
+ }
19
+ PRESET_ROSE_BASIC.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,27 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetRoseParams, PresetRoseLabelsParams, PresetSeriesLegendParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_ROSE_SCALING_BY_RADIUS: PresetPartial<'series', PresetRoseParams
6
+ & PresetRoseLabelsParams
7
+ & PresetSeriesLegendParams
8
+ & PresetNoneDataPluginParams> = {
9
+ name: 'PRESET_ROSE_SCALING_BY_RADIUS',
10
+ description: '以半徑尺寸為比例的玫瑰圖',
11
+ dataFormatter: {
12
+ sort: (a, b) => b.value - a.value
13
+ },
14
+ allPluginParams: {
15
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
16
+ Rose: {
17
+ arcScaleType: 'radius'
18
+ },
19
+ RoseLabels: {
20
+ arcScaleType: 'radius',
21
+ },
22
+ SeriesLegend: {
23
+ listRectRadius: 7 // 圓型圖例列點
24
+ }
25
+ }
26
+ }
27
+ PRESET_ROSE_SCALING_BY_RADIUS.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,15 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_SERIES_BASIC: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_SERIES_BASIC',
7
+ description: '基本Series參數',
8
+ allPluginParams: {
9
+ ...ALL_PLUGIN_PARAMS_SERIES,
10
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
11
+ SeriesLegend: {
12
+ listRectRadius: 7 // 圓型圖例列點
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,17 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_SERIES_SEPARATE_SERIES: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_SERIES_SEPARATE_SERIES',
7
+ description: '分開顯示Series',
8
+ dataFormatter: {
9
+ sort: (a, b) => b.value - a.value,
10
+ separateSeries: true,
11
+ },
12
+ allPluginParams: {
13
+ ...ALL_PLUGIN_PARAMS_SERIES,
14
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
15
+ }
16
+ }
17
+ PRESET_SERIES_SEPARATE_SERIES.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,18 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES',
7
+ description: '分開顯示Series並合併Series資料',
8
+ dataFormatter: {
9
+ sort: (a, b) => b.value - a.value,
10
+ separateSeries: true,
11
+ sumSeries: true,
12
+ },
13
+ allPluginParams: {
14
+ ...ALL_PLUGIN_PARAMS_SERIES,
15
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
16
+ }
17
+ }
18
+ PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,17 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_SERIES_SUM_SERIES: PresetPartial<'series', PresetSeriesPluginParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_SERIES_SUM_SERIES',
7
+ description: '合併Series資料',
8
+ dataFormatter: {
9
+ sort: (a, b) => b.value - a.value,
10
+ sumSeries: true
11
+ },
12
+ allPluginParams: {
13
+ ...ALL_PLUGIN_PARAMS_SERIES,
14
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
15
+ }
16
+ }
17
+ PRESET_SERIES_SUM_SERIES.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -0,0 +1,13 @@
1
+ export { PRESET_BUBBLES_SCALING_BY_RADIUS } from './PRESET_BUBBLES_SCALING_BY_RADIUS'
2
+ export { PRESET_BUBBLES_SEPARATE_SERIES } from './PRESET_BUBBLES_SEPARATE_SERIES'
3
+ export { PRESET_PIE_BASIC } from './PRESET_PIE_BASIC'
4
+ export { PRESET_PIE_DONUT } from './PRESET_PIE_DONUT'
5
+ export { PRESET_PIE_HALF_DONUT } from './PRESET_PIE_HALF_DONUT'
6
+ export { PRESET_PIE_WITH_INNER_LABELS } from './PRESET_PIE_WITH_INNER_LABELS'
7
+ export { PRESET_ROSE_BASIC } from './PRESET_ROSE_BASIC'
8
+ export { PRESET_ROSE_SCALING_BY_RADIUS } from './PRESET_ROSE_SCALING_BY_RADIUS'
9
+ export { PRESET_SERIES_BASIC } from './PRESET_SERIES_BASIC'
10
+ // export { PRESET_SERIES_DESC } from './PRESET_SERIES_DESC'
11
+ export { PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES } from './PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES'
12
+ export { PRESET_SERIES_SEPARATE_SERIES } from './PRESET_SERIES_SEPARATE_SERIES'
13
+ export { PRESET_SERIES_SUM_SERIES } from './PRESET_SERIES_SUM_SERIES'
@@ -0,0 +1,25 @@
1
+ import type { PresetPartial } from '@orbcharts/core'
2
+ import type { PresetTreeLegendParams, PresetTreeMapParams, PresetNoneDataPluginParams } from '../types'
3
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_TREE_BASIC: PresetPartial<'tree', PresetTreeLegendParams & PresetTreeMapParams & PresetNoneDataPluginParams> = {
6
+ name: 'PRESET_TREE_BASIC',
7
+ description: '基本Tree參數',
8
+ chartParams: {
9
+ padding: {
10
+ top: 40,
11
+ right: 40,
12
+ bottom: 60,
13
+ left: 40
14
+ },
15
+ },
16
+ allPluginParams: {
17
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
18
+ TreeMap: {},
19
+ TreeLegend: {
20
+ position: 'bottom',
21
+ justify: 'center',
22
+ padding: 14,
23
+ }
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ export { PRESET_TREE_BASIC } from './PRESET_TREE_BASIC'
package/src/types.ts CHANGED
@@ -1,58 +1,242 @@
1
- import type {
2
- ChartParamsPartial,
3
- DataFormatterPartialTypeMap,
4
- ChartType,
5
- Preset } from '@orbcharts/core'
6
- import * as chartParams from './chartParamsFiles'
7
- import * as seriesDataFormatters from './seriesDataFormatterFiles'
8
- import * as seriesPluginParams from './seriesPluginParamsFiles'
9
- import * as gridDataFormatters from './gridDataFormatterFiles'
10
- import * as gridPluginParams from './gridPluginParamsFiles'
11
- import * as multiGridDataFormatters from './multiGridDataFormatterFiles'
12
- import * as multiGridPluginParams from './multiGridPluginParamsFiles'
13
- import * as multiValueDataFormatters from './multiValueDataFormatterFiles'
14
- import * as multiValuePluginParams from './multiValuePluginParamsFiles'
15
- import * as relationshipDataFormatters from './relationshipDataFormatterFiles'
16
- import * as relationshipPluginParams from './relationshipPluginParamsFiles'
17
- import * as treeDataFormatters from './treeDataFormatterFiles'
18
- import * as treePluginParams from './treePluginParamsFiles'
19
-
20
- export interface ChartParamsFile {
21
- id: string
22
- description: string
23
- data: ChartParamsPartial
24
- }
25
-
26
- export interface DataFormatterFile<T extends ChartType> {
27
- id: string
28
- chartType: T
29
- description: string
30
- data: DataFormatterPartialTypeMap<T>
31
- }
32
-
33
- export interface PluginParamsFile<PluginParams> {
34
- id: string
35
- chartType: ChartType
36
- pluginName: string
37
- description: string
38
- data: Partial<PluginParams>
39
- }
40
-
41
- export interface PresetFile<T extends ChartType> {
42
- chartParamsId?: keyof typeof chartParams
43
- dataFormatterId?: T extends 'series' ? keyof typeof seriesDataFormatters
44
- : T extends 'grid' ? keyof typeof gridDataFormatters
45
- : T extends 'multiGrid' ? keyof typeof multiGridDataFormatters
46
- : T extends 'multiValue' ? keyof typeof multiValueDataFormatters
47
- : T extends 'relationship' ? keyof typeof relationshipDataFormatters
48
- : T extends 'tree' ? keyof typeof treeDataFormatters
49
- : undefined
50
- allPluginParamsIds?: T extends 'series' ? (keyof typeof seriesPluginParams)[]
51
- : T extends 'grid' ? (keyof typeof gridPluginParams)[]
52
- : T extends 'multiGrid' ? (keyof typeof multiGridPluginParams)[]
53
- : T extends 'multiValue' ? (keyof typeof multiValuePluginParams)[]
54
- : T extends 'relationship' ? (keyof typeof relationshipPluginParams)[]
55
- : T extends 'tree' ? (keyof typeof treePluginParams)[]
56
- : undefined,
57
- description: string
58
- }
1
+ import type {
2
+ // -- series --
3
+ BubblesParams,
4
+ PieParams,
5
+ PieEventTextsParams,
6
+ PieLabelsParams,
7
+ RoseParams,
8
+ RoseLabelsParams,
9
+ SeriesLegendParams,
10
+
11
+ // -- grid --
12
+ BarsParams,
13
+ BarsPNParams,
14
+ BarStackParams,
15
+ BarsTriangleParams,
16
+ DotsParams,
17
+ GridLegendParams,
18
+ GroupAuxParams,
19
+ GroupAxisParams,
20
+ LineAreasParams,
21
+ LinesParams,
22
+ ScalingAreaParams,
23
+ ValueAxisParams,
24
+ ValueStackAxisParams,
25
+
26
+ // -- multiGrid --
27
+ MultiBarsParams,
28
+ MultiBarStackParams,
29
+ MultiBarsTriangleParams,
30
+ MultiDotsParams,
31
+ MultiGridLegendParams,
32
+ MultiGroupAxisParams,
33
+ MultiLineAreasParams,
34
+ MultiLinesParams,
35
+ MultiValueAxisParams,
36
+ MultiValueStackAxisParams,
37
+ OverlappingValueAxesParams,
38
+ OverlappingValueStackAxesParams,
39
+
40
+ // -- tree --
41
+ TreeLegendParams,
42
+ TreeMapParams,
43
+
44
+ // -- noneData --
45
+ TooltipParams
46
+ } from '@orbcharts/plugins-basic'
47
+
48
+ type DeepPartial<T> = Partial<{ [P in keyof T]: DeepPartial<T[P]> }>
49
+
50
+ // -- series --
51
+ // series的全部plugin參數
52
+ export type PresetSeriesPluginParams = PresetBubblesParams
53
+ & PresetPieParams
54
+ & PresetPieEventTextsParams
55
+ & PresetPieLabelsParams
56
+ & PresetRoseParams
57
+ & PresetRoseLabelsParams
58
+ & PresetSeriesLegendParams
59
+
60
+ export interface PresetBubblesParams {
61
+ Bubbles: Partial<BubblesParams>
62
+ }
63
+
64
+ export interface PresetPieParams {
65
+ Pie: Partial<PieParams>
66
+ }
67
+
68
+ export interface PresetPieEventTextsParams {
69
+ PieEventTexts: Partial<PieEventTextsParams>
70
+ }
71
+
72
+ export interface PresetPieLabelsParams {
73
+ PieLabels: Partial<PieLabelsParams>
74
+ }
75
+
76
+ export interface PresetRoseParams {
77
+ Rose: Partial<RoseParams>
78
+ }
79
+
80
+ export interface PresetRoseLabelsParams {
81
+ RoseLabels: Partial<RoseLabelsParams>
82
+ }
83
+
84
+ export interface PresetSeriesLegendParams {
85
+ SeriesLegend: Partial<SeriesLegendParams>
86
+ }
87
+
88
+ // -- grid --
89
+ // grid的全部plugin參數
90
+ export type PresetGridPluginParams = PresetBarsParams
91
+ & PresetBarsPNParams
92
+ & PresetBarStackParams
93
+ & PresetBarsTriangleParams
94
+ & PresetDotsParams
95
+ & PresetGridLegendParams
96
+ & PresetGroupAuxParams
97
+ & PresetGroupAxisParams
98
+ & PresetLineAreasParams
99
+ & PresetLinesParams
100
+ & PresetScalingAreaParams
101
+ & PresetValueAxisParams
102
+ & PresetValueStackAxisParams
103
+
104
+ export interface PresetBarsParams {
105
+ Bars: Partial<BarsParams>
106
+ }
107
+
108
+ export interface PresetBarsPNParams {
109
+ BarsPN: Partial<BarsPNParams>
110
+ }
111
+
112
+ export interface PresetBarStackParams {
113
+ BarStack: Partial<BarStackParams>
114
+ }
115
+
116
+ export interface PresetBarsTriangleParams {
117
+ BarsTriangle: Partial<BarsTriangleParams>
118
+ }
119
+
120
+ export interface PresetDotsParams {
121
+ Dots: Partial<DotsParams>
122
+ }
123
+
124
+ export interface PresetGridLegendParams {
125
+ GridLegend: Partial<GridLegendParams>
126
+ }
127
+
128
+ export interface PresetGroupAuxParams {
129
+ GroupAux: Partial<GroupAuxParams>
130
+ }
131
+
132
+ export interface PresetGroupAxisParams {
133
+ GroupAxis: Partial<GroupAxisParams>
134
+ }
135
+
136
+ export interface PresetLineAreasParams {
137
+ LineAreas: Partial<LineAreasParams>
138
+ }
139
+
140
+ export interface PresetLinesParams {
141
+ Lines: Partial<LinesParams>
142
+ }
143
+
144
+ export interface PresetScalingAreaParams {
145
+ ScalingArea: Partial<ScalingAreaParams>
146
+ }
147
+
148
+ export interface PresetValueAxisParams {
149
+ ValueAxis: Partial<ValueAxisParams>
150
+ }
151
+
152
+ export interface PresetValueStackAxisParams {
153
+ ValueStackAxis: Partial<ValueStackAxisParams>
154
+ }
155
+
156
+ // -- multiGrid --
157
+ // multiGrid的全部plugin參數
158
+ export type PresetMultiGridPluginParams = PresetMultiBarsParams
159
+ & PresetMultiBarStackParams
160
+ & PresetMultiBarsTriangleParams
161
+ & PresetMultiDotsParams
162
+ & PresetMultiGridLegendParams
163
+ & PresetMultiGroupAxisParams
164
+ & PresetMultiLineAreasParams
165
+ & PresetMultiLinesParams
166
+ & PresetMultiValueAxisParams
167
+ & PresetMultiValueStackAxisParams
168
+ & PresetOverlappingValueAxesParams
169
+ & PresetOverlappingValueStackAxesParams
170
+
171
+ // multiGrid分開grid
172
+ export type PresetMultiGridSepratedPluginParams = Omit<PresetMultiGridPluginParams, 'OverlappingValueAxes' | 'OverlappingValueStackAxes'>
173
+
174
+ // multiGrid重疊grid
175
+ export type PresetMultiGridOverlappedPluginParams = Omit<PresetMultiGridPluginParams, 'PresetMultiGroupAxisParams' | 'PresetMultiValueAxisParams'>
176
+
177
+ export interface PresetMultiBarsParams {
178
+ MultiBars: Partial<MultiBarsParams>
179
+ }
180
+
181
+ export interface PresetMultiBarStackParams {
182
+ MultiBarStack: Partial<MultiBarStackParams>
183
+ }
184
+
185
+ export interface PresetMultiBarsTriangleParams {
186
+ MultiBarsTriangle: Partial<MultiBarsTriangleParams>
187
+ }
188
+
189
+ export interface PresetMultiDotsParams {
190
+ MultiDots: Partial<MultiDotsParams>
191
+ }
192
+
193
+ export interface PresetMultiGridLegendParams {
194
+ MultiGridLegend: DeepPartial<MultiGridLegendParams>
195
+ }
196
+
197
+ export interface PresetMultiGroupAxisParams {
198
+ MultiGroupAxis: Partial<MultiGroupAxisParams>
199
+ }
200
+
201
+ export interface PresetMultiLineAreasParams {
202
+ MultiLineAreas: Partial<MultiLineAreasParams>
203
+ }
204
+
205
+ export interface PresetMultiLinesParams {
206
+ MultiLines: Partial<MultiLinesParams>
207
+ }
208
+
209
+ export interface PresetMultiValueAxisParams {
210
+ MultiValueAxis: Partial<MultiValueAxisParams>
211
+ }
212
+
213
+ export interface PresetMultiValueStackAxisParams {
214
+ MultiValueStackAxis: Partial<MultiValueStackAxisParams>
215
+ }
216
+
217
+ export interface PresetOverlappingValueAxesParams {
218
+ OverlappingValueAxes: Partial<OverlappingValueAxesParams>
219
+ }
220
+
221
+ export interface PresetOverlappingValueStackAxesParams {
222
+ OverlappingValueStackAxes: Partial<OverlappingValueStackAxesParams>
223
+ }
224
+
225
+ // -- tree --
226
+ export type PresetTreePluginParams = PresetTreeLegendParams & PresetTreeMapParams
227
+
228
+ export interface PresetTreeLegendParams {
229
+ TreeLegend: Partial<TreeLegendParams>
230
+ }
231
+
232
+ export interface PresetTreeMapParams {
233
+ TreeMap: Partial<TreeMapParams>
234
+ }
235
+
236
+ // -- noneData --
237
+ // noneData的全部plugin參數
238
+ export type PresetNoneDataPluginParams = PresetTooltipParams
239
+
240
+ export interface PresetTooltipParams {
241
+ Tooltip: Partial<TooltipParams>
242
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "sourceMap": true,
5
+ "noImplicitAny": true,
6
+ "module": "esnext",
7
+ "target": "es5",
8
+ "jsx": "react",
9
+ "allowJs": true,
10
+ "moduleResolution": "node",
11
+ "allowSyntheticDefaultImports" : true,
12
+ "esModuleInterop" : true
13
+ }
14
+ }
package/tsconfig.json CHANGED
@@ -1,14 +1,3 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "sourceMap": true,
5
- "noImplicitAny": true,
6
- "module": "es6",
7
- "target": "es5",
8
- "jsx": "react",
9
- "allowJs": true,
10
- "moduleResolution": "node",
11
- "allowSyntheticDefaultImports" : true,
12
- "esModuleInterop" : true
13
- }
1
+ {
2
+ "extends": "./tsconfig.base.json"
14
3
  }