visualifyjs 2.5.3-2.dev → 2.5.3-9-dev

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of visualifyjs might be problematic. Click here for more details.

Files changed (139) hide show
  1. package/.github/workflows/{static.yml.bak → build.yaml} +51 -51
  2. package/LICENSE +674 -674
  3. package/README.md +40 -58
  4. package/config-overrides.js +31 -31
  5. package/dist/visualify.js +3 -3
  6. package/docs/CLI.md +15 -0
  7. package/docs/{docs/README.md → README.md} +41 -65
  8. package/docs/{docs/Rechart → Rechart}/bar.md +190 -190
  9. package/docs/{docs/Rechart → Rechart}/funnel.md +193 -241
  10. package/docs/{docs/Rechart → Rechart}/line.md +355 -355
  11. package/docs/{docs/Rechart → Rechart}/pie.md +225 -225
  12. package/docs/{docs/Rechart → Rechart}/radar.md +253 -253
  13. package/docs/{docs/_404.md → _404.md} +51 -51
  14. package/docs/{docs/_coverpage.md → _coverpage.md} +11 -11
  15. package/docs/{docs/_sidebar.md → _sidebar.md} +42 -44
  16. package/docs/{docs/components → components}/dotBio.md +34 -34
  17. package/docs/{docs/components → components}/echart.md +82 -82
  18. package/docs/{docs/components → components}/html.md +34 -34
  19. package/docs/{docs/components → components}/macaron.md +145 -145
  20. package/docs/components/markdown.md +0 -0
  21. package/docs/{docs/components → components}/more.md +142 -142
  22. package/docs/{docs/components → components}/plotly.md +62 -62
  23. package/docs/{docs/components → components}/scatterL.md +70 -70
  24. package/docs/{docs/components → components}/visium.md +56 -56
  25. package/docs/{docs/configuration.md → configuration.md} +123 -121
  26. package/docs/{docs/deploy.md → deploy.md} +23 -31
  27. package/docs/index.html +70 -70
  28. package/docs/log.md +1 -0
  29. package/docs/manifest.json +23 -23
  30. package/docs/{docs/more-pages.md → more-pages.md} +23 -23
  31. package/docs/{docs/quickstart.md → quickstart.md} +115 -124
  32. package/docs/{docs/rechart-attributes.md → rechart-attributes.md} +74 -74
  33. package/docs/{docs/rechart-basic-usage.md → rechart-basic-usage.md} +162 -162
  34. package/docs/static/css/fluff-stuff.css +169 -169
  35. package/docs/static/css/font-awesome.min.css +4 -4
  36. package/docs/static/css/visualify.css +25 -25
  37. package/docs/static/js/configuration.js +448 -448
  38. package/docs/static/js/visualify.js +24 -23
  39. package/docs/theme.md +3 -0
  40. package/package.json +74 -83
  41. package/rollup.config.mjs +75 -75
  42. package/src/_css/404.css +115 -115
  43. package/src/_css/App.css +37 -37
  44. package/src/_css/autoSuggestion.css +26 -26
  45. package/src/_css/circular-progress.css +32 -32
  46. package/src/_css/index.css +36 -36
  47. package/src/_css/modern.css +24 -24
  48. package/src/_media/corner.svg +8 -8
  49. package/src/_media/download.svg +3 -3
  50. package/src/_media/logo.svg +14 -14
  51. package/src/_test/App.test.js +15 -15
  52. package/src/_utils/reportWebVitals.js +13 -13
  53. package/src/core/appContext.js +27 -27
  54. package/src/core/components/Scatter.js +188 -188
  55. package/src/core/components/ScatterBio.js +572 -572
  56. package/src/core/components/VisiumPlot.js +165 -165
  57. package/src/core/components/browser.js +42 -42
  58. package/src/core/components/dotplot.js +413 -413
  59. package/src/core/components/html.js +29 -29
  60. package/src/core/components/list.js +178 -178
  61. package/src/core/components/macaron.js +201 -201
  62. package/src/core/components/markdown.js +56 -56
  63. package/src/core/components/parser.scatterBio.js +579 -587
  64. package/src/core/components/ratio.js +80 -80
  65. package/src/core/components/scatterL.js +173 -173
  66. package/src/core/components/searchbar.js +131 -131
  67. package/src/core/components/selection.js +193 -193
  68. package/src/core/components/timeline.js +281 -281
  69. package/src/core/components/visium.js +97 -97
  70. package/src/core/fetch/condfetch.js +82 -82
  71. package/src/core/fetch/fetch.js +92 -92
  72. package/src/core/fetch/json.js +29 -29
  73. package/src/core/fetch/vfetch.js +42 -42
  74. package/src/core/liveEditor.js +44 -44
  75. package/src/core/modules/codeEditorWithPreview.js +104 -104
  76. package/src/core/modules/echarts/common.js +20 -20
  77. package/src/core/modules/echarts/presetHandler.js +41 -41
  78. package/src/core/modules/echarts/presets/esodev.chromium.js +172 -172
  79. package/src/core/modules/echarts/presets/esodev.codex.js +130 -130
  80. package/src/core/modules/echarts/presets/esodev.visium.js +123 -123
  81. package/src/core/modules/echarts/presets/mmtrbc.js +186 -186
  82. package/src/core/modules/echarts.js +71 -71
  83. package/src/core/modules/echartsUtils.js +43 -43
  84. package/src/core/modules/echartswitcher.js +152 -152
  85. package/src/core/modules/replotly/presetHandler.js +24 -24
  86. package/src/core/modules/replotly/presets/minimum.js +18 -18
  87. package/src/core/modules/replotly/presets/mmtrbc.dot.js +114 -114
  88. package/src/core/modules/replotly/presets/mmtrbc.violin.js +100 -100
  89. package/src/core/modules/replotly.js +71 -71
  90. package/src/core/pages/404.js +50 -50
  91. package/src/core/pages/error.js +27 -27
  92. package/src/core/pages/jsonPage.js +62 -62
  93. package/src/core/pages/loading.js +44 -44
  94. package/src/core/parser/echart.data.js +183 -183
  95. package/src/core/parser/echart.features.js +125 -125
  96. package/src/core/parser/echart.general.js +143 -147
  97. package/src/core/parser/echart.hilbert.js +57 -57
  98. package/src/core/parser/echart.parser.js +210 -210
  99. package/src/core/parser/echart.series.js +67 -67
  100. package/src/core/parser/echart.types.js +76 -76
  101. package/src/core/parser/plotly.config.js +10 -10
  102. package/src/core/parser/plotly.data.js +132 -132
  103. package/src/core/parser/plotly.layout.js +9 -9
  104. package/src/core/parser/plotly.violin.js +18 -18
  105. package/src/core/recharts.js +62 -62
  106. package/src/core/router/alias.js +49 -49
  107. package/src/core/router/jsonRouter.js +31 -31
  108. package/src/core/themes/modern.js +32 -32
  109. package/src/core/themes/themeSelector.js +33 -33
  110. package/src/core/visualify.js +47 -47
  111. package/src/core/widgets/circularProgress.js +23 -23
  112. package/src/core/widgets/controller.js +83 -83
  113. package/src/core/widgets/errorBoundary.js +36 -36
  114. package/src/core/widgets/footer.js +177 -177
  115. package/src/core/widgets/header.js +234 -234
  116. package/src/core/widgets/layout/Grid.js +31 -31
  117. package/src/core/widgets/layout.js +36 -36
  118. package/src/core/widgets/mapping.js +42 -42
  119. package/src/index.js +62 -62
  120. package/src/setupTests.js +5 -5
  121. package/docs/docs/CLI.md +0 -34
  122. package/docs/docs/Rechart/scatter.md +0 -298
  123. package/docs/docs/log.md +0 -9
  124. package/docs/docs/static/logo/favicon.ico +0 -0
  125. package/docs/docs/static/logo/logo_128x128.png +0 -0
  126. package/docs/docs/static/logo/logo_192x192.png +0 -0
  127. package/docs/docs/static/logo/logo_256x256.png +0 -0
  128. package/docs/docs/static/logo/logo_512x512.png +0 -0
  129. package/docs/docs/static/logo/logo_64x64.png +0 -0
  130. package/docs/docs/theme.md +0 -5
  131. /package/docs/{docs/Rechart → Rechart}/geo.md +0 -0
  132. /package/docs/{docs/Rechart → Rechart}/liquidfill.md +0 -0
  133. /package/docs/{docs/Rechart → Rechart}/polar.md +0 -0
  134. /package/docs/{docs/Rechart → Rechart}/sankey.md +0 -0
  135. /package/docs/{docs/Rechart/sunburst.md → Rechart/scatter.md} +0 -0
  136. /package/docs/{docs/Rechart/tree.md → Rechart/sunburst.md} +0 -0
  137. /package/docs/{docs/Rechart/wordcloud.md → Rechart/tree.md} +0 -0
  138. /package/docs/{docs/components/markdown.md → Rechart/wordcloud.md} +0 -0
  139. /package/docs/{docs/static → static}/_images/deploy-github-pages.png +0 -0
@@ -1,125 +1,125 @@
1
- /*
2
- * @Author : Lihao leolihao@arizona.edu
3
- * @Date : 2023-12-03 13:01:48
4
- * @FilePath : /visualifyjs/src/core/parser/echart.features.js
5
- * @Description :
6
- * Copyright (c) 2023 by Lihao (leolihao@arizona.edu), All Rights Reserved.
7
- */
8
-
9
- export function _parsePeakvalley(options, seriesObject) {
10
- if (options.valley || options.peak) {
11
- seriesObject.markPoint = {};
12
- seriesObject.markPoint.data = [];
13
- if (options.peak) {
14
- seriesObject.markPoint.data.push({
15
- type: 'max',
16
- name: 'Max',
17
- label: {
18
- formatter:
19
- typeof options.peak === 'string' ? options.peak : 'Max',
20
- },
21
- });
22
- }
23
- if (options.valley) {
24
- seriesObject.markPoint.data.push({
25
- type: 'min',
26
- name: 'Min',
27
- label: {
28
- formatter:
29
- typeof options.valley === 'string'
30
- ? options.valley
31
- : 'Min',
32
- },
33
- });
34
- }
35
- }
36
- }
37
-
38
- export function _parseMarkArea(markAreaOption, seriesIndex) {
39
- const markAreaOptions = {};
40
-
41
- const formatAreaData = (option) => {
42
- let areas = [];
43
-
44
- const processAxis = (axisData, axisName) => {
45
- if (Array.isArray(axisData)) {
46
- axisData.forEach((data) =>
47
- areas.push([
48
- { [axisName]: data.start, name: data.name },
49
- { [axisName]: data.end },
50
- ]),
51
- );
52
- } else {
53
- areas.push([
54
- { [axisName]: axisData.start, name: axisData.name },
55
- { [axisName]: axisData.end },
56
- ]);
57
- }
58
- };
59
-
60
- if (option.xAxis) {
61
- processAxis(option.xAxis, 'xAxis');
62
- }
63
- if (option.yAxis) {
64
- processAxis(option.yAxis, 'yAxis');
65
- }
66
-
67
- return areas;
68
- };
69
-
70
- let areaData = [];
71
- let selectedOption =
72
- Array.isArray(markAreaOption) && seriesIndex < markAreaOption.length
73
- ? markAreaOption[seriesIndex]
74
- : markAreaOption;
75
-
76
- areaData = formatAreaData(selectedOption);
77
- markAreaOptions.data = areaData;
78
-
79
- // Add emphasis and other additional properties
80
- Object.keys(selectedOption).forEach((key) => {
81
- if (key === 'data') {
82
- markAreaOptions[key] = markAreaOptions[key].concat(
83
- selectedOption[key],
84
- );
85
- } else if (key !== 'xAxis' && key !== 'yAxis') {
86
- markAreaOptions[key] = selectedOption[key];
87
- }
88
- });
89
-
90
- return markAreaOptions;
91
- }
92
-
93
- export function _parseMarkLine(markLineOption, seriesIndex) {
94
- const markLineOptions = {};
95
-
96
- let selectedOption =
97
- Array.isArray(markLineOption) && seriesIndex < markLineOption.length
98
- ? markLineOption[seriesIndex]
99
- : markLineOption;
100
-
101
- markLineOptions.emphasis = {
102
- lineStyle: {
103
- width: 5,
104
- type: 'solid',
105
- },
106
- };
107
-
108
- markLineOptions.blur = {
109
- lineStyle: {
110
- opacity: 0.5, // Example blur style
111
- },
112
- };
113
-
114
- markLineOptions.lineStyle = {
115
- type: 'dashed', // 'solid','dashed'
116
- width: 3,
117
- };
118
-
119
- // Add additional properties from markLineOption
120
- Object.keys(selectedOption).forEach((key) => {
121
- markLineOptions[key] = selectedOption[key];
122
- });
123
-
124
- return markLineOptions;
125
- }
1
+ /*
2
+ * @Author : Lihao leolihao@arizona.edu
3
+ * @Date : 2023-12-03 13:01:48
4
+ * @FilePath : /visualifyjs/src/core/parser/echart.features.js
5
+ * @Description :
6
+ * Copyright (c) 2023 by Lihao (leolihao@arizona.edu), All Rights Reserved.
7
+ */
8
+
9
+ export function _parsePeakvalley(options, seriesObject) {
10
+ if (options.valley || options.peak) {
11
+ seriesObject.markPoint = {};
12
+ seriesObject.markPoint.data = [];
13
+ if (options.peak) {
14
+ seriesObject.markPoint.data.push({
15
+ type: 'max',
16
+ name: 'Max',
17
+ label: {
18
+ formatter:
19
+ typeof options.peak === 'string' ? options.peak : 'Max',
20
+ },
21
+ });
22
+ }
23
+ if (options.valley) {
24
+ seriesObject.markPoint.data.push({
25
+ type: 'min',
26
+ name: 'Min',
27
+ label: {
28
+ formatter:
29
+ typeof options.valley === 'string'
30
+ ? options.valley
31
+ : 'Min',
32
+ },
33
+ });
34
+ }
35
+ }
36
+ }
37
+
38
+ export function _parseMarkArea(markAreaOption, seriesIndex) {
39
+ const markAreaOptions = {};
40
+
41
+ const formatAreaData = (option) => {
42
+ let areas = [];
43
+
44
+ const processAxis = (axisData, axisName) => {
45
+ if (Array.isArray(axisData)) {
46
+ axisData.forEach((data) =>
47
+ areas.push([
48
+ { [axisName]: data.start, name: data.name },
49
+ { [axisName]: data.end },
50
+ ]),
51
+ );
52
+ } else {
53
+ areas.push([
54
+ { [axisName]: axisData.start, name: axisData.name },
55
+ { [axisName]: axisData.end },
56
+ ]);
57
+ }
58
+ };
59
+
60
+ if (option.xAxis) {
61
+ processAxis(option.xAxis, 'xAxis');
62
+ }
63
+ if (option.yAxis) {
64
+ processAxis(option.yAxis, 'yAxis');
65
+ }
66
+
67
+ return areas;
68
+ };
69
+
70
+ let areaData = [];
71
+ let selectedOption =
72
+ Array.isArray(markAreaOption) && seriesIndex < markAreaOption.length
73
+ ? markAreaOption[seriesIndex]
74
+ : markAreaOption;
75
+
76
+ areaData = formatAreaData(selectedOption);
77
+ markAreaOptions.data = areaData;
78
+
79
+ // Add emphasis and other additional properties
80
+ Object.keys(selectedOption).forEach((key) => {
81
+ if (key === 'data') {
82
+ markAreaOptions[key] = markAreaOptions[key].concat(
83
+ selectedOption[key],
84
+ );
85
+ } else if (key !== 'xAxis' && key !== 'yAxis') {
86
+ markAreaOptions[key] = selectedOption[key];
87
+ }
88
+ });
89
+
90
+ return markAreaOptions;
91
+ }
92
+
93
+ export function _parseMarkLine(markLineOption, seriesIndex) {
94
+ const markLineOptions = {};
95
+
96
+ let selectedOption =
97
+ Array.isArray(markLineOption) && seriesIndex < markLineOption.length
98
+ ? markLineOption[seriesIndex]
99
+ : markLineOption;
100
+
101
+ markLineOptions.emphasis = {
102
+ lineStyle: {
103
+ width: 5,
104
+ type: 'solid',
105
+ },
106
+ };
107
+
108
+ markLineOptions.blur = {
109
+ lineStyle: {
110
+ opacity: 0.5, // Example blur style
111
+ },
112
+ };
113
+
114
+ markLineOptions.lineStyle = {
115
+ type: 'dashed', // 'solid','dashed'
116
+ width: 3,
117
+ };
118
+
119
+ // Add additional properties from markLineOption
120
+ Object.keys(selectedOption).forEach((key) => {
121
+ markLineOptions[key] = selectedOption[key];
122
+ });
123
+
124
+ return markLineOptions;
125
+ }
@@ -1,147 +1,143 @@
1
- /*
2
- * @Author : Lihao leolihao@arizona.edu
3
- * @Date : 2023-12-02 11:56:41
4
- * @FilePath : /visualify.js/src/core/parser/echart.general.js
5
- * @Description :
6
- *
7
- * Copyright (c) 2023 by Lihao (leolihao@arizona.edu), All Rights Reserved.
8
- */
9
- import { handle_alltypes_chart } from './echart.types';
10
- import { getArrayEl } from './echart.series';
11
-
12
- const _parser_gereral = (options = {}, preset = {}) => {
13
- // Parse the custom options
14
- const parsedOptions = handle_alltypes_chart(getArrayEl(options.type), {
15
- ...preset,
16
- });
17
-
18
- // Parse the common options
19
- if ('title' in options) {
20
- if (typeof options.title === 'string')
21
- parsedOptions.title = {
22
- ...parsedOptions?.title,
23
- text: options.title,
24
- };
25
- else parsedOptions.title = options.title;
26
- }
27
-
28
- if ('subtitle' in options) parsedOptions.title.subtext = options.subtitle;
29
-
30
- if (options.legend === false) parsedOptions.legend = { show: false };
31
- else if ('legend' in options)
32
- parsedOptions.legend = { ...options.legend, ...options.legend };
33
-
34
- if ('xAxis' in options) {
35
- if (options.xAxis === false) parsedOptions.xAxis = { show: false };
36
- else if (Array.isArray(options.xAxis)) {
37
- parsedOptions.xAxis = {
38
- ...parsedOptions?.xAxis,
39
- data: options.xAxis,
40
- };
41
- } else {
42
- parsedOptions.xAxis = options.xAxis;
43
- }
44
- }
45
-
46
- if ('yAxis' in options) {
47
- if (options.yAxis === false) parsedOptions.yAxis = { show: false };
48
- else if (Array.isArray(options.yAxis))
49
- parsedOptions.yAxis = {
50
- ...parsedOptions?.yAxis,
51
- data: options.yAxis,
52
- };
53
- else parsedOptions.yAxis = options.yAxis;
54
- }
55
-
56
- if ('xAxisLabel' in options) {
57
- parsedOptions.xAxis = {
58
- ...parsedOptions?.xAxis,
59
- name: options.xAxisLabel,
60
- };
61
- }
62
-
63
- if ('yAxisLabel' in options) {
64
- parsedOptions.yAxis = {
65
- ...parsedOptions?.yAxis,
66
- name: options.yAxisLabel,
67
- };
68
- }
69
-
70
- if ('xAxisLineshow' in options) {
71
- parsedOptions.xAxis = {
72
- ...parsedOptions?.xAxis,
73
- axisLine: {
74
- ...parsedOptions.xAxis?.axisLine,
75
- show: options.xAxisLineshow,
76
- },
77
- };
78
- }
79
-
80
- if ('yAxisLineshow' in options) {
81
- parsedOptions.yAxis = {
82
- ...parsedOptions?.yAxis,
83
- axisLine: {
84
- ...parsedOptions.yAxis?.axisLine,
85
- show: options.yAxisLineshow,
86
- },
87
- };
88
- }
89
-
90
- if ('xAxisLabelShow' in options) {
91
- parsedOptions.xAxis = {
92
- ...parsedOptions?.xAxis,
93
- axisLabel: {
94
- ...parsedOptions.xAxis?.axisLabel,
95
- show: options.xAxisLabelShow,
96
- },
97
- };
98
- }
99
-
100
- if ('yAxisLabelShow' in options) {
101
- parsedOptions.yAxis = {
102
- ...parsedOptions.yAxis,
103
- axisLabel: {
104
- ...parsedOptions.yAxis?.axisLabel,
105
- show: options.yAxisLabelShow,
106
- },
107
- };
108
- }
109
-
110
- if ('xAxisLabelColor' in options) {
111
- parsedOptions.xAxis = {
112
- ...parsedOptions?.xAxis, // Copy existing xAxis properties
113
- axisLabel: {
114
- ...parsedOptions.xAxis?.axisLabel, // Copy existing axisLabel properties
115
- color: options.xAxisLabelColor,
116
- },
117
- };
118
- }
119
-
120
- if ('yAxisLabelColor' in options) {
121
- parsedOptions.yAxis = {
122
- ...parsedOptions?.yAxis, // Copy existing yAxis properties
123
- axisLabel: {
124
- ...parsedOptions.yAxis?.axisLabel, // Copy existing axisLabel properties
125
- color: options.yAxisLabelColor,
126
- },
127
- };
128
- }
129
-
130
- if ('tooltip' in options) {
131
- parsedOptions.tooltip = {
132
- ...parsedOptions?.tooltip,
133
- ...options.tooltip,
134
- };
135
- }
136
-
137
- if ('toolbox' in options) {
138
- parsedOptions.toolbox = {
139
- ...parsedOptions?.toolbox,
140
- ...options.toolbox,
141
- };
142
- }
143
-
144
- return parsedOptions;
145
- };
146
-
147
- export default _parser_gereral;
1
+ /*
2
+ * @Author : Lihao leolihao@arizona.edu
3
+ * @Date : 2023-12-02 11:56:41
4
+ * @FilePath : /visualifyjs/src/core/parser/echart.general.js
5
+ * @Description :
6
+ *
7
+ * Copyright (c) 2023 by Lihao (leolihao@arizona.edu), All Rights Reserved.
8
+ */
9
+ import { handle_alltypes_chart } from './echart.types';
10
+ import { getArrayEl } from './echart.series';
11
+
12
+ const _parser_gereral = (options = {}, preset = {}) => {
13
+ // Parse the custom options
14
+ const parsedOptions = handle_alltypes_chart(getArrayEl(options.type), {
15
+ ...preset,
16
+ });
17
+
18
+ // Parse the common options
19
+ if ('title' in options) {
20
+ if (typeof options.title === 'string')
21
+ parsedOptions.title = {
22
+ ...parsedOptions?.title,
23
+ text: options.title,
24
+ };
25
+ else parsedOptions.title = options.title;
26
+ }
27
+
28
+ if ('subtitle' in options) parsedOptions.title.subtext = options.subtitle;
29
+
30
+ if (options.legend === false) parsedOptions.legend = { show: false };
31
+ else if ('legend' in options)
32
+ parsedOptions.legend = { ...options.legend, ...options.legend };
33
+
34
+ if ('xAxis' in options) {
35
+ if (options.xAxis === false) parsedOptions.xAxis = { show: false };
36
+ else if (options.xAxis)
37
+ parsedOptions.xAxis = {
38
+ ...parsedOptions?.xAxis,
39
+ data: options.xAxis,
40
+ };
41
+ }
42
+
43
+ if ('yAxis' in options) {
44
+ if (options.yAxis === false) parsedOptions.yAxis = { show: false };
45
+ else if (Array.isArray(options.yAxis))
46
+ parsedOptions.yAxis = {
47
+ ...parsedOptions?.yAxis,
48
+ data: options.yAxis,
49
+ };
50
+ }
51
+
52
+ if ('xAxisLabel' in options) {
53
+ parsedOptions.xAxis = {
54
+ ...parsedOptions?.xAxis,
55
+ name: options.xAxisLabel,
56
+ };
57
+ }
58
+
59
+ if ('yAxisLabel' in options) {
60
+ parsedOptions.yAxis = {
61
+ ...parsedOptions?.yAxis,
62
+ name: options.yAxisLabel,
63
+ };
64
+ }
65
+
66
+ if ('xAxisLineshow' in options) {
67
+ parsedOptions.xAxis = {
68
+ ...parsedOptions?.xAxis,
69
+ axisLine: {
70
+ ...parsedOptions.xAxis?.axisLine,
71
+ show: options.xAxisLineshow,
72
+ },
73
+ };
74
+ }
75
+
76
+ if ('yAxisLineshow' in options) {
77
+ parsedOptions.yAxis = {
78
+ ...parsedOptions?.yAxis,
79
+ axisLine: {
80
+ ...parsedOptions.yAxis?.axisLine,
81
+ show: options.yAxisLineshow,
82
+ },
83
+ };
84
+ }
85
+
86
+ if ('xAxisLabelShow' in options) {
87
+ parsedOptions.xAxis = {
88
+ ...parsedOptions?.xAxis,
89
+ axisLabel: {
90
+ ...parsedOptions.xAxis?.axisLabel,
91
+ show: options.xAxisLabelShow,
92
+ },
93
+ };
94
+ }
95
+
96
+ if ('yAxisLabelShow' in options) {
97
+ parsedOptions.yAxis = {
98
+ ...parsedOptions.yAxis,
99
+ axisLabel: {
100
+ ...parsedOptions.yAxis?.axisLabel,
101
+ show: options.yAxisLabelShow,
102
+ },
103
+ };
104
+ }
105
+
106
+ if ('xAxisLabelColor' in options) {
107
+ parsedOptions.xAxis = {
108
+ ...parsedOptions?.xAxis, // Copy existing xAxis properties
109
+ axisLabel: {
110
+ ...parsedOptions.xAxis?.axisLabel, // Copy existing axisLabel properties
111
+ color: options.xAxisLabelColor,
112
+ },
113
+ };
114
+ }
115
+
116
+ if ('yAxisLabelColor' in options) {
117
+ parsedOptions.yAxis = {
118
+ ...parsedOptions?.yAxis, // Copy existing yAxis properties
119
+ axisLabel: {
120
+ ...parsedOptions.yAxis?.axisLabel, // Copy existing axisLabel properties
121
+ color: options.yAxisLabelColor,
122
+ },
123
+ };
124
+ }
125
+
126
+ if ('tooltip' in options) {
127
+ parsedOptions.tooltip = {
128
+ ...parsedOptions?.tooltip,
129
+ ...options.tooltip,
130
+ };
131
+ }
132
+
133
+ if ('toolbox' in options) {
134
+ parsedOptions.toolbox = {
135
+ ...parsedOptions?.toolbox,
136
+ ...options.toolbox,
137
+ };
138
+ }
139
+
140
+ return parsedOptions;
141
+ };
142
+
143
+ export default _parser_gereral;
@@ -1,57 +1,57 @@
1
- import hilbert from 'hilbert';
2
-
3
- const selectPointsForDownsampling = (
4
- points,
5
- hilbertValues,
6
- threshold = 1000,
7
- ) => {
8
- // Pair each point with its Hilbert value
9
- const pointsWithHilbert = points.map((point, index) => ({
10
- point,
11
- hilbert: hilbertValues[index],
12
- }));
13
-
14
- // Sort by Hilbert value
15
- pointsWithHilbert.sort((a, b) => a.hilbert - b.hilbert);
16
-
17
- // Calculate the step size to achieve the target number of points
18
- const step = Math.ceil(points.length / threshold);
19
-
20
- // Select a subset of points
21
- const downsampled = [];
22
- for (let i = 0; i < points.length; i += step) {
23
- downsampled.push(pointsWithHilbert[i].point);
24
- }
25
-
26
- return downsampled;
27
- };
28
-
29
- const calculateHilbertValue = (point, order = 16) => {
30
- // Create a Hilbert curve instance
31
- const hilbertInstance = new hilbert.Hilbert2d(); // Replace with the actual class name if different
32
- return hilbertInstance.xy2d(point.x, point.y, order);
33
- };
34
-
35
- const downsampleSeries = (series, hilbertSettings) => {
36
- const { order = 16, threshold } = hilbertSettings;
37
-
38
- const downsampledSeries = series.map((data) => {
39
- const hilbertValues = data.data.map((point) =>
40
- calculateHilbertValue(point, order),
41
- );
42
- const downsampledData = selectPointsForDownsampling(
43
- data.data,
44
- hilbertValues,
45
- threshold,
46
- );
47
-
48
- return {
49
- ...data,
50
- data: downsampledData,
51
- };
52
- });
53
-
54
- return downsampledSeries;
55
- };
56
-
57
- export default downsampleSeries;
1
+ import hilbert from 'hilbert';
2
+
3
+ const selectPointsForDownsampling = (
4
+ points,
5
+ hilbertValues,
6
+ threshold = 1000,
7
+ ) => {
8
+ // Pair each point with its Hilbert value
9
+ const pointsWithHilbert = points.map((point, index) => ({
10
+ point,
11
+ hilbert: hilbertValues[index],
12
+ }));
13
+
14
+ // Sort by Hilbert value
15
+ pointsWithHilbert.sort((a, b) => a.hilbert - b.hilbert);
16
+
17
+ // Calculate the step size to achieve the target number of points
18
+ const step = Math.ceil(points.length / threshold);
19
+
20
+ // Select a subset of points
21
+ const downsampled = [];
22
+ for (let i = 0; i < points.length; i += step) {
23
+ downsampled.push(pointsWithHilbert[i].point);
24
+ }
25
+
26
+ return downsampled;
27
+ };
28
+
29
+ const calculateHilbertValue = (point, order = 16) => {
30
+ // Create a Hilbert curve instance
31
+ const hilbertInstance = new hilbert.Hilbert2d(); // Replace with the actual class name if different
32
+ return hilbertInstance.xy2d(point.x, point.y, order);
33
+ };
34
+
35
+ const downsampleSeries = (series, hilbertSettings) => {
36
+ const { order = 16, threshold } = hilbertSettings;
37
+
38
+ const downsampledSeries = series.map((data) => {
39
+ const hilbertValues = data.data.map((point) =>
40
+ calculateHilbertValue(point, order),
41
+ );
42
+ const downsampledData = selectPointsForDownsampling(
43
+ data.data,
44
+ hilbertValues,
45
+ threshold,
46
+ );
47
+
48
+ return {
49
+ ...data,
50
+ data: downsampledData,
51
+ };
52
+ });
53
+
54
+ return downsampledSeries;
55
+ };
56
+
57
+ export default downsampleSeries;