@rfkit/charts 1.1.4 → 1.1.5

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.
package/index.js CHANGED
@@ -4,6 +4,449 @@ import * as __WEBPACK_EXTERNAL_MODULE__rfkit_theme_a11ca9cb__ from "@rfkit/theme
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__ from "react-dom";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__rfkit_spectrum_analyzer_159ab12b__ from "@rfkit/spectrum-analyzer";
6
6
  var __webpack_modules__ = {
7
+ "./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
+ __webpack_require__.d(__webpack_exports__, {
9
+ Ax: ()=>leftSegments2frequency,
10
+ B5: ()=>getRowCol,
11
+ Bp: ()=>isdBm,
12
+ Fc: ()=>getDateTime,
13
+ IS: ()=>generateFrequencySegments,
14
+ P2: ()=>throttle1,
15
+ P9: ()=>convertToTimestampedArrays,
16
+ PM: ()=>mergeObjects,
17
+ Ri: ()=>isNumberAlias,
18
+ SF: ()=>createGUID,
19
+ f1: ()=>leftSegmentsFindStep,
20
+ g9: ()=>throttleTimer,
21
+ kL: ()=>getDimInfo,
22
+ lj: ()=>getFrequencyToFixed,
23
+ or: ()=>leftPoints2frequency,
24
+ r2: ()=>scopeLeftSegments2bandwidth,
25
+ sl: ()=>generateGreatSegments,
26
+ vY: ()=>getThemeFillStyle,
27
+ wF: ()=>getMidIndex
28
+ });
29
+ const createGUID = ()=>((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
30
+ const getDateTime = (t = Date.now(), sep1 = '-', sep2 = ':', time = false)=>{
31
+ if (!t) return '';
32
+ let timestamp;
33
+ if (t instanceof Date) timestamp = t.getTime();
34
+ else {
35
+ if ('number' != typeof t) return '';
36
+ timestamp = t;
37
+ if (10 === timestamp.toString().length) timestamp *= 1000;
38
+ }
39
+ const date = new Date(timestamp);
40
+ if (Number.isNaN(date.getTime())) return '';
41
+ const year = date.getFullYear();
42
+ const month = String(date.getMonth() + 1).padStart(2, '0');
43
+ const day = String(date.getDate()).padStart(2, '0');
44
+ const hours = String(date.getHours()).padStart(2, '0');
45
+ const minutes = String(date.getMinutes()).padStart(2, '0');
46
+ const seconds = String(date.getSeconds()).padStart(2, '0');
47
+ const timeStr = `${hours}${sep2}${minutes}${sep2}${seconds}`;
48
+ if (time) return timeStr;
49
+ const dateStr = `${year}${sep1}${month}${sep1}${day}`;
50
+ return `${dateStr} ${timeStr}`;
51
+ };
52
+ function throttle1(func = ()=>{}, wait = 1000 / 30) {
53
+ let prev = 0;
54
+ return (...arg)=>{
55
+ const now = Date.now();
56
+ const timeSinceLastCall = now - prev;
57
+ if (timeSinceLastCall >= wait) {
58
+ func(...arg);
59
+ prev = now;
60
+ }
61
+ };
62
+ }
63
+ function throttleRequestAnimationFrame(func = ()=>{}) {
64
+ let scheduled = false;
65
+ return (e)=>{
66
+ if (!scheduled) {
67
+ scheduled = true;
68
+ requestAnimationFrame(()=>{
69
+ func(e);
70
+ scheduled = false;
71
+ });
72
+ }
73
+ };
74
+ }
75
+ function throttleTimer(func = ()=>{}, wait) {
76
+ let timer = null;
77
+ return (e)=>{
78
+ clearTimeout(timer);
79
+ timer = setTimeout(()=>{
80
+ func(e);
81
+ }, wait || 100);
82
+ };
83
+ }
84
+ const leftSegments2frequency = (segments)=>{
85
+ if (!segments?.length) return ()=>'';
86
+ const { totalPoints } = segments;
87
+ const segmentInfo = segments.map((segment, index)=>{
88
+ const { point, frequencyCache } = segment;
89
+ const ll = 100 * point / totalPoints;
90
+ return {
91
+ ll,
92
+ frequencyCache,
93
+ startLeft: 0 === index ? 0 : segments.slice(0, index).reduce((sum, s)=>sum + 100 * s.point / totalPoints, 0)
94
+ };
95
+ });
96
+ return (left)=>{
97
+ if (left <= 0) return String(segments[0]?.start);
98
+ if (left >= 100) return String(segments[segments.length - 1]?.stop);
99
+ let low = 0;
100
+ let high = segmentInfo.length - 1;
101
+ while(low <= high){
102
+ const mid = low + high >>> 1;
103
+ const { startLeft, ll } = segmentInfo[mid];
104
+ if (left >= startLeft && left < startLeft + ll) {
105
+ const { frequencyCache } = segmentInfo[mid];
106
+ const relativeLeft = left - startLeft;
107
+ const ratio = relativeLeft / ll;
108
+ const index = Math.min(Math.ceil(ratio * frequencyCache.length) - 1, frequencyCache.length - 1);
109
+ return frequencyCache[index]?.frequency ?? '';
110
+ }
111
+ if (left < startLeft) high = mid - 1;
112
+ else low = mid + 1;
113
+ }
114
+ return '';
115
+ };
116
+ };
117
+ const leftSegmentsFindStep = (segments)=>(left)=>{
118
+ if (!segments || 0 === left || 100 === left) return 0;
119
+ const { totalPoints } = segments;
120
+ let l = left;
121
+ for(let i = 0; i < segments.length; i += 1){
122
+ const { point } = segments[i];
123
+ const ll = 100 * point / totalPoints;
124
+ if (l - ll <= 0) return ll / point;
125
+ l -= ll;
126
+ }
127
+ return 0;
128
+ };
129
+ function leftPoints2frequency(points) {
130
+ const len = points.length;
131
+ return (left)=>{
132
+ if (0 === len) return;
133
+ let index = Math.ceil(left * len / 100) - 1;
134
+ if (-1 === index) index = 0;
135
+ return points[index];
136
+ };
137
+ }
138
+ const scopeLeftSegments2bandwidth = (e)=>{
139
+ if (!e) return 0;
140
+ const { segments } = e;
141
+ if (!segments) return 0;
142
+ const { totalPoints } = segments;
143
+ let { endLeft, startLeft } = e;
144
+ const diff = endLeft - startLeft;
145
+ const diffabs = Math.abs(diff);
146
+ if (diff < 0) {
147
+ startLeft = e.endLeft;
148
+ endLeft = e.startLeft;
149
+ }
150
+ let width = 0;
151
+ let startTag = false;
152
+ for(let i = 0; i < segments.length; i += 1){
153
+ const { step, start, stop, point } = segments[i];
154
+ const ll = 100 * point / totalPoints;
155
+ const quark = step / 1000;
156
+ const haveStart = startLeft - ll <= 0;
157
+ const haveEnd = endLeft - ll <= 0;
158
+ if (!startTag && haveStart && haveEnd) return Math.round(diffabs / ll * point) * quark;
159
+ if (haveStart && !startTag) {
160
+ startTag = true;
161
+ width += Math.round((1 - startLeft / ll) * point) * quark;
162
+ }
163
+ if (haveEnd) {
164
+ width += Math.round(endLeft / ll * point) * quark;
165
+ return width;
166
+ }
167
+ if (startLeft < 0 && !haveEnd) width += stop - start;
168
+ startLeft -= ll;
169
+ endLeft -= ll;
170
+ }
171
+ return 0;
172
+ };
173
+ function isdBm(unit) {
174
+ return unit?.slice(0, 3) === 'dBm';
175
+ }
176
+ function arrayFindMax(arr) {
177
+ if (!arr?.length) return {};
178
+ let max = Number.NEGATIVE_INFINITY;
179
+ let maxIndex = 0;
180
+ for(let i = 0; i < arr.length; i += 1){
181
+ const item = arr[i];
182
+ if (item > max) {
183
+ max = item;
184
+ maxIndex = i;
185
+ }
186
+ }
187
+ return {
188
+ max,
189
+ maxIndex
190
+ };
191
+ }
192
+ function arrayFindMin(arr) {
193
+ if (!arr?.length) return 0;
194
+ let min = Number.POSITIVE_INFINITY;
195
+ let minIndex = 0;
196
+ for(let i = 0; i < arr.length; i += 1){
197
+ const item = arr[i];
198
+ if (item < min) {
199
+ min = item;
200
+ minIndex = i;
201
+ }
202
+ }
203
+ return {
204
+ min,
205
+ minIndex
206
+ };
207
+ }
208
+ const setTotalPoints = (segments, totalPoints)=>{
209
+ Object.defineProperty(segments, 'totalPoints', {
210
+ value: totalPoints,
211
+ enumerable: false,
212
+ configurable: true
213
+ });
214
+ return segments;
215
+ };
216
+ const generateFrequencyCache = (config)=>{
217
+ const { totalPoints, startFrequency, stopFrequency, index = 0 } = config;
218
+ const segmentWidth = stopFrequency - startFrequency;
219
+ if (1 === totalPoints) return [
220
+ {
221
+ frequency: getFrequencyToFixed(startFrequency),
222
+ startLeft: 100 * index / totalPoints,
223
+ endLeft: (index + 1) * 100 / totalPoints
224
+ }
225
+ ];
226
+ return new Array(totalPoints).fill(0).map((_, i)=>{
227
+ const progress = i / (totalPoints - 1);
228
+ const freq = startFrequency + progress * segmentWidth;
229
+ return {
230
+ frequency: getFrequencyToFixed(freq),
231
+ startLeft: (index + i) * 100 / totalPoints,
232
+ endLeft: (index + i + 1) * 100 / totalPoints
233
+ };
234
+ });
235
+ };
236
+ const generateFrequencySegments = (e)=>{
237
+ const { frequency, bandwidth, totalPoints } = e;
238
+ const linearStart = frequency - bandwidth / 2000;
239
+ const linearStop = frequency + bandwidth / 2000;
240
+ if (linearStart <= 0 || linearStop <= 0) return [];
241
+ const frequencyCache = generateFrequencyCache({
242
+ totalPoints,
243
+ startFrequency: linearStart,
244
+ stopFrequency: linearStop,
245
+ stepFrequency: bandwidth / totalPoints
246
+ });
247
+ const segments = [
248
+ {
249
+ frequency,
250
+ bandwidth,
251
+ step: linearStop - linearStart,
252
+ start: linearStart,
253
+ stop: linearStop,
254
+ index: 0,
255
+ label: '',
256
+ point: totalPoints,
257
+ percentage: 1,
258
+ progress: [
259
+ 0,
260
+ 100
261
+ ],
262
+ frequencyCache
263
+ }
264
+ ];
265
+ return setTotalPoints(segments, totalPoints);
266
+ };
267
+ const generateGreatSegments = (prevSegments)=>{
268
+ if (!prevSegments?.length) return [];
269
+ const totalPoints = prevSegments.reduce((sum, { startFrequency, stopFrequency, stepFrequency })=>sum + Math.round((stopFrequency - startFrequency) * 1000 / stepFrequency) + 1, 0);
270
+ let cumulativePoints = 0;
271
+ const segments = prevSegments.map(({ startFrequency, stopFrequency, stepFrequency, label })=>{
272
+ const point = Math.round((stopFrequency - startFrequency) * 1000 / stepFrequency) + 1;
273
+ const index = cumulativePoints;
274
+ const frequencyCache = generateFrequencyCache({
275
+ totalPoints: point,
276
+ startFrequency,
277
+ stopFrequency,
278
+ stepFrequency,
279
+ index
280
+ });
281
+ cumulativePoints += point;
282
+ return {
283
+ start: startFrequency,
284
+ stop: stopFrequency,
285
+ step: stepFrequency,
286
+ index,
287
+ label,
288
+ point,
289
+ percentage: point / totalPoints,
290
+ progress: [
291
+ 100 * index / totalPoints,
292
+ 100 * cumulativePoints / totalPoints
293
+ ],
294
+ frequencyCache
295
+ };
296
+ });
297
+ return setTotalPoints(segments, totalPoints);
298
+ };
299
+ function getDimInfo(d) {
300
+ if (!d) return {};
301
+ const valid = d.filter((f)=>isNumberAlias(f));
302
+ if (!valid?.length) return {};
303
+ const avg = eval(valid.join('+')) / valid.length;
304
+ const { min, minIndex } = arrayFindMin(valid);
305
+ const { max, maxIndex } = arrayFindMax(valid);
306
+ return {
307
+ min,
308
+ minIndex,
309
+ max,
310
+ maxIndex,
311
+ avg
312
+ };
313
+ }
314
+ const isNumberAlias = (n)=>Number.isFinite(+n);
315
+ const arrayKeepAttribute = (source, target)=>{
316
+ if (void 0 !== source.max) target.max = source.max;
317
+ if (void 0 !== source.maxIndex) target.maxIndex = source.maxIndex;
318
+ if (void 0 !== source.timestamp) target.timestamp = source.timestamp;
319
+ if (void 0 !== source.progress) target.progress = source.progress;
320
+ };
321
+ const weakenArray = (data, interval, factor)=>{
322
+ if (interval <= 0 || data.length <= interval) {
323
+ const result = Array.from({
324
+ length: data.length
325
+ }, (_, index)=>{
326
+ const value = data[index] + (factor?.[index] ?? 0);
327
+ return 0 === value ? 0 : value || void 0;
328
+ });
329
+ arrayKeepAttribute(data, result);
330
+ return result;
331
+ }
332
+ const ratio = data.length / interval;
333
+ const result = new Array(interval);
334
+ arrayKeepAttribute(data, result);
335
+ const step = ratio;
336
+ let currentIndex = ratio / 2;
337
+ const dataLength = data.length;
338
+ for(let i = 0; i < interval; i++){
339
+ const start = Math.floor(currentIndex);
340
+ const end = Math.min(Math.floor(currentIndex + step), dataLength);
341
+ let max = data[start];
342
+ for(let j = start + 1; j < end; j++)if (data[j] > max) max = data[j];
343
+ const value = factor ? max + (factor[start] ?? 0) : max;
344
+ result[i] = 0 === value ? 0 : value || void 0;
345
+ currentIndex += step;
346
+ }
347
+ return result;
348
+ };
349
+ const getRowCol = (unknownArray)=>{
350
+ const row = unknownArray.length;
351
+ const col = Math.max(...unknownArray.map((r)=>r?.length));
352
+ return {
353
+ row,
354
+ col
355
+ };
356
+ };
357
+ function expandArray(arr) {
358
+ const expandedArray = [];
359
+ for(let i = 0; i < arr.length - 1; i += 1){
360
+ const current = arr[i];
361
+ const next = arr[i + 1];
362
+ const step = (next - current) / 10;
363
+ expandedArray.push(current);
364
+ for(let j = 1; j <= 9; j += 1){
365
+ const newValue = current + step * j;
366
+ expandedArray.push(newValue);
367
+ }
368
+ }
369
+ expandedArray.push(arr[arr.length - 1]);
370
+ return expandedArray;
371
+ }
372
+ function getThemeFillStyle() {
373
+ const computedStyles = getComputedStyle(document.documentElement);
374
+ const themeColorBase = computedStyles.getPropertyValue('--theme-color-base').trim();
375
+ const themeColorPrimary = computedStyles.getPropertyValue('--theme-color-primary').trim();
376
+ const fillStyle = `${themeColorBase}B0`;
377
+ const fillStylePrimary = themeColorPrimary;
378
+ const fillStyleTransparentBase = `${themeColorBase}10`;
379
+ return {
380
+ fillStyle,
381
+ fillStylePrimary,
382
+ fillStyleTransparentBase
383
+ };
384
+ }
385
+ const mergeObjects = (e, params)=>{
386
+ const p = e;
387
+ Object.keys(p).forEach((k)=>{
388
+ if ('[object Object]' === Object.prototype.toString.call(params[k])) p[k] = {
389
+ ...p[k],
390
+ ...params[k]
391
+ };
392
+ else if (void 0 !== params[k]) p[k] = params[k];
393
+ });
394
+ return p;
395
+ };
396
+ function getMidIndex(indexStart, indexEnd) {
397
+ if (indexStart < 0 || indexEnd < 0 || indexStart > indexEnd) throw new Error('Invalid index range');
398
+ return indexStart + Math.floor((indexEnd - indexStart) / 2);
399
+ }
400
+ const getFrequencyToFixed = (frequency, fixedNum = 6)=>{
401
+ if (!frequency && 0 !== frequency) return '';
402
+ const fixed = Number.parseFloat(frequency.toFixed(fixedNum));
403
+ return Number.isFinite(fixed) ? String(fixed) : '';
404
+ };
405
+ const createChartRenderID = ({ moduleType, globalID })=>{
406
+ if (moduleType && globalID) return `${moduleType}-${globalID}`;
407
+ return createGUID();
408
+ };
409
+ const convertToTimestampedArrays = (data, timestamps)=>{
410
+ if (!data || !Array.isArray(data)) return [];
411
+ return Array.from({
412
+ length: data.length
413
+ }, (_, i)=>{
414
+ const d = data[i];
415
+ const frame = new Float32Array(d.length);
416
+ frame.set(d);
417
+ frame.timestamp = timestamps[i];
418
+ return frame;
419
+ });
420
+ };
421
+ const debounce = (fn, delay = 1000 / 30)=>{
422
+ let timer = null;
423
+ const debouncedFunction = (...args)=>{
424
+ if (timer) clearTimeout(timer);
425
+ timer = setTimeout(()=>{
426
+ fn(...args);
427
+ }, delay);
428
+ };
429
+ debouncedFunction.cancel = ()=>{
430
+ if (timer) {
431
+ clearTimeout(timer);
432
+ timer = null;
433
+ }
434
+ };
435
+ return debouncedFunction;
436
+ };
437
+ function debounceRequestAnimationFrame(func = ()=>{}) {
438
+ let scheduled = false;
439
+ return (...args)=>{
440
+ if (!scheduled) {
441
+ scheduled = true;
442
+ requestAnimationFrame(()=>{
443
+ func(...args);
444
+ scheduled = false;
445
+ });
446
+ }
447
+ };
448
+ }
449
+ },
7
450
  "../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisX/styles.module.less": function(module, __webpack_exports__, __webpack_require__) {
8
451
  __webpack_require__.d(__webpack_exports__, {
9
452
  Z: ()=>__WEBPACK_DEFAULT_EXPORT__
@@ -3221,6 +3664,16 @@ function __webpack_require__(moduleId) {
3221
3664
  (()=>{
3222
3665
  __webpack_require__.nc = void 0;
3223
3666
  })();
3667
+ const STORAGE_KEY = 'rfkit-charts-frequency-allocation';
3668
+ const getFrequencyAllocationFromCache = ()=>{
3669
+ const cached = localStorage.getItem(STORAGE_KEY);
3670
+ if (!cached) return null;
3671
+ const data = JSON.parse(cached);
3672
+ return Array.isArray(data) ? data : null;
3673
+ };
3674
+ const setFrequencyAllocationToCache = (data)=>{
3675
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
3676
+ };
3224
3677
  const KEY = 'DCHARTS_CONFIG';
3225
3678
  const defaultConfig = {
3226
3679
  line: {
@@ -3621,334 +4074,7 @@ function withChartPublisher(ChartComponent, componentName) {
3621
4074
  ChartWrapper.displayName = `withChartPublisher(${componentName})`;
3622
4075
  return ChartWrapper;
3623
4076
  }
3624
- const createGUID = ()=>((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
3625
- const getDateTime = (t = Date.now(), sep1 = '-', sep2 = ':', time = false)=>{
3626
- if (!t) return '';
3627
- let timestamp;
3628
- if (t instanceof Date) timestamp = t.getTime();
3629
- else {
3630
- if ('number' != typeof t) return '';
3631
- timestamp = t;
3632
- if (10 === timestamp.toString().length) timestamp *= 1000;
3633
- }
3634
- const date = new Date(timestamp);
3635
- if (Number.isNaN(date.getTime())) return '';
3636
- const year = date.getFullYear();
3637
- const month = String(date.getMonth() + 1).padStart(2, '0');
3638
- const day = String(date.getDate()).padStart(2, '0');
3639
- const hours = String(date.getHours()).padStart(2, '0');
3640
- const minutes = String(date.getMinutes()).padStart(2, '0');
3641
- const seconds = String(date.getSeconds()).padStart(2, '0');
3642
- const timeStr = `${hours}${sep2}${minutes}${sep2}${seconds}`;
3643
- if (time) return timeStr;
3644
- const dateStr = `${year}${sep1}${month}${sep1}${day}`;
3645
- return `${dateStr} ${timeStr}`;
3646
- };
3647
- function utils_throttle(func = ()=>{}, wait = 1000 / 30) {
3648
- let prev = 0;
3649
- return (...arg)=>{
3650
- const now = Date.now();
3651
- const timeSinceLastCall = now - prev;
3652
- if (timeSinceLastCall >= wait) {
3653
- func(...arg);
3654
- prev = now;
3655
- }
3656
- };
3657
- }
3658
- function throttleTimer(func = ()=>{}, wait) {
3659
- let timer = null;
3660
- return (e)=>{
3661
- clearTimeout(timer);
3662
- timer = setTimeout(()=>{
3663
- func(e);
3664
- }, wait || 100);
3665
- };
3666
- }
3667
- const leftSegments2frequency = (segments)=>{
3668
- if (!segments?.length) return ()=>'';
3669
- const { totalPoints } = segments;
3670
- const segmentInfo = segments.map((segment, index)=>{
3671
- const { point, frequencyCache } = segment;
3672
- const ll = 100 * point / totalPoints;
3673
- return {
3674
- ll,
3675
- frequencyCache,
3676
- startLeft: 0 === index ? 0 : segments.slice(0, index).reduce((sum, s)=>sum + 100 * s.point / totalPoints, 0)
3677
- };
3678
- });
3679
- return (left)=>{
3680
- if (left <= 0) return String(segments[0]?.start);
3681
- if (left >= 100) return String(segments[segments.length - 1]?.stop);
3682
- let low = 0;
3683
- let high = segmentInfo.length - 1;
3684
- while(low <= high){
3685
- const mid = low + high >>> 1;
3686
- const { startLeft, ll } = segmentInfo[mid];
3687
- if (left >= startLeft && left < startLeft + ll) {
3688
- const { frequencyCache } = segmentInfo[mid];
3689
- const relativeLeft = left - startLeft;
3690
- const ratio = relativeLeft / ll;
3691
- const index = Math.min(Math.ceil(ratio * frequencyCache.length) - 1, frequencyCache.length - 1);
3692
- return frequencyCache[index]?.frequency ?? '';
3693
- }
3694
- if (left < startLeft) high = mid - 1;
3695
- else low = mid + 1;
3696
- }
3697
- return '';
3698
- };
3699
- };
3700
- const leftSegmentsFindStep = (segments)=>(left)=>{
3701
- if (!segments || 0 === left || 100 === left) return 0;
3702
- const { totalPoints } = segments;
3703
- let l = left;
3704
- for(let i = 0; i < segments.length; i += 1){
3705
- const { point } = segments[i];
3706
- const ll = 100 * point / totalPoints;
3707
- if (l - ll <= 0) return ll / point;
3708
- l -= ll;
3709
- }
3710
- return 0;
3711
- };
3712
- function leftPoints2frequency(points) {
3713
- const len = points.length;
3714
- return (left)=>{
3715
- if (0 === len) return;
3716
- let index = Math.ceil(left * len / 100) - 1;
3717
- if (-1 === index) index = 0;
3718
- return points[index];
3719
- };
3720
- }
3721
- const scopeLeftSegments2bandwidth = (e)=>{
3722
- if (!e) return 0;
3723
- const { segments } = e;
3724
- if (!segments) return 0;
3725
- const { totalPoints } = segments;
3726
- let { endLeft, startLeft } = e;
3727
- const diff = endLeft - startLeft;
3728
- const diffabs = Math.abs(diff);
3729
- if (diff < 0) {
3730
- startLeft = e.endLeft;
3731
- endLeft = e.startLeft;
3732
- }
3733
- let width = 0;
3734
- let startTag = false;
3735
- for(let i = 0; i < segments.length; i += 1){
3736
- const { step, start, stop, point } = segments[i];
3737
- const ll = 100 * point / totalPoints;
3738
- const quark = step / 1000;
3739
- const haveStart = startLeft - ll <= 0;
3740
- const haveEnd = endLeft - ll <= 0;
3741
- if (!startTag && haveStart && haveEnd) return Math.round(diffabs / ll * point) * quark;
3742
- if (haveStart && !startTag) {
3743
- startTag = true;
3744
- width += Math.round((1 - startLeft / ll) * point) * quark;
3745
- }
3746
- if (haveEnd) {
3747
- width += Math.round(endLeft / ll * point) * quark;
3748
- return width;
3749
- }
3750
- if (startLeft < 0 && !haveEnd) width += stop - start;
3751
- startLeft -= ll;
3752
- endLeft -= ll;
3753
- }
3754
- return 0;
3755
- };
3756
- function isdBm(unit) {
3757
- return unit?.slice(0, 3) === 'dBm';
3758
- }
3759
- function arrayFindMax(arr) {
3760
- if (!arr?.length) return {};
3761
- let max = Number.NEGATIVE_INFINITY;
3762
- let maxIndex = 0;
3763
- for(let i = 0; i < arr.length; i += 1){
3764
- const item = arr[i];
3765
- if (item > max) {
3766
- max = item;
3767
- maxIndex = i;
3768
- }
3769
- }
3770
- return {
3771
- max,
3772
- maxIndex
3773
- };
3774
- }
3775
- function arrayFindMin(arr) {
3776
- if (!arr?.length) return 0;
3777
- let min = Number.POSITIVE_INFINITY;
3778
- let minIndex = 0;
3779
- for(let i = 0; i < arr.length; i += 1){
3780
- const item = arr[i];
3781
- if (item < min) {
3782
- min = item;
3783
- minIndex = i;
3784
- }
3785
- }
3786
- return {
3787
- min,
3788
- minIndex
3789
- };
3790
- }
3791
- const setTotalPoints = (segments, totalPoints)=>{
3792
- Object.defineProperty(segments, 'totalPoints', {
3793
- value: totalPoints,
3794
- enumerable: false,
3795
- configurable: true
3796
- });
3797
- return segments;
3798
- };
3799
- const generateFrequencyCache = (config)=>{
3800
- const { totalPoints, startFrequency, stopFrequency, index = 0 } = config;
3801
- const segmentWidth = stopFrequency - startFrequency;
3802
- if (1 === totalPoints) return [
3803
- {
3804
- frequency: getFrequencyToFixed(startFrequency),
3805
- startLeft: 100 * index / totalPoints,
3806
- endLeft: (index + 1) * 100 / totalPoints
3807
- }
3808
- ];
3809
- return new Array(totalPoints).fill(0).map((_, i)=>{
3810
- const progress = i / (totalPoints - 1);
3811
- const freq = startFrequency + progress * segmentWidth;
3812
- return {
3813
- frequency: getFrequencyToFixed(freq),
3814
- startLeft: (index + i) * 100 / totalPoints,
3815
- endLeft: (index + i + 1) * 100 / totalPoints
3816
- };
3817
- });
3818
- };
3819
- const generateFrequencySegments = (e)=>{
3820
- const { frequency, bandwidth, totalPoints } = e;
3821
- const linearStart = frequency - bandwidth / 2000;
3822
- const linearStop = frequency + bandwidth / 2000;
3823
- if (linearStart <= 0 || linearStop <= 0) return [];
3824
- const frequencyCache = generateFrequencyCache({
3825
- totalPoints,
3826
- startFrequency: linearStart,
3827
- stopFrequency: linearStop,
3828
- stepFrequency: bandwidth / totalPoints
3829
- });
3830
- const segments = [
3831
- {
3832
- frequency,
3833
- bandwidth,
3834
- step: linearStop - linearStart,
3835
- start: linearStart,
3836
- stop: linearStop,
3837
- index: 0,
3838
- label: '',
3839
- point: totalPoints,
3840
- percentage: 1,
3841
- progress: [
3842
- 0,
3843
- 100
3844
- ],
3845
- frequencyCache
3846
- }
3847
- ];
3848
- return setTotalPoints(segments, totalPoints);
3849
- };
3850
- const generateGreatSegments = (prevSegments)=>{
3851
- if (!prevSegments?.length) return [];
3852
- const totalPoints = prevSegments.reduce((sum, { startFrequency, stopFrequency, stepFrequency })=>sum + Math.round((stopFrequency - startFrequency) * 1000 / stepFrequency) + 1, 0);
3853
- let cumulativePoints = 0;
3854
- const segments = prevSegments.map(({ startFrequency, stopFrequency, stepFrequency, label })=>{
3855
- const point = Math.round((stopFrequency - startFrequency) * 1000 / stepFrequency) + 1;
3856
- const index = cumulativePoints;
3857
- const frequencyCache = generateFrequencyCache({
3858
- totalPoints: point,
3859
- startFrequency,
3860
- stopFrequency,
3861
- stepFrequency,
3862
- index
3863
- });
3864
- cumulativePoints += point;
3865
- return {
3866
- start: startFrequency,
3867
- stop: stopFrequency,
3868
- step: stepFrequency,
3869
- index,
3870
- label,
3871
- point,
3872
- percentage: point / totalPoints,
3873
- progress: [
3874
- 100 * index / totalPoints,
3875
- 100 * cumulativePoints / totalPoints
3876
- ],
3877
- frequencyCache
3878
- };
3879
- });
3880
- return setTotalPoints(segments, totalPoints);
3881
- };
3882
- function getDimInfo(d) {
3883
- if (!d) return {};
3884
- const valid = d.filter((f)=>isNumberAlias(f));
3885
- if (!valid?.length) return {};
3886
- const eval2 = eval;
3887
- const avg = eval2(valid.join('+')) / valid.length;
3888
- const { min, minIndex } = arrayFindMin(valid);
3889
- const { max, maxIndex } = arrayFindMax(valid);
3890
- return {
3891
- min,
3892
- minIndex,
3893
- max,
3894
- maxIndex,
3895
- avg
3896
- };
3897
- }
3898
- const isNumberAlias = (n)=>Number.isFinite(+n);
3899
- const getRowCol = (unknownArray)=>{
3900
- const row = unknownArray.length;
3901
- const col = Math.max(...unknownArray.map((r)=>r?.length));
3902
- return {
3903
- row,
3904
- col
3905
- };
3906
- };
3907
- function getThemeFillStyle() {
3908
- const computedStyles = getComputedStyle(document.documentElement);
3909
- const themeColorBase = computedStyles.getPropertyValue('--theme-color-base').trim();
3910
- const themeColorPrimary = computedStyles.getPropertyValue('--theme-color-primary').trim();
3911
- const fillStyle = `${themeColorBase}B0`;
3912
- const fillStylePrimary = themeColorPrimary;
3913
- const fillStyleTransparentBase = `${themeColorBase}10`;
3914
- return {
3915
- fillStyle,
3916
- fillStylePrimary,
3917
- fillStyleTransparentBase
3918
- };
3919
- }
3920
- const mergeObjects = (e, params)=>{
3921
- const p = e;
3922
- Object.keys(p).forEach((k)=>{
3923
- if ('[object Object]' === Object.prototype.toString.call(params[k])) p[k] = {
3924
- ...p[k],
3925
- ...params[k]
3926
- };
3927
- else if (void 0 !== params[k]) p[k] = params[k];
3928
- });
3929
- return p;
3930
- };
3931
- function getMidIndex(indexStart, indexEnd) {
3932
- if (indexStart < 0 || indexEnd < 0 || indexStart > indexEnd) throw new Error('Invalid index range');
3933
- return indexStart + Math.floor((indexEnd - indexStart) / 2);
3934
- }
3935
- const getFrequencyToFixed = (frequency, fixedNum = 6)=>{
3936
- if (!frequency && 0 !== frequency) return '';
3937
- const fixed = Number.parseFloat(frequency.toFixed(fixedNum));
3938
- return Number.isFinite(fixed) ? String(fixed) : '';
3939
- };
3940
- const convertToTimestampedArrays = (data, timestamps)=>{
3941
- if (!data || !Array.isArray(data)) return [];
3942
- return Array.from({
3943
- length: data.length
3944
- }, (_, i)=>{
3945
- const d = data[i];
3946
- const frame = new Float32Array(d.length);
3947
- frame.set(d);
3948
- frame.timestamp = timestamps[i];
3949
- return frame;
3950
- });
3951
- };
4077
+ var utils = __webpack_require__("./src/utils/index.ts");
3952
4078
  const AppContext = __WEBPACK_EXTERNAL_MODULE_react__["default"].createContext({});
3953
4079
  const store_context = AppContext;
3954
4080
  var store_HeatmapCaptureType = /*#__PURE__*/ function(HeatmapCaptureType) {
@@ -3995,618 +4121,6 @@ const intervalDefault = {
3995
4121
  end: weakenDefault
3996
4122
  };
3997
4123
  const dataRateDefault = 1;
3998
- const originalFrequencyAllocationData = [
3999
- {
4000
- startFrequency: 87,
4001
- stopFrequency: 108,
4002
- defaultStep: 100,
4003
- defaultBandwidth: 150,
4004
- modulation: 'AM',
4005
- demodulation: "\u4E0D\u89E3\u8C03",
4006
- allocation: "FM\u5E7F\u64AD",
4007
- status: "\u5408\u6CD5",
4008
- color: '#FF7F50',
4009
- title: "FM\u5E7F\u64AD",
4010
- description: "FM\u8C03\u9891\u5E7F\u64AD\u9891\u6BB5\uFF0C\u7528\u4E8E\u97F3\u9891\u5E7F\u64AD\u670D\u52A1"
4011
- },
4012
- {
4013
- startFrequency: 108,
4014
- stopFrequency: 118,
4015
- defaultStep: 50,
4016
- defaultBandwidth: 100,
4017
- modulation: 'FM',
4018
- demodulation: "\u89E3\u8C03",
4019
- allocation: "\u822A\u7A7A\u5BFC\u822A",
4020
- status: "\u5408\u6CD5",
4021
- color: '#4169E1',
4022
- title: "\u822A\u7A7A\u5BFC\u822A",
4023
- description: "\u822A\u7A7A\u65E0\u7EBF\u7535\u5BFC\u822A\u9891\u6BB5\uFF0C\u7528\u4E8E\u4EEA\u8868\u7740\u9646\u7CFB\u7EDF\u7B49"
4024
- },
4025
- {
4026
- startFrequency: 118,
4027
- stopFrequency: 137,
4028
- defaultStep: 25,
4029
- defaultBandwidth: 50,
4030
- modulation: 'AM',
4031
- demodulation: "\u89E3\u8C03",
4032
- allocation: "\u822A\u7A7A\u8BED\u97F3\u901A\u4FE1",
4033
- status: "\u5408\u6CD5",
4034
- color: '#32CD32',
4035
- title: "\u822A\u7A7A\u8BED\u97F3\u901A\u4FE1",
4036
- description: "\u6C11\u7528\u822A\u7A7A\u8BED\u97F3\u901A\u4FE1\u9891\u6BB5"
4037
- },
4038
- {
4039
- startFrequency: 121,
4040
- stopFrequency: 122,
4041
- defaultStep: 25,
4042
- defaultBandwidth: 50,
4043
- modulation: 'FM',
4044
- demodulation: "\u89E3\u8C03",
4045
- allocation: "\u7D27\u6025\u901A\u4FE1",
4046
- status: "\u5408\u6CD5",
4047
- color: '#FF4500',
4048
- title: "\u7D27\u6025\u901A\u4FE1",
4049
- description: "\u7D27\u6025\u60C5\u51B5\u901A\u4FE1\u4E13\u7528\u9891\u6BB5"
4050
- },
4051
- {
4052
- startFrequency: 136,
4053
- stopFrequency: 174,
4054
- defaultStep: 25,
4055
- defaultBandwidth: 50,
4056
- modulation: 'FM',
4057
- demodulation: "\u89E3\u8C03",
4058
- allocation: "\u5BF9\u8BB2\u901A\u4FE1",
4059
- status: "\u5408\u6CD5",
4060
- color: '#9370DB',
4061
- title: "\u5BF9\u8BB2\u901A\u4FE1",
4062
- description: "\u4E13\u4E1A\u65E0\u7EBF\u5BF9\u8BB2\u901A\u4FE1\u9891\u6BB5"
4063
- },
4064
- {
4065
- startFrequency: 161,
4066
- stopFrequency: 162,
4067
- defaultStep: 25,
4068
- defaultBandwidth: 50,
4069
- modulation: 'GMSK',
4070
- demodulation: "\u89E3\u8C03",
4071
- allocation: "AIS\u8239\u8236\u901A\u4FE1",
4072
- status: "\u5408\u6CD5",
4073
- color: '#4682B4',
4074
- title: "AIS\u8239\u8236\u901A\u4FE1",
4075
- description: "\u8239\u8236\u81EA\u52A8\u8BC6\u522B\u7CFB\u7EDF(AIS)\u4E13\u7528\u9891\u6BB5"
4076
- },
4077
- {
4078
- startFrequency: 351,
4079
- stopFrequency: 400,
4080
- defaultStep: 25,
4081
- defaultBandwidth: 50,
4082
- modulation: 'FM',
4083
- demodulation: "\u89E3\u8C03",
4084
- allocation: "\u96C6\u7FA4\u901A\u4FE1",
4085
- status: "\u5408\u6CD5",
4086
- color: '#20B2AA',
4087
- title: "\u96C6\u7FA4\u901A\u4FE1",
4088
- description: "\u4E13\u4E1A\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF\u9891\u6BB5"
4089
- },
4090
- {
4091
- startFrequency: 400,
4092
- stopFrequency: 470,
4093
- defaultStep: 25,
4094
- defaultBandwidth: 50,
4095
- modulation: 'FM',
4096
- demodulation: "\u89E3\u8C03",
4097
- allocation: "\u4E13\u4E1A\u5BF9\u8BB2",
4098
- status: "\u5408\u6CD5",
4099
- color: '#DDA0DD',
4100
- title: "\u4E13\u4E1A\u5BF9\u8BB2",
4101
- description: "\u4E13\u4E1A\u65E0\u7EBF\u5BF9\u8BB2\u901A\u4FE1\u9891\u6BB5"
4102
- },
4103
- {
4104
- startFrequency: 534,
4105
- stopFrequency: 542,
4106
- defaultStep: 100,
4107
- defaultBandwidth: 8000,
4108
- modulation: 'OFDM',
4109
- demodulation: "\u89E3\u8C03",
4110
- allocation: "\u6570\u5B57\u7535\u89C6",
4111
- status: "\u5408\u6CD5",
4112
- color: '#F08080',
4113
- title: "\u6570\u5B57\u7535\u89C6",
4114
- description: "\u6570\u5B57\u7535\u89C6\u5E7F\u64AD\u9891\u6BB5"
4115
- },
4116
- {
4117
- startFrequency: 622,
4118
- stopFrequency: 630,
4119
- defaultStep: 100,
4120
- defaultBandwidth: 8000,
4121
- modulation: 'OFDM',
4122
- demodulation: "\u89E3\u8C03",
4123
- allocation: "\u6570\u5B57\u7535\u89C6",
4124
- status: "\u5408\u6CD5",
4125
- color: '#87CEFA',
4126
- title: "\u6570\u5B57\u7535\u89C6",
4127
- description: "\u6570\u5B57\u7535\u89C6\u5E7F\u64AD\u9891\u6BB5"
4128
- },
4129
- {
4130
- startFrequency: 703,
4131
- stopFrequency: 733,
4132
- defaultStep: 100,
4133
- defaultBandwidth: 30000,
4134
- modulation: 'OFDMA',
4135
- demodulation: "\u89E3\u8C03",
4136
- allocation: "5G\u4E0A\u884C(\u5E7F\u7535/\u79FB\u52A8)",
4137
- status: "\u5408\u6CD5",
4138
- color: '#9ACD32',
4139
- title: "5G\u4E0A\u884C(\u5E7F\u7535/\u79FB\u52A8)",
4140
- description: "\u5E7F\u7535\u548C\u79FB\u52A85G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4141
- },
4142
- {
4143
- startFrequency: 758,
4144
- stopFrequency: 788,
4145
- defaultStep: 100,
4146
- defaultBandwidth: 30000,
4147
- modulation: 'OFDMA',
4148
- demodulation: "\u89E3\u8C03",
4149
- allocation: "5G\u4E0B\u884C(\u5E7F\u7535/\u79FB\u52A8)",
4150
- status: "\u5408\u6CD5",
4151
- color: '#7B68EE',
4152
- title: "5G\u4E0B\u884C(\u5E7F\u7535/\u79FB\u52A8)",
4153
- description: "\u5E7F\u7535\u548C\u79FB\u52A85G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4154
- },
4155
- {
4156
- startFrequency: 806,
4157
- stopFrequency: 821,
4158
- defaultStep: 25,
4159
- defaultBandwidth: 50,
4160
- modulation: "\u03C0/4DQPSK",
4161
- demodulation: "\u89E3\u8C03",
4162
- allocation: "\u6570\u5B57\u96C6\u7FA4\u4E0A\u884C",
4163
- status: "\u5408\u6CD5",
4164
- color: '#FFA500',
4165
- title: "\u6570\u5B57\u96C6\u7FA4\u4E0A\u884C",
4166
- description: "\u6570\u5B57\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF(TETRA)\u4E0A\u884C\u9891\u6BB5"
4167
- },
4168
- {
4169
- startFrequency: 824,
4170
- stopFrequency: 835,
4171
- defaultStep: 100,
4172
- defaultBandwidth: 5000,
4173
- modulation: 'QPSK',
4174
- demodulation: "\u89E3\u8C03",
4175
- allocation: "\u7535\u4FE13G/4G/5G\u4E0A\u884C",
4176
- status: "\u5408\u6CD5",
4177
- color: '#48D1CC',
4178
- title: "\u7535\u4FE13G/4G/5G\u4E0A\u884C",
4179
- description: "\u4E2D\u56FD\u7535\u4FE13G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4180
- },
4181
- {
4182
- startFrequency: 851,
4183
- stopFrequency: 866,
4184
- defaultStep: 25,
4185
- defaultBandwidth: 50,
4186
- modulation: "\u03C0/4DQPSK",
4187
- demodulation: "\u89E3\u8C03",
4188
- allocation: "\u6570\u5B57\u96C6\u7FA4\u4E0B\u884C",
4189
- status: "\u5408\u6CD5",
4190
- color: '#C71585',
4191
- title: "\u6570\u5B57\u96C6\u7FA4\u4E0B\u884C",
4192
- description: "\u6570\u5B57\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF(TETRA)\u4E0B\u884C\u9891\u6BB5"
4193
- },
4194
- {
4195
- startFrequency: 869,
4196
- stopFrequency: 880,
4197
- defaultStep: 100,
4198
- defaultBandwidth: 5000,
4199
- modulation: 'QPSK',
4200
- demodulation: "\u89E3\u8C03",
4201
- allocation: "\u7535\u4FE13G/4G/5G\u4E0B\u884C",
4202
- status: "\u5408\u6CD5",
4203
- color: '#6495ED',
4204
- title: "\u7535\u4FE13G/4G/5G\u4E0B\u884C",
4205
- description: "\u4E2D\u56FD\u7535\u4FE13G/4G/5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4206
- },
4207
- {
4208
- startFrequency: 885,
4209
- stopFrequency: 889,
4210
- defaultStep: 200,
4211
- defaultBandwidth: 200,
4212
- modulation: 'GMSK',
4213
- demodulation: "\u89E3\u8C03",
4214
- allocation: "GSM-R\u4E0A\u884C",
4215
- status: "\u5408\u6CD5",
4216
- color: '#DC143C',
4217
- title: "GSM-R\u4E0A\u884C",
4218
- description: "\u94C1\u8DEF\u4E13\u7528GSM-R\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4219
- },
4220
- {
4221
- startFrequency: 889,
4222
- stopFrequency: 904,
4223
- defaultStep: 200,
4224
- defaultBandwidth: 200,
4225
- modulation: 'GMSK',
4226
- demodulation: "\u89E3\u8C03",
4227
- allocation: "\u79FB\u52A82G/4G\u4E0A\u884C",
4228
- status: "\u5408\u6CD5",
4229
- color: '#B22222',
4230
- title: "\u79FB\u52A82G/4G\u4E0A\u884C",
4231
- description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4232
- },
4233
- {
4234
- startFrequency: 904,
4235
- stopFrequency: 915,
4236
- defaultStep: 200,
4237
- defaultBandwidth: 200,
4238
- modulation: 'QPSK',
4239
- demodulation: "\u89E3\u8C03",
4240
- allocation: "\u8054\u901A2/3/4/5G\u4E0A\u884C",
4241
- status: "\u5408\u6CD5",
4242
- color: '#808000',
4243
- title: "\u8054\u901A2/3/4/5G\u4E0A\u884C",
4244
- description: "\u4E2D\u56FD\u8054\u901A2G/3G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4245
- },
4246
- {
4247
- startFrequency: 930,
4248
- stopFrequency: 934,
4249
- defaultStep: 200,
4250
- defaultBandwidth: 200,
4251
- modulation: 'GMSK',
4252
- demodulation: "\u89E3\u8C03",
4253
- allocation: "GSM-R\u4E0B\u884C",
4254
- status: "\u5408\u6CD5",
4255
- color: '#008080',
4256
- title: "GSM-R\u4E0B\u884C",
4257
- description: "\u94C1\u8DEF\u4E13\u7528GSM-R\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4258
- },
4259
- {
4260
- startFrequency: 934,
4261
- stopFrequency: 949,
4262
- defaultStep: 200,
4263
- defaultBandwidth: 200,
4264
- modulation: 'GMSK',
4265
- demodulation: "\u89E3\u8C03",
4266
- allocation: "\u79FB\u52A82G/4G\u4E0B\u884C",
4267
- status: "\u5408\u6CD5",
4268
- color: '#2E8B57',
4269
- title: "\u79FB\u52A82G/4G\u4E0B\u884C",
4270
- description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4271
- },
4272
- {
4273
- startFrequency: 949,
4274
- stopFrequency: 960,
4275
- defaultStep: 200,
4276
- defaultBandwidth: 200,
4277
- modulation: 'QPSK',
4278
- demodulation: "\u89E3\u8C03",
4279
- allocation: "\u8054\u901A2/3/4/5G\u4E0B\u884C",
4280
- status: "\u5408\u6CD5",
4281
- color: '#800080',
4282
- title: "\u8054\u901A2/3/4/5G\u4E0B\u884C",
4283
- description: "\u4E2D\u56FD\u8054\u901A2G/3G/4G/5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4284
- },
4285
- {
4286
- startFrequency: 1164,
4287
- stopFrequency: 1189,
4288
- defaultStep: 1000,
4289
- defaultBandwidth: 10000,
4290
- modulation: 'BPSK',
4291
- demodulation: "\u89E3\u8C03",
4292
- allocation: "GPS L5\u9891\u6BB5",
4293
- status: "\u5408\u6CD5",
4294
- color: '#B8860B',
4295
- title: "GPS L5\u9891\u6BB5",
4296
- description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L5\u9891\u6BB5"
4297
- },
4298
- {
4299
- startFrequency: 1215,
4300
- stopFrequency: 1234,
4301
- defaultStep: 1000,
4302
- defaultBandwidth: 10000,
4303
- modulation: 'BPSK',
4304
- demodulation: "\u89E3\u8C03",
4305
- allocation: "GPS L2\u9891\u6BB5",
4306
- status: "\u5408\u6CD5",
4307
- color: '#778899',
4308
- title: "GPS L2\u9891\u6BB5",
4309
- description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L2\u9891\u6BB5"
4310
- },
4311
- {
4312
- startFrequency: 1447,
4313
- stopFrequency: 1467,
4314
- defaultStep: 100,
4315
- defaultBandwidth: 10000,
4316
- modulation: 'OFDMA',
4317
- demodulation: "\u89E3\u8C03",
4318
- allocation: "\u653F\u52A1\u516C\u5B89\u4E13\u7F51",
4319
- status: "\u5408\u6CD5",
4320
- color: '#483D8B',
4321
- title: "\u653F\u52A1\u516C\u5B89\u4E13\u7F51",
4322
- description: "\u653F\u52A1\u548C\u516C\u5B89\u4E13\u7528LTE\u7F51\u7EDC\u9891\u6BB5"
4323
- },
4324
- {
4325
- startFrequency: 1563,
4326
- stopFrequency: 1587,
4327
- defaultStep: 1000,
4328
- defaultBandwidth: 10000,
4329
- modulation: 'BPSK',
4330
- demodulation: "\u89E3\u8C03",
4331
- allocation: "GPS L1\u9891\u6BB5",
4332
- status: "\u5408\u6CD5",
4333
- color: '#CD5C5C',
4334
- title: "GPS L1\u9891\u6BB5",
4335
- description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L1\u9891\u6BB5"
4336
- },
4337
- {
4338
- startFrequency: 1710,
4339
- stopFrequency: 1735,
4340
- defaultStep: 200,
4341
- defaultBandwidth: 5000,
4342
- modulation: 'QPSK',
4343
- demodulation: "\u89E3\u8C03",
4344
- allocation: "\u79FB\u52A82G/4G\u4E0A\u884C",
4345
- status: "\u5408\u6CD5",
4346
- color: '#FA8072',
4347
- title: "\u79FB\u52A82G/4G\u4E0A\u884C",
4348
- description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4349
- },
4350
- {
4351
- startFrequency: 1735,
4352
- stopFrequency: 1765,
4353
- defaultStep: 200,
4354
- defaultBandwidth: 5000,
4355
- modulation: 'QPSK',
4356
- demodulation: "\u89E3\u8C03",
4357
- allocation: "\u8054\u901A2/4G\u4E0A\u884C",
4358
- status: "\u5408\u6CD5",
4359
- color: '#6A5ACD',
4360
- title: "\u8054\u901A2/4G\u4E0A\u884C",
4361
- description: "\u4E2D\u56FD\u8054\u901A2G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4362
- },
4363
- {
4364
- startFrequency: 1805,
4365
- stopFrequency: 1830,
4366
- defaultStep: 200,
4367
- defaultBandwidth: 5000,
4368
- modulation: 'QPSK',
4369
- demodulation: "\u89E3\u8C03",
4370
- allocation: "\u79FB\u52A82G/4G\u4E0B\u884C",
4371
- status: "\u5408\u6CD5",
4372
- color: '#00FA9A',
4373
- title: "\u79FB\u52A82G/4G\u4E0B\u884C",
4374
- description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4375
- },
4376
- {
4377
- startFrequency: 1830,
4378
- stopFrequency: 1860,
4379
- defaultStep: 200,
4380
- defaultBandwidth: 5000,
4381
- modulation: 'QPSK',
4382
- demodulation: "\u89E3\u8C03",
4383
- allocation: "\u8054\u901A2/4G\u4E0B\u884C",
4384
- status: "\u5408\u6CD5",
4385
- color: '#FF6347',
4386
- title: "\u8054\u901A2/4G\u4E0B\u884C",
4387
- description: "\u4E2D\u56FD\u8054\u901A2G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4388
- },
4389
- {
4390
- startFrequency: 1885,
4391
- stopFrequency: 1915,
4392
- defaultStep: 100,
4393
- defaultBandwidth: 10000,
4394
- modulation: 'OFDMA',
4395
- demodulation: "\u89E3\u8C03",
4396
- allocation: "\u79FB\u52A84G",
4397
- status: "\u5408\u6CD5",
4398
- color: '#4169E1',
4399
- title: "\u79FB\u52A84G",
4400
- description: "\u4E2D\u56FD\u79FB\u52A84G\u7F51\u7EDC\u9891\u6BB5"
4401
- },
4402
- {
4403
- startFrequency: 1920,
4404
- stopFrequency: 1940,
4405
- defaultStep: 100,
4406
- defaultBandwidth: 10000,
4407
- modulation: 'OFDMA',
4408
- demodulation: "\u89E3\u8C03",
4409
- allocation: "\u7535\u4FE1/\u8054\u901A5G\u4E0A\u884C",
4410
- status: "\u5408\u6CD5",
4411
- color: '#8A2BE2',
4412
- title: "\u7535\u4FE1/\u8054\u901A5G\u4E0A\u884C",
4413
- description: "\u4E2D\u56FD\u7535\u4FE1/\u8054\u901A5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4414
- },
4415
- {
4416
- startFrequency: 1940,
4417
- stopFrequency: 1965,
4418
- defaultStep: 100,
4419
- defaultBandwidth: 10000,
4420
- modulation: 'OFDMA',
4421
- demodulation: "\u89E3\u8C03",
4422
- allocation: "\u8054\u901A3/4/5G\u4E0A\u884C",
4423
- status: "\u5408\u6CD5",
4424
- color: '#9932CC',
4425
- title: "\u8054\u901A3/4/5G\u4E0A\u884C",
4426
- description: "\u4E2D\u56FD\u8054\u901A3G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
4427
- },
4428
- {
4429
- startFrequency: 2110,
4430
- stopFrequency: 2130,
4431
- defaultStep: 100,
4432
- defaultBandwidth: 10000,
4433
- modulation: 'OFDMA',
4434
- demodulation: "\u89E3\u8C03",
4435
- allocation: "\u7535\u4FE1/\u8054\u901A5G\u4E0B\u884C",
4436
- status: "\u5408\u6CD5",
4437
- color: '#8FBC8F',
4438
- title: "\u7535\u4FE1/\u8054\u901A5G\u4E0B\u884C",
4439
- description: "\u4E2D\u56FD\u7535\u4FE1/\u8054\u901A5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
4440
- },
4441
- {
4442
- startFrequency: 2300,
4443
- stopFrequency: 2320,
4444
- defaultStep: 100,
4445
- defaultBandwidth: 10000,
4446
- modulation: 'OFDMA',
4447
- demodulation: "\u89E3\u8C03",
4448
- allocation: "\u8054\u901A4G",
4449
- status: "\u5408\u6CD5",
4450
- color: '#2F4F4F',
4451
- title: "\u8054\u901A4G",
4452
- description: "\u4E2D\u56FD\u8054\u901A4G\u7F51\u7EDC\u9891\u6BB5"
4453
- },
4454
- {
4455
- startFrequency: 2320,
4456
- stopFrequency: 2370,
4457
- defaultStep: 100,
4458
- defaultBandwidth: 10000,
4459
- modulation: 'OFDMA',
4460
- demodulation: "\u89E3\u8C03",
4461
- allocation: "\u79FB\u52A84G",
4462
- status: "\u5408\u6CD5",
4463
- color: '#00CED1',
4464
- title: "\u79FB\u52A84G",
4465
- description: "\u4E2D\u56FD\u79FB\u52A84G\u7F51\u7EDC\u9891\u6BB5"
4466
- },
4467
- {
4468
- startFrequency: 2400,
4469
- stopFrequency: 2500,
4470
- defaultStep: 1,
4471
- defaultBandwidth: 20,
4472
- modulation: 'OFDM',
4473
- demodulation: "\u89E3\u8C03",
4474
- allocation: 'ISM 2.4GHz',
4475
- status: "\u5408\u6CD5",
4476
- color: '#A0522D',
4477
- title: 'ISM 2.4GHz',
4478
- description: "WIFI\u3001\u84DD\u7259\u3001\u65E0\u4EBA\u673A\u7B49\u4F7F\u7528\u9891\u6BB5"
4479
- },
4480
- {
4481
- startFrequency: 2515,
4482
- stopFrequency: 2675,
4483
- defaultStep: 100,
4484
- defaultBandwidth: 10000,
4485
- modulation: 'OFDMA',
4486
- demodulation: "\u89E3\u8C03",
4487
- allocation: "\u79FB\u52A85G/4G",
4488
- status: "\u5408\u6CD5",
4489
- color: '#BA55D3',
4490
- title: "\u79FB\u52A85G/4G",
4491
- description: "\u4E2D\u56FD\u79FB\u52A85G\u548C4G\u7F51\u7EDC\u9891\u6BB5"
4492
- },
4493
- {
4494
- startFrequency: 3300,
4495
- stopFrequency: 3600,
4496
- defaultStep: 100,
4497
- defaultBandwidth: 10000,
4498
- modulation: 'OFDMA',
4499
- demodulation: "\u89E3\u8C03",
4500
- allocation: "5G\u9891\u6BB5",
4501
- status: "\u5408\u6CD5",
4502
- color: '#66CDAA',
4503
- title: "5G\u9891\u6BB5",
4504
- description: "\u7535\u4FE1\u3001\u8054\u901A\u3001\u5E7F\u75355G\u7F51\u7EDC\u9891\u6BB5"
4505
- },
4506
- {
4507
- startFrequency: 4800,
4508
- stopFrequency: 4900,
4509
- defaultStep: 100,
4510
- defaultBandwidth: 10000,
4511
- modulation: 'OFDMA',
4512
- demodulation: "\u89E3\u8C03",
4513
- allocation: "\u79FB\u52A85G",
4514
- status: "\u5408\u6CD5",
4515
- color: '#9370DB',
4516
- title: "\u79FB\u52A85G",
4517
- description: "\u4E2D\u56FD\u79FB\u52A85G\u7F51\u7EDC\u9891\u6BB5"
4518
- },
4519
- {
4520
- startFrequency: 4900,
4521
- stopFrequency: 4960,
4522
- defaultStep: 100,
4523
- defaultBandwidth: 10000,
4524
- modulation: 'OFDMA',
4525
- demodulation: "\u89E3\u8C03",
4526
- allocation: "\u5E7F\u75355G",
4527
- status: "\u5408\u6CD5",
4528
- color: '#3CB371',
4529
- title: "\u5E7F\u75355G",
4530
- description: "\u4E2D\u56FD\u5E7F\u75355G\u7F51\u7EDC\u9891\u6BB5"
4531
- },
4532
- {
4533
- startFrequency: 5725,
4534
- stopFrequency: 5875.5,
4535
- defaultStep: 5,
4536
- defaultBandwidth: 20,
4537
- modulation: 'OFDM',
4538
- demodulation: "\u89E3\u8C03",
4539
- allocation: 'ISM 5GHz',
4540
- status: "\u5408\u6CD5",
4541
- color: '#7FFFD4',
4542
- title: 'ISM 5GHz',
4543
- description: "WIFI\u3001\u65E0\u4EBA\u673A\u7B49\u4F7F\u7528\u9891\u6BB5"
4544
- }
4545
- ];
4546
- const originalColors = originalFrequencyAllocationData.map((item)=>item.color);
4547
- function hexToHsl(hex) {
4548
- const r = parseInt(hex.slice(1, 3), 16) / 255;
4549
- const g = parseInt(hex.slice(3, 5), 16) / 255;
4550
- const b = parseInt(hex.slice(5, 7), 16) / 255;
4551
- const max = Math.max(r, g, b);
4552
- const min = Math.min(r, g, b);
4553
- let h = 0;
4554
- let s = 0;
4555
- const l = (max + min) / 2;
4556
- if (max !== min) {
4557
- const d = max - min;
4558
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
4559
- switch(max){
4560
- case r:
4561
- h = (g - b) / d + (g < b ? 6 : 0);
4562
- break;
4563
- case g:
4564
- h = (b - r) / d + 2;
4565
- break;
4566
- case b:
4567
- h = (r - g) / d + 4;
4568
- break;
4569
- }
4570
- h /= 6;
4571
- }
4572
- return {
4573
- h: 360 * h,
4574
- s: 100 * s,
4575
- l: 100 * l
4576
- };
4577
- }
4578
- const sortedColors = [
4579
- ...originalColors
4580
- ].map((color)=>({
4581
- color,
4582
- hsl: hexToHsl(color)
4583
- })).sort((a, b)=>{
4584
- if (Math.abs(a.hsl.h - b.hsl.h) > 10) return a.hsl.h - b.hsl.h;
4585
- return a.hsl.l - b.hsl.l;
4586
- }).map((item)=>item.color);
4587
- function sortAndRecolorFrequencyAllocationData(data) {
4588
- const sortedData = [
4589
- ...data
4590
- ].sort((a, b)=>a.startFrequency - b.startFrequency);
4591
- return sortedData.map((item, index)=>{
4592
- const totalBands = sortedData.length;
4593
- const colorCount = sortedColors.length;
4594
- const startColorIndex = Math.floor(index / totalBands * colorCount);
4595
- const endColorIndex = Math.floor((index + 1) / totalBands * colorCount);
4596
- const startColor = sortedColors[Math.min(startColorIndex, colorCount - 1)];
4597
- const endColor = sortedColors[Math.min(endColorIndex, colorCount - 1)];
4598
- const finalEndColor = index === totalBands - 1 ? sortedColors[colorCount - 1] : endColor;
4599
- return {
4600
- ...item,
4601
- color: startColor,
4602
- gradientColors: [
4603
- startColor,
4604
- finalEndColor
4605
- ]
4606
- };
4607
- });
4608
- }
4609
- const frequencyAllocationData = sortAndRecolorFrequencyAllocationData(originalFrequencyAllocationData);
4610
4124
  function defaultState_createParams() {
4611
4125
  return {
4612
4126
  globalID: '',
@@ -4779,7 +4293,7 @@ function defaultState_createParams() {
4779
4293
  frequencyAllocation: {
4780
4294
  show: true,
4781
4295
  display: true,
4782
- data: frequencyAllocationData
4296
+ data: []
4783
4297
  },
4784
4298
  timeRange: 0,
4785
4299
  levelStream: {
@@ -4856,7 +4370,7 @@ function useVirtualRange({ unit, realRange, step, globalID }) {
4856
4370
  let { offset, flaw } = tools_defaultData;
4857
4371
  let range = realRange;
4858
4372
  let renderRange = realRange;
4859
- if (isdBm(unit)) {
4373
+ if ((0, utils.Bp)(unit)) {
4860
4374
  const diff = dBuV2dBm(0);
4861
4375
  flaw = diff % step;
4862
4376
  offset = diff - flaw;
@@ -4881,7 +4395,7 @@ function useVirtualRange({ unit, realRange, step, globalID }) {
4881
4395
  function range2realRange({ range, unit, globalID }) {
4882
4396
  let realRange = range;
4883
4397
  let renderRange = range;
4884
- if (isdBm(unit)) {
4398
+ if ((0, utils.Bp)(unit)) {
4885
4399
  const { offset, flaw } = VIRTUAL_RANGE(globalID);
4886
4400
  realRange = [
4887
4401
  range[0] - offset,
@@ -4898,7 +4412,7 @@ function range2realRange({ range, unit, globalID }) {
4898
4412
  };
4899
4413
  }
4900
4414
  function getVirtualLevel(unit, v) {
4901
- const dbm = isdBm(unit);
4415
+ const dbm = (0, utils.Bp)(unit);
4902
4416
  return dbm ? dBuV2dBm(v) : v;
4903
4417
  }
4904
4418
  function mergeParameter(key, params, state) {
@@ -4906,7 +4420,7 @@ function mergeParameter(key, params, state) {
4906
4420
  const p = preset[key];
4907
4421
  if (!params) return p;
4908
4422
  if ('object' != typeof params || null === params) return params;
4909
- return mergeObjects(p, params);
4423
+ return (0, utils.PM)(p, params);
4910
4424
  }
4911
4425
  const useParamEffect = (paramName, paramValue, state, dispatch)=>{
4912
4426
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -4962,7 +4476,7 @@ const Params_Params = (props)=>{
4962
4476
  const axisY = props.axisY;
4963
4477
  if (axisY && globalID) {
4964
4478
  const { range, unit } = axisY;
4965
- if (range?.[0] !== void 0 && (unit && isdBm(unit) && state.axisY.unit !== unit || range[0] !== state.axisY.range[0] && isdBm(state.axisY.unit))) {
4479
+ if (range?.[0] !== void 0 && (unit && (0, utils.Bp)(unit) && state.axisY.unit !== unit || range[0] !== state.axisY.range[0] && (0, utils.Bp)(state.axisY.unit))) {
4966
4480
  const { realRange, renderRange } = range2realRange({
4967
4481
  range,
4968
4482
  unit,
@@ -4978,7 +4492,7 @@ const Params_Params = (props)=>{
4978
4492
  axisY: mergeParameter('axisY', updatedAxisY, state)
4979
4493
  }
4980
4494
  });
4981
- } else if (unit || isdBm(state.axisY.unit) || !range) dispatch({
4495
+ } else if (unit || (0, utils.Bp)(state.axisY.unit) || !range) dispatch({
4982
4496
  payload: {
4983
4497
  axisY: mergeParameter('axisY', axisY, state)
4984
4498
  }
@@ -5026,7 +4540,7 @@ function useStore_useStore() {
5026
4540
  }
5027
4541
  const Store = (props)=>{
5028
4542
  const { children } = props;
5029
- const [state, dispatchBase] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useReducer)(reducer, mergeObjects(defaultState_createParams(), props));
4543
+ const [state, dispatchBase] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useReducer)(reducer, (0, utils.PM)(defaultState_createParams(), props));
5030
4544
  const dispatch = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((action)=>{
5031
4545
  if (action?.payload) dispatchBase(action);
5032
4546
  }, []);
@@ -5121,7 +4635,7 @@ const Container = (props)=>{
5121
4635
  const { children, style } = props;
5122
4636
  const { state: { system }, dispatch } = useStore_useStore();
5123
4637
  const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
5124
- const globalID = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>createGUID(), []);
4638
+ const globalID = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>(0, utils.SF)(), []);
5125
4639
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
5126
4640
  if (globalID) dispatch({
5127
4641
  payload: {
@@ -5136,7 +4650,7 @@ const Container = (props)=>{
5136
4650
  if (globalID) {
5137
4651
  let first = true;
5138
4652
  resizeObserver = new ResizeObserver(()=>{
5139
- if (!first) throttleTimer(()=>{
4653
+ if (!first) (0, utils.g9)(()=>{
5140
4654
  PUB_SUB(globalID)({
5141
4655
  pstype: constants_PSType.Resize
5142
4656
  });
@@ -5229,10 +4743,10 @@ useChart_styles_module_options.domAPI = styleDomAPI_default();
5229
4743
  useChart_styles_module_options.insertStyleElement = insertStyleElement_default();
5230
4744
  injectStylesIntoStyleTag_default()(useChart_styles_module.Z, useChart_styles_module_options);
5231
4745
  const hooks_useChart_styles_module = useChart_styles_module.Z && useChart_styles_module.Z.locals ? useChart_styles_module.Z.locals : void 0;
5232
- const useChart = (props)=>{
4746
+ const useChart_useChart = (props)=>{
5233
4747
  const { state: { globalID } } = useStore_useStore();
5234
4748
  const { Render, params, onIDChange } = props;
5235
- const id = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>createGUID(), []);
4749
+ const id = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>(0, utils.SF)(), []);
5236
4750
  const [chart, init] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)();
5237
4751
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
5238
4752
  if (id && globalID) {
@@ -5276,7 +4790,7 @@ const useChart = (props)=>{
5276
4790
  Chart
5277
4791
  };
5278
4792
  };
5279
- const hooks_useChart = useChart;
4793
+ const useChart = useChart_useChart;
5280
4794
  const tools = (globalID, name, func)=>subscription_createSubscriptionManager(`passThrough-${globalID}-${name}`, '0', func);
5281
4795
  class engine_Engine {
5282
4796
  state = {
@@ -5625,7 +5139,7 @@ class Gauge extends engine_Engine {
5625
5139
  }
5626
5140
  drawLimit() {
5627
5141
  const { data: { limit }, range: [min, max], canvas, ctx, baseWidth, padding, lineWidth, fillStylePrimary } = this.state;
5628
- if (!isNumberAlias(limit)) return;
5142
+ if (!(0, utils.Ri)(limit)) return;
5629
5143
  const width = 3 * baseWidth;
5630
5144
  const height = canvas.height - 2 * padding;
5631
5145
  const x = (canvas.width - width) / 2;
@@ -6034,7 +5548,7 @@ class Heatmap extends engine_Engine {
6034
5548
  const { range = this.state.range, colors = this.state.colors } = e;
6035
5549
  if (range && colors) {
6036
5550
  const [rangeMin, rangeMax] = range;
6037
- if (isNumberAlias(rangeMax) && isNumberAlias(rangeMax) && rangeMin < rangeMax) if (this.state.CI) this.state.CI.setColors(colors, rangeMin, rangeMax, 0.1);
5551
+ if ((0, utils.Ri)(rangeMax) && (0, utils.Ri)(rangeMax) && rangeMin < rangeMax) if (this.state.CI) this.state.CI.setColors(colors, rangeMin, rangeMax, 0.1);
6038
5552
  else this.updateProps({
6039
5553
  CI: new ColorInterpolator_ColorInterpolator(colors, rangeMin, rangeMax, 0.1)
6040
5554
  });
@@ -6070,7 +5584,7 @@ class Heatmap extends engine_Engine {
6070
5584
  render(data) {
6071
5585
  if (data?.length >= 0) {
6072
5586
  this.state.data = data;
6073
- utils_throttle(()=>{
5587
+ (0, utils.P2)(()=>{
6074
5588
  this.draw();
6075
5589
  })();
6076
5590
  }
@@ -6098,7 +5612,7 @@ class IQ extends engine_Engine {
6098
5612
  render(data) {
6099
5613
  if (data.IData && data.QData) {
6100
5614
  this.state.data = data;
6101
- utils_throttle(()=>{
5615
+ (0, utils.P2)(()=>{
6102
5616
  this.draw();
6103
5617
  })();
6104
5618
  }
@@ -6165,7 +5679,7 @@ class iqEye_IQ extends engine_Engine {
6165
5679
  render(data) {
6166
5680
  if (data.IData && data.QData) {
6167
5681
  this.state.data = data;
6168
- utils_throttle(()=>{
5682
+ (0, utils.P2)(()=>{
6169
5683
  this.draw();
6170
5684
  })();
6171
5685
  }
@@ -6278,19 +5792,19 @@ class iqEye_IQ extends engine_Engine {
6278
5792
  }
6279
5793
  }
6280
5794
  }
6281
- var type_OrientationType = /*#__PURE__*/ function(OrientationType) {
6282
- OrientationType["Horizontal"] = "horizontal";
6283
- OrientationType["Vertical"] = "vertical";
6284
- return OrientationType;
5795
+ var type_OrientationType = /*#__PURE__*/ function(OrientationType1) {
5796
+ OrientationType1["Horizontal"] = "horizontal";
5797
+ OrientationType1["Vertical"] = "vertical";
5798
+ return OrientationType1;
6285
5799
  }({});
6286
- var type_GraphicType = /*#__PURE__*/ function(GraphicType) {
6287
- GraphicType["Circle"] = "circle";
6288
- GraphicType["Rect"] = "rect";
6289
- GraphicType["Line"] = "line";
6290
- GraphicType["Stepline"] = "stepline";
6291
- GraphicType["Bar"] = "bar";
6292
- GraphicType["Area"] = "area";
6293
- return GraphicType;
5800
+ var type_GraphicType = /*#__PURE__*/ function(GraphicType1) {
5801
+ GraphicType1["Circle"] = "circle";
5802
+ GraphicType1["Rect"] = "rect";
5803
+ GraphicType1["Line"] = "line";
5804
+ GraphicType1["Stepline"] = "stepline";
5805
+ GraphicType1["Bar"] = "bar";
5806
+ GraphicType1["Area"] = "area";
5807
+ return GraphicType1;
6294
5808
  }({});
6295
5809
  class Series extends engine_Engine {
6296
5810
  init(props) {
@@ -6359,7 +5873,7 @@ class Series extends engine_Engine {
6359
5873
  }
6360
5874
  render(e) {
6361
5875
  e && this.setSeries(e);
6362
- utils_throttle(()=>{
5876
+ (0, utils.P2)(()=>{
6363
5877
  this.draw();
6364
5878
  })();
6365
5879
  }
@@ -6532,27 +6046,486 @@ class Series extends engine_Engine {
6532
6046
  if (type === type_GraphicType.Bar) if (orientation === type_OrientationType.Horizontal) {
6533
6047
  const h = height / len;
6534
6048
  const hh = Math.round(h);
6535
- for(let i = 0; i < len; i += 1){
6536
- const y = Math.round(height - (i + 1) * h);
6537
- const w = Math.round((data[i] - min) / rangeY * width);
6538
- const x = width - w;
6539
- ctx.beginPath();
6540
- ctx.rect(x, y, w, hh);
6541
- ctx.fillStyle = color;
6542
- ctx.fill();
6543
- }
6544
- } else for(let i = 0; i < len; i += 1){
6545
- const startX = Math.floor(i * width / len);
6546
- const endX = Math.floor((i + 1) * width / len);
6547
- const w = endX - startX;
6548
- const h = Math.round((data[i] - min) / rangeY * height);
6549
- ctx.beginPath();
6550
- ctx.rect(startX, 0, w, h);
6551
- ctx.fillStyle = this.state.barValue2Color ? this.state.CI.getColor(data[i]).hax : color;
6552
- ctx.fill();
6049
+ for(let i = 0; i < len; i += 1){
6050
+ const y = Math.round(height - (i + 1) * h);
6051
+ const w = Math.round((data[i] - min) / rangeY * width);
6052
+ const x = width - w;
6053
+ ctx.beginPath();
6054
+ ctx.rect(x, y, w, hh);
6055
+ ctx.fillStyle = color;
6056
+ ctx.fill();
6057
+ }
6058
+ } else for(let i = 0; i < len; i += 1){
6059
+ const startX = Math.floor(i * width / len);
6060
+ const endX = Math.floor((i + 1) * width / len);
6061
+ const w = endX - startX;
6062
+ const h = Math.round((data[i] - min) / rangeY * height);
6063
+ ctx.beginPath();
6064
+ ctx.rect(startX, 0, w, h);
6065
+ ctx.fillStyle = this.state.barValue2Color ? this.state.CI.getColor(data[i]).hax : color;
6066
+ ctx.fill();
6067
+ }
6068
+ }
6069
+ ctx.restore();
6070
+ }
6071
+ }
6072
+ class webglEngine_WebGLEngine {
6073
+ state = {
6074
+ id: '',
6075
+ container: void 0,
6076
+ canvas: null,
6077
+ ctx: null,
6078
+ range: [
6079
+ -20,
6080
+ 100
6081
+ ]
6082
+ };
6083
+ constructor(props){
6084
+ this.updateProps(props);
6085
+ this.init(props);
6086
+ }
6087
+ updateProps(e) {
6088
+ this.state = {
6089
+ ...this.state,
6090
+ ...e
6091
+ };
6092
+ }
6093
+ init(_p) {
6094
+ const { id } = this.state;
6095
+ const container = document.getElementById(id);
6096
+ const canvas = document.createElement('canvas');
6097
+ const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
6098
+ if (!gl) return;
6099
+ canvas.style.transform = 'scaleY(-1)';
6100
+ this.updateProps({
6101
+ container,
6102
+ canvas,
6103
+ gl
6104
+ });
6105
+ container?.appendChild(canvas);
6106
+ this.initWebGL();
6107
+ this.resize(false);
6108
+ }
6109
+ initWebGL() {
6110
+ const { gl } = this.state;
6111
+ if (!gl) return;
6112
+ const program = this.createShaderProgram();
6113
+ const positionBuffer = gl.createBuffer();
6114
+ const colorBuffer = gl.createBuffer();
6115
+ this.updateProps({
6116
+ program,
6117
+ buffers: {
6118
+ position: positionBuffer,
6119
+ color: colorBuffer
6120
+ }
6121
+ });
6122
+ gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
6123
+ gl.enable(gl.BLEND);
6124
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
6125
+ }
6126
+ createShaderProgram() {
6127
+ const { gl } = this.state;
6128
+ if (!gl) return null;
6129
+ const vertexShaderSource = `
6130
+ attribute vec2 a_position;
6131
+ attribute vec4 a_color;
6132
+ uniform vec2 u_resolution;
6133
+ varying vec4 v_color;
6134
+
6135
+ void main() {
6136
+ // \u{5C06}\u{50CF}\u{7D20}\u{5750}\u{6807}\u{8F6C}\u{6362}\u{4E3A}\u{88C1}\u{526A}\u{7A7A}\u{95F4}\u{5750}\u{6807}
6137
+ vec2 zeroToOne = a_position / u_resolution;
6138
+ vec2 zeroToTwo = zeroToOne * 2.0;
6139
+ vec2 clipSpace = zeroToTwo - 1.0;
6140
+
6141
+ gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);
6142
+ v_color = a_color;
6143
+ }
6144
+ `;
6145
+ const fragmentShaderSource = `
6146
+ precision mediump float;
6147
+ varying vec4 v_color;
6148
+
6149
+ void main() {
6150
+ gl_FragColor = v_color;
6151
+ }
6152
+ `;
6153
+ const vertexShader = this.createShader(gl, gl.VERTEX_SHADER, vertexShaderSource);
6154
+ const fragmentShader = this.createShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource);
6155
+ if (!vertexShader || !fragmentShader) return null;
6156
+ const program = gl.createProgram();
6157
+ if (!program) return null;
6158
+ gl.attachShader(program, vertexShader);
6159
+ gl.attachShader(program, fragmentShader);
6160
+ gl.linkProgram(program);
6161
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return null;
6162
+ return program;
6163
+ }
6164
+ createShader(gl, type, source) {
6165
+ const shader = gl.createShader(type);
6166
+ if (!shader) return null;
6167
+ gl.shaderSource(shader, source);
6168
+ gl.compileShader(shader);
6169
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
6170
+ gl.deleteShader(shader);
6171
+ return null;
6172
+ }
6173
+ return shader;
6174
+ }
6175
+ resize(draw = true) {
6176
+ const { canvas, container, gl } = this.state;
6177
+ const { clientWidth, clientHeight } = container;
6178
+ if (!clientWidth || !clientHeight) return;
6179
+ canvas.width = clientWidth;
6180
+ canvas.height = clientHeight;
6181
+ if (gl) gl.viewport(0, 0, clientWidth, clientHeight);
6182
+ if (draw) setTimeout(()=>{
6183
+ this.draw();
6184
+ });
6185
+ }
6186
+ clear() {
6187
+ const { gl } = this.state;
6188
+ if (!gl) return;
6189
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
6190
+ gl.clear(gl.COLOR_BUFFER_BIT);
6191
+ }
6192
+ draw() {}
6193
+ drawLines(vertices, colors) {
6194
+ const { gl, program, buffers } = this.state;
6195
+ if (!gl || !program || !buffers) return;
6196
+ gl.useProgram(program);
6197
+ const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');
6198
+ gl.uniform2f(resolutionLocation, gl.canvas.width, gl.canvas.height);
6199
+ const positionLocation = gl.getAttribLocation(program, 'a_position');
6200
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position);
6201
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
6202
+ gl.enableVertexAttribArray(positionLocation);
6203
+ gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
6204
+ const colorLocation = gl.getAttribLocation(program, 'a_color');
6205
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color);
6206
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
6207
+ gl.enableVertexAttribArray(colorLocation);
6208
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
6209
+ const vertexCount = vertices.length / 2;
6210
+ gl.drawArrays(gl.TRIANGLES, 0, vertexCount);
6211
+ }
6212
+ drawTriangles(vertices, colors) {
6213
+ const { gl, program, buffers } = this.state;
6214
+ if (!gl || !program || !buffers) return;
6215
+ gl.useProgram(program);
6216
+ const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');
6217
+ gl.uniform2f(resolutionLocation, gl.canvas.width, gl.canvas.height);
6218
+ const positionLocation = gl.getAttribLocation(program, 'a_position');
6219
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position);
6220
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
6221
+ gl.enableVertexAttribArray(positionLocation);
6222
+ gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
6223
+ const colorLocation = gl.getAttribLocation(program, 'a_color');
6224
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color);
6225
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
6226
+ gl.enableVertexAttribArray(colorLocation);
6227
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
6228
+ const vertexCount = vertices.length / 2;
6229
+ gl.drawArrays(gl.TRIANGLES, 0, vertexCount);
6230
+ }
6231
+ setupBuffers(vertices, colors) {
6232
+ const { gl, program, buffers } = this.state;
6233
+ if (!gl || !program || !buffers) return;
6234
+ gl.useProgram(program);
6235
+ const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');
6236
+ gl.uniform2f(resolutionLocation, gl.canvas.width, gl.canvas.height);
6237
+ const positionLocation = gl.getAttribLocation(program, 'a_position');
6238
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position);
6239
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
6240
+ gl.enableVertexAttribArray(positionLocation);
6241
+ gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
6242
+ const colorLocation = gl.getAttribLocation(program, 'a_color');
6243
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color);
6244
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
6245
+ gl.enableVertexAttribArray(colorLocation);
6246
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
6247
+ }
6248
+ }
6249
+ class WebGLSeries extends null {
6250
+ vertexData = new Float32Array(0);
6251
+ colorData = new Float32Array(0);
6252
+ throttledDraw = throttle(()=>{
6253
+ this.draw();
6254
+ });
6255
+ init(props) {
6256
+ super.init(props);
6257
+ const { series } = props;
6258
+ this.updateProps({
6259
+ interval: 0,
6260
+ series: {}
6261
+ });
6262
+ this.setRange(this.state.range);
6263
+ series?.forEach((e)=>{
6264
+ this.setSeries(e);
6265
+ });
6266
+ }
6267
+ updateProps(e) {
6268
+ super.updateProps(e);
6269
+ const { colors = this.state.colors } = e;
6270
+ if (this.state.barValue2Color && !this.state.CI) this.updateProps({
6271
+ CI: new ColorInterpolator(colors, 0, 100, 0.1)
6272
+ });
6273
+ }
6274
+ clear() {
6275
+ super.clear();
6276
+ const { series } = this.state;
6277
+ const seriesArray = Object.entries(series);
6278
+ seriesArray.forEach(([name, i])=>{
6279
+ series[name] = {
6280
+ ...i,
6281
+ data: void 0
6282
+ };
6283
+ });
6284
+ }
6285
+ setRange(range) {
6286
+ this.updateProps({
6287
+ range: [
6288
+ ...range,
6289
+ range[1] - range[0]
6290
+ ]
6291
+ });
6292
+ this.draw();
6293
+ }
6294
+ setIntervel(interval) {
6295
+ if (!interval) return;
6296
+ this.updateProps({
6297
+ interval
6298
+ });
6299
+ }
6300
+ setSeries(e) {
6301
+ if (e?.name) {
6302
+ const { name } = e;
6303
+ const { series } = this.state;
6304
+ series[name] = {
6305
+ thickness: 1,
6306
+ display: true,
6307
+ color: '#000000',
6308
+ type: GraphicType.Line,
6309
+ data: void 0,
6310
+ path: void 0,
6311
+ orientation: OrientationType.Vertical,
6312
+ ...series[name],
6313
+ ...e
6314
+ };
6315
+ }
6316
+ }
6317
+ render(e) {
6318
+ e && this.setSeries(e);
6319
+ this.throttledDraw();
6320
+ }
6321
+ hexToRgba(hex, alpha = 1) {
6322
+ const r = Number.parseInt(hex.slice(1, 3), 16) / 255;
6323
+ const g = Number.parseInt(hex.slice(3, 5), 16) / 255;
6324
+ const b = Number.parseInt(hex.slice(5, 7), 16) / 255;
6325
+ return [
6326
+ r,
6327
+ g,
6328
+ b,
6329
+ alpha
6330
+ ];
6331
+ }
6332
+ generateLineVertices(data, color, thickness) {
6333
+ const vertices = [];
6334
+ const colors = [];
6335
+ const [r, g, b, a] = this.hexToRgba(color);
6336
+ const { range: [min, , rangeY], canvas: { width, height } } = this.state;
6337
+ const len = data.length;
6338
+ const per = width / len;
6339
+ const halfThickness = thickness / 2;
6340
+ for(let i = 0; i < len - 1; i++){
6341
+ const value1 = data[i];
6342
+ const value2 = data[i + 1];
6343
+ if (void 0 === value1 || void 0 === value2 || Number.isNaN(value1) || Number.isNaN(value2)) continue;
6344
+ const x1 = (i + 0.5) * per;
6345
+ const y1 = (value1 - min) / rangeY * height;
6346
+ const x2 = (i + 1.5) * per;
6347
+ const y2 = (value2 - min) / rangeY * height;
6348
+ const dx = x2 - x1;
6349
+ const dy = y2 - y1;
6350
+ const length = Math.sqrt(dx * dx + dy * dy);
6351
+ const nx = -dy / length * halfThickness;
6352
+ const ny = dx / length * halfThickness;
6353
+ vertices.push(x1 + nx, y1 + ny, x1 - nx, y1 - ny, x2 + nx, y2 + ny);
6354
+ vertices.push(x1 - nx, y1 - ny, x2 - nx, y2 - ny, x2 + nx, y2 + ny);
6355
+ for(let j = 0; j < 6; j++)colors.push(r, g, b, a);
6356
+ }
6357
+ return {
6358
+ vertices,
6359
+ colors
6360
+ };
6361
+ }
6362
+ generateSteplineVertices(data, color, thickness) {
6363
+ const vertices = [];
6364
+ const colors = [];
6365
+ const [r, g, b, a] = this.hexToRgba(color);
6366
+ const { range: [min, , rangeY], canvas: { width, height } } = this.state;
6367
+ const len = data.length;
6368
+ const per = width / len;
6369
+ const halfThickness = thickness / 2;
6370
+ for(let i = 0; i < len - 1; i++){
6371
+ const value1 = data[i];
6372
+ const value2 = data[i + 1];
6373
+ if (void 0 === value1 || void 0 === value2 || Number.isNaN(value1) || Number.isNaN(value2)) continue;
6374
+ const x1 = i * per;
6375
+ const y1 = (value1 - min) / rangeY * height;
6376
+ const x2 = (i + 1) * per;
6377
+ const y2 = (value2 - min) / rangeY * height;
6378
+ vertices.push(x1, y1 - halfThickness, x1, y1 + halfThickness, x2, y1 - halfThickness, x1, y1 + halfThickness, x2, y1 + halfThickness, x2, y1 - halfThickness);
6379
+ vertices.push(x2 - halfThickness, y1, x2 + halfThickness, y1, x2 - halfThickness, y2, x2 + halfThickness, y1, x2 + halfThickness, y2, x2 - halfThickness, y2);
6380
+ for(let j = 0; j < 12; j++)colors.push(r, g, b, a);
6381
+ }
6382
+ return {
6383
+ vertices,
6384
+ colors
6385
+ };
6386
+ }
6387
+ generateBarVertices(data, color, orientation) {
6388
+ const vertices = [];
6389
+ const colors = [];
6390
+ const [r, g, b, a] = this.hexToRgba(color);
6391
+ const { range: [min, , rangeY], canvas: { width, height } } = this.state;
6392
+ const len = data.length;
6393
+ if (orientation === OrientationType.Vertical) for(let i = 0; i < len; i++){
6394
+ const value = data[i];
6395
+ if (void 0 === value || Number.isNaN(value)) continue;
6396
+ const startX = Math.floor(i * width / len);
6397
+ const endX = Math.floor((i + 1) * width / len);
6398
+ const barHeight = (value - min) / rangeY * height;
6399
+ vertices.push(startX, 0, endX, 0, startX, barHeight, endX, 0, endX, barHeight, startX, barHeight);
6400
+ for(let j = 0; j < 6; j++)if (this.state.barValue2Color && this.state.CI) {
6401
+ const colorObj = this.state.CI.getColor(value);
6402
+ const [cr, cg, cb] = this.hexToRgba(colorObj.hax);
6403
+ colors.push(cr, cg, cb, a);
6404
+ } else colors.push(r, g, b, a);
6405
+ }
6406
+ else {
6407
+ const h = height / len;
6408
+ for(let i = 0; i < len; i++){
6409
+ const value = data[i];
6410
+ if (void 0 === value || Number.isNaN(value)) continue;
6411
+ const y = Math.round(height - (i + 1) * h);
6412
+ const w = (value - min) / rangeY * width;
6413
+ const x = width - w;
6414
+ const hh = Math.round(h);
6415
+ vertices.push(x, y, width, y, x, y + hh, width, y, width, y + hh, x, y + hh);
6416
+ for(let j = 0; j < 6; j++)colors.push(r, g, b, a);
6553
6417
  }
6554
6418
  }
6555
- ctx.restore();
6419
+ return {
6420
+ vertices,
6421
+ colors
6422
+ };
6423
+ }
6424
+ generateCircleVertices(data, color, thickness) {
6425
+ const vertices = [];
6426
+ const colors = [];
6427
+ const [r, g, b, a] = this.hexToRgba(color);
6428
+ const { range: [min, , rangeY], canvas: { width, height } } = this.state;
6429
+ const len = data.length;
6430
+ const per = width / len;
6431
+ const radius = thickness / 2;
6432
+ const segments = 16;
6433
+ for(let i = 0; i < len; i++){
6434
+ const value = data[i];
6435
+ if (void 0 === value || Number.isNaN(value)) continue;
6436
+ const centerX = (i + 0.5) * per;
6437
+ const centerY = (value - min) / rangeY * height;
6438
+ for(let j = 0; j < segments; j++){
6439
+ const angle1 = j / segments * 2 * Math.PI;
6440
+ const angle2 = (j + 1) / segments * 2 * Math.PI;
6441
+ vertices.push(centerX, centerY, centerX + Math.cos(angle1) * radius, centerY + Math.sin(angle1) * radius, centerX + Math.cos(angle2) * radius, centerY + Math.sin(angle2) * radius);
6442
+ for(let k = 0; k < 3; k++)colors.push(r, g, b, a);
6443
+ }
6444
+ }
6445
+ return {
6446
+ vertices,
6447
+ colors
6448
+ };
6449
+ }
6450
+ generateRectVertices(data, color, thickness) {
6451
+ const vertices = [];
6452
+ const colors = [];
6453
+ const [r, g, b, a] = this.hexToRgba(color);
6454
+ const { range: [min, , rangeY], canvas: { width, height } } = this.state;
6455
+ const len = data.length;
6456
+ const per = width / len;
6457
+ const side = thickness;
6458
+ const halfSide = side / 2;
6459
+ for(let i = 0; i < len; i++){
6460
+ const value = data[i];
6461
+ if (void 0 === value || Number.isNaN(value)) continue;
6462
+ const centerX = (i + 0.5) * per;
6463
+ const centerY = (value - min) / rangeY * height;
6464
+ vertices.push(centerX - halfSide, centerY - halfSide, centerX + halfSide, centerY - halfSide, centerX - halfSide, centerY + halfSide, centerX + halfSide, centerY - halfSide, centerX + halfSide, centerY + halfSide, centerX - halfSide, centerY + halfSide);
6465
+ for(let j = 0; j < 6; j++)colors.push(r, g, b, a);
6466
+ }
6467
+ return {
6468
+ vertices,
6469
+ colors
6470
+ };
6471
+ }
6472
+ draw() {
6473
+ const { series, gl, program, buffers } = this.state;
6474
+ if (!gl || !program || !buffers) return;
6475
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
6476
+ gl.clear(gl.COLOR_BUFFER_BIT);
6477
+ const seriesArray = Object.values(series);
6478
+ const allVertices = [];
6479
+ const allColors = [];
6480
+ for (const seriesConfig of seriesArray){
6481
+ const { display, color, type, data, orientation, thickness } = seriesConfig;
6482
+ if (!data || !display) continue;
6483
+ let result;
6484
+ switch(type){
6485
+ case GraphicType.Line:
6486
+ result = this.generateLineVertices(data, color, thickness || 1);
6487
+ this.drawLines(new Float32Array(result.vertices), new Float32Array(result.colors));
6488
+ break;
6489
+ case GraphicType.Stepline:
6490
+ result = this.generateSteplineVertices(data, color, thickness || 1);
6491
+ this.drawLines(new Float32Array(result.vertices), new Float32Array(result.colors));
6492
+ break;
6493
+ case GraphicType.Bar:
6494
+ result = this.generateBarVertices(data, color, orientation || OrientationType.Vertical);
6495
+ this.drawTriangles(new Float32Array(result.vertices), new Float32Array(result.colors));
6496
+ break;
6497
+ case GraphicType.Circle:
6498
+ result = this.generateCircleVertices(data, color, thickness || 4);
6499
+ this.drawTriangles(new Float32Array(result.vertices), new Float32Array(result.colors));
6500
+ break;
6501
+ case GraphicType.Rect:
6502
+ result = this.generateRectVertices(data, color, thickness || 3);
6503
+ this.drawTriangles(new Float32Array(result.vertices), new Float32Array(result.colors));
6504
+ break;
6505
+ }
6506
+ const vertices = result.vertices;
6507
+ const colors = result.colors;
6508
+ allVertices.push(...vertices);
6509
+ allColors.push(...colors);
6510
+ }
6511
+ if (0 === allVertices.length) return;
6512
+ this.vertexData = new Float32Array(allVertices);
6513
+ this.colorData = new Float32Array(allColors);
6514
+ gl.useProgram(program);
6515
+ const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');
6516
+ gl.uniform2f(resolutionLocation, gl.canvas.width, gl.canvas.height);
6517
+ const positionLocation = gl.getAttribLocation(program, 'a_position');
6518
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position);
6519
+ gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW);
6520
+ gl.enableVertexAttribArray(positionLocation);
6521
+ gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
6522
+ const colorLocation = gl.getAttribLocation(program, 'a_color');
6523
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color);
6524
+ gl.bufferData(gl.ARRAY_BUFFER, this.colorData, gl.STATIC_DRAW);
6525
+ gl.enableVertexAttribArray(colorLocation);
6526
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
6527
+ const vertexCount = this.vertexData.length / 2;
6528
+ gl.drawArrays(gl.TRIANGLES, 0, vertexCount);
6556
6529
  }
6557
6530
  }
6558
6531
  class IQStream {
@@ -6569,14 +6542,14 @@ class IQStream {
6569
6542
  if (!id) return;
6570
6543
  this.state.chart = new Dial({
6571
6544
  id,
6572
- ...getThemeFillStyle()
6545
+ ...(0, utils.vY)()
6573
6546
  });
6574
6547
  setTimeout(()=>{
6575
6548
  this.state.chart.resize();
6576
6549
  });
6577
6550
  __WEBPACK_EXTERNAL_MODULE__rfkit_theme_a11ca9cb__.themeObserver.subscribe(()=>{
6578
6551
  this.state.chart.updateProps({
6579
- ...getThemeFillStyle()
6552
+ ...(0, utils.vY)()
6580
6553
  });
6581
6554
  this.state.chart.resize();
6582
6555
  this.state.chart.draw();
@@ -6598,7 +6571,7 @@ class IQStream {
6598
6571
  }
6599
6572
  const Dial_Dial = ()=>{
6600
6573
  const { state: { globalID } } = useStore_useStore();
6601
- const { chart, Chart } = hooks_useChart({
6574
+ const { chart, Chart } = useChart({
6602
6575
  Render: IQStream
6603
6576
  });
6604
6577
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -6745,7 +6718,7 @@ class render_IQStream {
6745
6718
  if (!id) return;
6746
6719
  this.state.chart = new Gauge({
6747
6720
  id,
6748
- ...getThemeFillStyle(),
6721
+ ...(0, utils.vY)(),
6749
6722
  ...props
6750
6723
  });
6751
6724
  setTimeout(()=>{
@@ -6753,7 +6726,7 @@ class render_IQStream {
6753
6726
  });
6754
6727
  __WEBPACK_EXTERNAL_MODULE__rfkit_theme_a11ca9cb__.themeObserver.subscribe(()=>{
6755
6728
  this.state.chart.updateProps({
6756
- ...getThemeFillStyle()
6729
+ ...(0, utils.vY)()
6757
6730
  });
6758
6731
  this.state.chart.resize();
6759
6732
  this.state.chart.draw();
@@ -6780,7 +6753,7 @@ const Gauge_padding = 20;
6780
6753
  const Gauge_step = 2;
6781
6754
  const Gauge_Gauge = ({ onChange })=>{
6782
6755
  const { state: { globalID, axisY: { range } } } = useStore_useStore();
6783
- const { chart, Chart } = hooks_useChart({
6756
+ const { chart, Chart } = useChart({
6784
6757
  Render: render_IQStream,
6785
6758
  params: {
6786
6759
  padding: Gauge_padding,
@@ -6901,7 +6874,7 @@ const Ticks = (props)=>{
6901
6874
  for(let i = 0; i < HEATMAP_FULL_TICKS; i++){
6902
6875
  const index = Math.floor((dataLength - 1) * i / (HEATMAP_FULL_TICKS - 1));
6903
6876
  const data = waterfallData[index];
6904
- const value = data?.timestamp ? getDateTime(data.timestamp, void 0, void 0, true) : '';
6877
+ const value = data?.timestamp ? (0, utils.Fc)(data.timestamp, void 0, void 0, true) : '';
6905
6878
  values.push(value);
6906
6879
  }
6907
6880
  setTimeValues(values);
@@ -7238,7 +7211,7 @@ const FrequencyDataBoard = ({ left, updateKey, onChange })=>{
7238
7211
  if (0 === values.length) return null;
7239
7212
  index.current = Math.max(0, Math.ceil(values.length * left / 100) - 1);
7240
7213
  const level = getVirtualLevel(axisY.unit, values[index.current])?.toFixed(1);
7241
- if (!isNumberAlias(level)) return null;
7214
+ if (!(0, utils.Ri)(level)) return null;
7242
7215
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
7243
7216
  className: components_FrequencyDataBoard_styles_module.item,
7244
7217
  style: {
@@ -7386,7 +7359,7 @@ const HeatmapPopover = ({ id })=>{
7386
7359
  const newValue = yValue[xIndex];
7387
7360
  setValue(Number.isFinite(newValue) ? newValue.toFixed(1) : '');
7388
7361
  const timestamp = yValue.timestamp;
7389
- if (timestamp) setTimestamp(getDateTime(timestamp));
7362
+ if (timestamp) setTimestamp((0, utils.Fc)(timestamp));
7390
7363
  }
7391
7364
  }
7392
7365
  }
@@ -7674,7 +7647,7 @@ const EventBus_EventBus = ({ id })=>{
7674
7647
  }, [
7675
7648
  EID
7676
7649
  ]);
7677
- const handleMouseMove = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(utils_throttle((e)=>{
7650
+ const handleMouseMove = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((0, utils.P2)((e)=>{
7678
7651
  createMoveEventManager(EID)(e, calculateEventRelativePosition(e));
7679
7652
  updateCursor();
7680
7653
  if (dragState.current.isDragging && dragState.current.startPoint.event) {
@@ -7720,7 +7693,7 @@ const EventBus_EventBus = ({ id })=>{
7720
7693
  }, [
7721
7694
  EID
7722
7695
  ]);
7723
- const handleWheel = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(utils_throttle((e)=>{
7696
+ const handleWheel = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((0, utils.P2)((e)=>{
7724
7697
  createWheelEventManager(EID)(-1 * e.deltaY, calculateEventRelativePosition(e));
7725
7698
  }), [
7726
7699
  EID
@@ -7831,17 +7804,17 @@ function calculateAreaInfo({ endLeft, startLeft, startTop, endTop, frequencyForm
7831
7804
  startCol: indices.start,
7832
7805
  endCol: indices.end,
7833
7806
  startTimestamp,
7834
- startTimestampFormat: getDateTime(startTimestamp),
7807
+ startTimestampFormat: (0, utils.Fc)(startTimestamp),
7835
7808
  endTimestamp,
7836
- endTimestampFormat: getDateTime(endTimestamp),
7809
+ endTimestampFormat: (0, utils.Fc)(endTimestamp),
7837
7810
  duration,
7838
- durationFormat: getFrequencyToFixed(duration / 1000, 3),
7811
+ durationFormat: (0, utils.lj)(duration / 1000, 3),
7839
7812
  startFrequency: frequencies.start,
7840
7813
  startFrequencyFormat: String(frequencies.start),
7841
7814
  endFrequency: frequencies.end,
7842
7815
  endFrequencyFormat: String(frequencies.end),
7843
7816
  bandwidth,
7844
- bandwidthFormat: getFrequencyToFixed(bandwidth),
7817
+ bandwidthFormat: (0, utils.lj)(bandwidth),
7845
7818
  data: waterfallData.slice(indices.bottom, indices.top + 1).map((row)=>Array.from(row.slice(indices.start, indices.end + 1)))
7846
7819
  };
7847
7820
  return result;
@@ -7996,7 +7969,7 @@ const Area = (props)=>{
7996
7969
  })
7997
7970
  ]
7998
7971
  }),
7999
- isNumberAlias(info.durationFormat) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
7972
+ (0, utils.Ri)(info.durationFormat) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
8000
7973
  className: HeatmapCapture_Area_styles_module.item,
8001
7974
  children: [
8002
7975
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
@@ -8055,7 +8028,7 @@ const RowIndex = ({ id })=>{
8055
8028
  const rowData = {
8056
8029
  data: waterfallData[newRowIndex],
8057
8030
  timestamp: newTimestamp,
8058
- timestampFormat: getDateTime(newTimestamp),
8031
+ timestampFormat: (0, utils.Fc)(newTimestamp),
8059
8032
  rowIndex: newRowIndex
8060
8033
  };
8061
8034
  setInfo(rowData);
@@ -8206,9 +8179,9 @@ const Slider = ({ id })=>{
8206
8179
  const endIndex = Math.round((100 - newPosition) / 100 * (len - 1));
8207
8180
  const startIndex = Math.round((100 - (newPosition + newHeight)) / 100 * (len - 1));
8208
8181
  const startTimestamp = heatmapData[startIndex]?.timestamp;
8209
- const startTimestampFormat = getDateTime(startTimestamp);
8182
+ const startTimestampFormat = (0, utils.Fc)(startTimestamp);
8210
8183
  const endTimestamp = heatmapData[endIndex]?.timestamp;
8211
- const endTimestampFormat = getDateTime(endTimestamp);
8184
+ const endTimestampFormat = (0, utils.Fc)(endTimestamp);
8212
8185
  const duration = endTimestamp - startTimestamp;
8213
8186
  const durationFormat = (duration / 1000).toFixed(3);
8214
8187
  return {
@@ -8488,7 +8461,7 @@ const Board = ({ markers, heatmapMode, onChange })=>{
8488
8461
  children: i.frequency
8489
8462
  }),
8490
8463
  heatmapMode && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
8491
- children: i.timestamp ? `-${getDateTime(i.timestamp).slice(11)}` : ''
8464
+ children: i.timestamp ? `-${(0, utils.Fc)(i.timestamp).slice(11)}` : ''
8492
8465
  })
8493
8466
  ]
8494
8467
  }),
@@ -8791,7 +8764,7 @@ class Markers {
8791
8764
  create(e, isBatchAdd = false) {
8792
8765
  const { markers, labelCache, counter, data, heatmapMode, selectMax } = this.state;
8793
8766
  if (0 === data.length) return;
8794
- const id = createGUID();
8767
+ const id = (0, utils.SF)();
8795
8768
  const label = counter.add();
8796
8769
  if (!label) return;
8797
8770
  labelCache.push(label);
@@ -9095,7 +9068,7 @@ class FreeMarkers extends Markers {
9095
9068
  if (!data || 0 === data.length) return e;
9096
9069
  const { peak } = e;
9097
9070
  let { left, top } = e;
9098
- const { row, col } = getRowCol(data);
9071
+ const { row, col } = (0, utils.B5)(data);
9099
9072
  const splitLeft = splitZoomLeft({
9100
9073
  left,
9101
9074
  zoom,
@@ -9303,7 +9276,7 @@ class Range {
9303
9276
  ...db[SERIES.maxData.name],
9304
9277
  ...db[SERIES.minData.name]
9305
9278
  ];
9306
- const allInfo = getDimInfo(allData);
9279
+ const allInfo = (0, utils.kL)(allData);
9307
9280
  let { avg } = allInfo;
9308
9281
  if (void 0 === avg) avg = 10;
9309
9282
  let step = propsStep || axisY.step;
@@ -9430,7 +9403,7 @@ class Range {
9430
9403
  step: this.state.axisY.step,
9431
9404
  globalID: this.state.globalID
9432
9405
  });
9433
- const diff = isdBm(unit) ? v.offset : 0;
9406
+ const diff = (0, utils.Bp)(unit) ? v.offset : 0;
9434
9407
  const isExceedMin = min < restrict[0] - diff;
9435
9408
  const isExceedMax = max > restrict[1];
9436
9409
  let newMin = min;
@@ -9473,7 +9446,7 @@ const components_Ticks_Ticks = ({ ranging })=>{
9473
9446
  length: len
9474
9447
  }, (_, index)=>{
9475
9448
  const value = (restrictMax - index * step).toFixed(0);
9476
- if (!isNumberAlias(value)) return null;
9449
+ if (!(0, utils.Ri)(value)) return null;
9477
9450
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
9478
9451
  children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
9479
9452
  children: value
@@ -10158,7 +10131,7 @@ const Markers_Markers = ({ id, counter, selecter, heatmapMode = false })=>{
10158
10131
  ]);
10159
10132
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
10160
10133
  if (globalID) {
10161
- const quark = leftSegmentsFindStep(segments);
10134
+ const quark = (0, utils.f1)(segments);
10162
10135
  subscriptionKeyBus(globalID, 'marker', (e)=>{
10163
10136
  const { ctrlKey, altKey, key } = e;
10164
10137
  const { selected } = marker;
@@ -10453,7 +10426,7 @@ class render_Heatmap {
10453
10426
  const Heatmap_Heatmap = (props)=>{
10454
10427
  const { selecter, heatmapDefaultData } = props;
10455
10428
  const { state: { axisY: { realRange }, globalID } } = useStore_useStore();
10456
- const { id, chart, Chart } = hooks_useChart({
10429
+ const { id, chart, Chart } = useChart({
10457
10430
  Render: render_Heatmap,
10458
10431
  params: {
10459
10432
  realRange,
@@ -10545,7 +10518,7 @@ const Heatmap_Chart_Chart = ({ publish, heatmapDefaultData })=>{
10545
10518
  const { pstype } = e;
10546
10519
  if (pstype === constants_PSType.Heatmap) {
10547
10520
  const { data, timestamps } = e;
10548
- const waterfallData = convertToTimestampedArrays(data, timestamps);
10521
+ const waterfallData = (0, utils.P9)(data, timestamps);
10549
10522
  const db = withDatabase(globalID);
10550
10523
  db.getAllRawData = ()=>({
10551
10524
  ...getDefaultData().getAllRawData(),
@@ -10611,7 +10584,7 @@ class IQPlanisphere {
10611
10584
  }
10612
10585
  function IQEye_IQPlanisphere() {
10613
10586
  const { state: { globalID } } = useStore_useStore();
10614
- const { chart, Chart } = hooks_useChart({
10587
+ const { chart, Chart } = useChart({
10615
10588
  Render: IQPlanisphere
10616
10589
  });
10617
10590
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -10773,7 +10746,7 @@ const GridLines = ()=>{
10773
10746
  const components_GridLines = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(GridLines);
10774
10747
  const IQLine = ()=>{
10775
10748
  const { state: { axisY: { autoranging }, globalID } } = useStore_useStore();
10776
- const { chart, Chart } = hooks_useChart({
10749
+ const { chart, Chart } = useChart({
10777
10750
  Render: Spectrum,
10778
10751
  params: {
10779
10752
  autoranging
@@ -10806,7 +10779,7 @@ const IQLine = ()=>{
10806
10779
  {
10807
10780
  const { IData, QData } = d;
10808
10781
  if (IData && QData) {
10809
- const { min, max } = getDimInfo([
10782
+ const { min, max } = (0, utils.kL)([
10810
10783
  ...IData,
10811
10784
  ...QData
10812
10785
  ]);
@@ -10877,7 +10850,7 @@ class render_IQPlanisphere {
10877
10850
  }
10878
10851
  function IQPlanisphere_IQPlanisphere() {
10879
10852
  const { state: { globalID } } = useStore_useStore();
10880
- const { chart, Chart } = hooks_useChart({
10853
+ const { chart, Chart } = useChart({
10881
10854
  Render: render_IQPlanisphere
10882
10855
  });
10883
10856
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -10938,7 +10911,7 @@ class IQStream_render_IQStream {
10938
10911
  }
10939
10912
  const IQStream_IQStream = ()=>{
10940
10913
  const { state: { globalID } } = useStore_useStore();
10941
- const { chart, Chart } = hooks_useChart({
10914
+ const { chart, Chart } = useChart({
10942
10915
  Render: IQStream_render_IQStream
10943
10916
  });
10944
10917
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -11003,405 +10976,975 @@ const IQ_Chart_Chart = (props)=>{
11003
10976
  }
11004
10977
  }
11005
10978
  });
11006
- const Chart = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
11007
- switch(type){
11008
- case constants_ChartType.IQEye:
11009
- return IQEye_IQPlanisphere;
11010
- case constants_ChartType.IQLine:
11011
- return modules_IQLine;
11012
- case constants_ChartType.IQPlanisphere:
11013
- return IQPlanisphere_IQPlanisphere;
11014
- case constants_ChartType.IQStream:
11015
- return modules_IQStream;
11016
- default:
11017
- return IQPlanisphere_IQPlanisphere;
11018
- }
10979
+ const Chart = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
10980
+ switch(type){
10981
+ case constants_ChartType.IQEye:
10982
+ return IQEye_IQPlanisphere;
10983
+ case constants_ChartType.IQLine:
10984
+ return modules_IQLine;
10985
+ case constants_ChartType.IQPlanisphere:
10986
+ return IQPlanisphere_IQPlanisphere;
10987
+ case constants_ChartType.IQStream:
10988
+ return modules_IQStream;
10989
+ default:
10990
+ return IQPlanisphere_IQPlanisphere;
10991
+ }
10992
+ }, [
10993
+ type
10994
+ ]);
10995
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Container, {
10996
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {})
10997
+ });
10998
+ };
10999
+ const IQ_Chart = IQ_Chart_Chart;
11000
+ const IQChart = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(store, {
11001
+ system: {
11002
+ padding: false,
11003
+ border: false
11004
+ },
11005
+ ...props,
11006
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(IQ_Chart, {
11007
+ ...props
11008
+ })
11009
+ });
11010
+ const IQ_IQ = withChartPublisher(IQChart, 'IQ');
11011
+ const lib_IQ = IQ_IQ;
11012
+ function uselevelStreamAnalyzer() {
11013
+ const { state: { globalID, axisY: { range }, levelStream: { cacheTime, granularity } } } = useStore_useStore();
11014
+ const analyzer = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
11015
+ const globalIDRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(globalID);
11016
+ const updateLevelStreamData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((renderData)=>{
11017
+ tools(globalIDRef.current, constants_ModuleType.Spectrum)({
11018
+ pstype: constants_PSType.Render,
11019
+ data: {
11020
+ [REAL_DATA_NAME]: renderData.spectrumData
11021
+ }
11022
+ });
11023
+ tools(globalIDRef.current, constants_ModuleType.LevelStream)({
11024
+ pstype: constants_PSType.Render,
11025
+ data: renderData.probabilityRangeData
11026
+ });
11027
+ }, []);
11028
+ const handleLevelStreamUpdate = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((data)=>{
11029
+ const { probabilityRangeData, spectrumData } = data;
11030
+ updateLevelStreamData({
11031
+ probabilityRangeData,
11032
+ spectrumData
11033
+ });
11034
+ }, [
11035
+ updateLevelStreamData
11036
+ ]);
11037
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11038
+ globalIDRef.current = globalID;
11039
+ }, [
11040
+ globalID
11041
+ ]);
11042
+ if (!analyzer.current && globalID) {
11043
+ analyzer.current = new __WEBPACK_EXTERNAL_MODULE__rfkit_spectrum_analyzer_159ab12b__.LevelStreamAnalyzer({
11044
+ range,
11045
+ cacheTime: cacheTime,
11046
+ granularity: granularity,
11047
+ onLevelStreamUpdate: handleLevelStreamUpdate
11048
+ });
11049
+ const key = 'levelStream';
11050
+ const { line: color } = getConfig(key);
11051
+ tools(globalID, constants_ModuleType.Spectrum)({
11052
+ pstype: constants_PSType.Series,
11053
+ name: REAL_DATA_NAME,
11054
+ color
11055
+ });
11056
+ }
11057
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11058
+ analyzer.current?.setConfig({
11059
+ range
11060
+ });
11061
+ }, [
11062
+ range
11063
+ ]);
11064
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11065
+ analyzer.current?.setConfig({
11066
+ cacheTime: cacheTime
11067
+ });
11068
+ }, [
11069
+ cacheTime
11070
+ ]);
11071
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11072
+ analyzer.current?.setConfig({
11073
+ granularity: granularity
11074
+ });
11075
+ }, [
11076
+ granularity
11077
+ ]);
11078
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11079
+ analyzer.current?.setConfig({
11080
+ onLevelStreamUpdate: handleLevelStreamUpdate
11081
+ });
11082
+ }, [
11083
+ handleLevelStreamUpdate
11084
+ ]);
11085
+ return {
11086
+ analyzer: analyzer.current,
11087
+ updateLevelStreamData
11088
+ };
11089
+ }
11090
+ class Occupancy {
11091
+ state;
11092
+ constructor(props){
11093
+ this.state = {
11094
+ chart: null,
11095
+ orientation: type_OrientationType.Vertical,
11096
+ ...props
11097
+ };
11098
+ this.init();
11099
+ }
11100
+ init() {
11101
+ const { id, orientation } = this.state;
11102
+ const colors = [
11103
+ ...getGradient()
11104
+ ].reverse().map((c)=>hexToRGBA(c));
11105
+ const chart = new Series({
11106
+ id,
11107
+ series: [
11108
+ {
11109
+ name: 'bar',
11110
+ type: 'bar',
11111
+ display: true,
11112
+ color: getConfig('bar'),
11113
+ orientation
11114
+ }
11115
+ ],
11116
+ range: [
11117
+ 0,
11118
+ 100
11119
+ ],
11120
+ barValue2Color: true,
11121
+ colors
11122
+ });
11123
+ this.state.chart = chart;
11124
+ }
11125
+ updateSeries(data) {
11126
+ const { chart } = this.state;
11127
+ chart.render({
11128
+ name: 'bar',
11129
+ data
11130
+ });
11131
+ }
11132
+ reset() {
11133
+ this.resize();
11134
+ this.clear();
11135
+ }
11136
+ resize() {
11137
+ this.state.chart.resize();
11138
+ }
11139
+ clear() {
11140
+ this.state.chart.clear();
11141
+ }
11142
+ }
11143
+ const Level_Level = (props)=>{
11144
+ const { state: { axisY, globalID } } = useStore_useStore();
11145
+ const { opacity } = props;
11146
+ const { chart, Chart } = useChart({
11147
+ Render: Occupancy,
11148
+ params: {
11149
+ orientation: type_OrientationType.Horizontal
11150
+ }
11151
+ });
11152
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11153
+ if (chart && globalID) tools(globalID, constants_ModuleType.LevelStream, (d)=>{
11154
+ const { data } = d;
11155
+ if (data) chart.updateSeries(data);
11156
+ });
11019
11157
  }, [
11020
- type
11158
+ chart,
11159
+ globalID
11021
11160
  ]);
11022
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Container, {
11023
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {})
11161
+ const style = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
11162
+ opacity,
11163
+ zIndex: 1
11164
+ }), [
11165
+ axisY,
11166
+ opacity
11167
+ ]);
11168
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {
11169
+ style: style
11024
11170
  });
11025
11171
  };
11026
- const IQ_Chart = IQ_Chart_Chart;
11027
- const IQChart = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(store, {
11028
- system: {
11029
- padding: false,
11030
- border: false
11031
- },
11032
- ...props,
11033
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(IQ_Chart, {
11034
- ...props
11035
- })
11036
- });
11037
- const IQ_IQ = withChartPublisher(IQChart, 'IQ');
11038
- const lib_IQ = IQ_IQ;
11039
- function uselevelStreamAnalyzer() {
11040
- const { state: { globalID, axisY: { range }, levelStream: { cacheTime, granularity } } } = useStore_useStore();
11041
- const analyzer = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
11042
- const globalIDRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(globalID);
11043
- const updateLevelStreamData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((renderData)=>{
11044
- tools(globalIDRef.current, constants_ModuleType.Spectrum)({
11045
- pstype: constants_PSType.Render,
11046
- data: {
11047
- [REAL_DATA_NAME]: renderData.spectrumData
11172
+ const Level = Level_Level;
11173
+ var Band_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/Band/styles.module.less");
11174
+ var Band_styles_module_options = {};
11175
+ Band_styles_module_options.styleTagTransform = styleTagTransform_default();
11176
+ Band_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
11177
+ Band_styles_module_options.insert = insertBySelector_default().bind(null, "head");
11178
+ Band_styles_module_options.domAPI = styleDomAPI_default();
11179
+ Band_styles_module_options.insertStyleElement = insertStyleElement_default();
11180
+ injectStylesIntoStyleTag_default()(Band_styles_module.Z, Band_styles_module_options);
11181
+ const components_Band_styles_module = Band_styles_module.Z && Band_styles_module.Z.locals ? Band_styles_module.Z.locals : void 0;
11182
+ function useBand() {
11183
+ const { state: { band }, dispatch } = useStore_useStore();
11184
+ const setBand = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((e)=>{
11185
+ const { show = true, width = 0 } = e;
11186
+ dispatch({
11187
+ payload: {
11188
+ band: {
11189
+ ...band,
11190
+ show,
11191
+ width
11192
+ }
11048
11193
  }
11049
11194
  });
11050
- tools(globalIDRef.current, constants_ModuleType.LevelStream)({
11051
- pstype: constants_PSType.Render,
11052
- data: renderData.probabilityRangeData
11053
- });
11054
- }, []);
11055
- const handleLevelStreamUpdate = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((data)=>{
11056
- const { probabilityRangeData, spectrumData } = data;
11057
- updateLevelStreamData({
11058
- probabilityRangeData,
11059
- spectrumData
11060
- });
11061
- }, [
11062
- updateLevelStreamData
11063
- ]);
11064
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11065
- globalIDRef.current = globalID;
11066
11195
  }, [
11067
- globalID
11196
+ band
11068
11197
  ]);
11069
- if (!analyzer.current && globalID) {
11070
- analyzer.current = new __WEBPACK_EXTERNAL_MODULE__rfkit_spectrum_analyzer_159ab12b__.LevelStreamAnalyzer({
11071
- range,
11072
- cacheTime: cacheTime,
11073
- granularity: granularity,
11074
- onLevelStreamUpdate: handleLevelStreamUpdate
11075
- });
11076
- const key = 'levelStream';
11077
- const { line: color } = getConfig(key);
11078
- tools(globalID, constants_ModuleType.Spectrum)({
11079
- pstype: constants_PSType.Series,
11080
- name: REAL_DATA_NAME,
11081
- color
11198
+ return setBand;
11199
+ }
11200
+ const Band_Band = ()=>{
11201
+ const { state: { band: { show, width, left, color } } } = useStore_useStore();
11202
+ if (!show) return null;
11203
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Zoom_ZoomOffsetContainer, {
11204
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11205
+ className: components_Band_styles_module.band,
11206
+ style: {
11207
+ left: void 0 !== left ? `${left}%` : `calc(50% - ${width / 2}%)`,
11208
+ width: `${width}%`,
11209
+ backgroundColor: `${color}15`,
11210
+ borderColor: `${color}`
11211
+ }
11212
+ })
11213
+ });
11214
+ };
11215
+ const Band = Band_Band;
11216
+ var DragFrame_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/DragFrame/styles.module.less");
11217
+ var DragFrame_styles_module_options = {};
11218
+ DragFrame_styles_module_options.styleTagTransform = styleTagTransform_default();
11219
+ DragFrame_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
11220
+ DragFrame_styles_module_options.insert = insertBySelector_default().bind(null, "head");
11221
+ DragFrame_styles_module_options.domAPI = styleDomAPI_default();
11222
+ DragFrame_styles_module_options.insertStyleElement = insertStyleElement_default();
11223
+ injectStylesIntoStyleTag_default()(DragFrame_styles_module.Z, DragFrame_styles_module_options);
11224
+ const components_DragFrame_styles_module = DragFrame_styles_module.Z && DragFrame_styles_module.Z.locals ? DragFrame_styles_module.Z.locals : void 0;
11225
+ const maxIndexSegments2FrequencyBandwidth = ({ frequencyLeft, segments })=>(0, utils.Ax)(segments)(frequencyLeft);
11226
+ const startEnd2AnalyseFrequencyBandwidth = ({ e, zoom, segments, onChange, globalID })=>{
11227
+ const { realData } = withDatabase(globalID).getAllRawData();
11228
+ if (!realData) return;
11229
+ const len = realData.length;
11230
+ const { interval: { start: outsideStart, end: outsideEnd } } = zoom;
11231
+ const potintLen = outsideEnd - outsideStart;
11232
+ const { left: startLeft } = e;
11233
+ const endLeft = e.left + e.width;
11234
+ const left = convertCoordToVisualLeft({
11235
+ coord: e,
11236
+ segments,
11237
+ zoom
11238
+ });
11239
+ const right = convertCoordToVisualLeft({
11240
+ coord: {
11241
+ left: endLeft
11242
+ },
11243
+ segments,
11244
+ zoom
11245
+ });
11246
+ const start = Math.max(0, Math.ceil(len * left / 100) - 1);
11247
+ const end = Math.ceil(len * right / 100);
11248
+ const { maxIndex } = (0, utils.kL)(Array.from(realData.slice(start, end)));
11249
+ const frequencyLeft = (outsideStart + (start + maxIndex + 1) / len * potintLen) * 100 / segments.totalPoints;
11250
+ const frequency = maxIndexSegments2FrequencyBandwidth({
11251
+ frequencyLeft,
11252
+ segments
11253
+ });
11254
+ const bandwidth = Math.round(1000 * (0, utils.r2)({
11255
+ segments,
11256
+ endLeft,
11257
+ startLeft
11258
+ }));
11259
+ onChange({
11260
+ frequency,
11261
+ bandwidth,
11262
+ left,
11263
+ right
11264
+ });
11265
+ };
11266
+ const DragFrame_COMPONENT_KEY = constants_ToolType.DragFrame;
11267
+ const DragFrame = ({ id })=>{
11268
+ const { state: { zoom, segments, signalAnalysis, globalID }, dispatch } = useStore_useStore();
11269
+ const [frameState, setFrameState] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
11270
+ const onChange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((e, isSignalAnalysis = false)=>{
11271
+ if (signalAnalysis.show && signalAnalysis.display && isSignalAnalysis) return void startEnd2AnalyseFrequencyBandwidth({
11272
+ e,
11273
+ zoom,
11274
+ segments,
11275
+ onChange: signalAnalysis.onChange,
11276
+ globalID
11082
11277
  });
11083
- }
11084
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11085
- analyzer.current?.setConfig({
11086
- range
11278
+ dispatch({
11279
+ payload: {
11280
+ zoom: {
11281
+ ...zoom,
11282
+ interval: e.interval,
11283
+ isScanSegmentsUpdateMagnify: e.isScanSegmentsUpdateMagnify
11284
+ }
11285
+ }
11087
11286
  });
11088
11287
  }, [
11089
- range
11288
+ signalAnalysis,
11289
+ zoom,
11290
+ segments,
11291
+ globalID
11090
11292
  ]);
11091
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11092
- analyzer.current?.setConfig({
11093
- cacheTime: cacheTime
11293
+ const filterFrameState = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((startCoords, endCoords, _, isEventButtonsRight)=>{
11294
+ if (startCoords && endCoords && isEventButtonsRight) {
11295
+ const diffX = endCoords.left - startCoords.left;
11296
+ setFrameState({
11297
+ diffX,
11298
+ left: diffX > 0 ? startCoords.left : endCoords.left,
11299
+ width: Math.abs(diffX),
11300
+ isScanSegmentsUpdateMagnify: diffX > 0
11301
+ });
11302
+ }
11303
+ }, []);
11304
+ const handleFrameRender = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
11305
+ if (!frameState) return;
11306
+ const { left, width, isScanSegmentsUpdateMagnify, diffX } = frameState;
11307
+ const { totalPoints } = segments;
11308
+ if (isScanSegmentsUpdateMagnify && diffX > 0) {
11309
+ const nextPoint = 2 * Math.ceil(width / 100 * totalPoints / 2);
11310
+ const start = Math.round(totalPoints * left / 100) - 1;
11311
+ const end = nextPoint + start - 1;
11312
+ if (nextPoint > 10) onChange({
11313
+ interval: {
11314
+ start,
11315
+ end
11316
+ },
11317
+ isScanSegmentsUpdateMagnify,
11318
+ left,
11319
+ width
11320
+ }, true);
11321
+ }
11322
+ if (diffX < 0) onChange({
11323
+ interval: {
11324
+ start: 0,
11325
+ end: totalPoints - 1
11326
+ },
11327
+ isScanSegmentsUpdateMagnify,
11328
+ left,
11329
+ width
11094
11330
  });
11095
11331
  }, [
11096
- cacheTime
11332
+ frameState,
11333
+ segments,
11334
+ zoom.interval.end,
11335
+ onChange
11097
11336
  ]);
11098
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11099
- analyzer.current?.setConfig({
11100
- granularity: granularity
11101
- });
11337
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11338
+ if (zoom.show) {
11339
+ const reset = ()=>{
11340
+ setFrameState(null);
11341
+ resetEventLevel(id, DragFrame_COMPONENT_KEY);
11342
+ };
11343
+ createMouseDownEventManager(id, DragFrame_COMPONENT_KEY, reset);
11344
+ createMouseUpEventManager(id, DragFrame_COMPONENT_KEY, ()=>{
11345
+ handleFrameRender();
11346
+ reset();
11347
+ });
11348
+ createMouseLeaveEventManager(id, DragFrame_COMPONENT_KEY, reset);
11349
+ createDragEventManager(id, DragFrame_COMPONENT_KEY, (...args)=>{
11350
+ if (compareEventPriority(id, DragFrame_COMPONENT_KEY)) filterFrameState(args[0], args[1], args[2], args[3]);
11351
+ });
11352
+ }
11102
11353
  }, [
11103
- granularity
11354
+ zoom.show,
11355
+ id,
11356
+ handleFrameRender,
11357
+ filterFrameState
11104
11358
  ]);
11105
11359
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11106
- analyzer.current?.setConfig({
11107
- onLevelStreamUpdate: handleLevelStreamUpdate
11108
- });
11360
+ if (!frameState) resetEventLevel(id, DragFrame_COMPONENT_KEY);
11109
11361
  }, [
11110
- handleLevelStreamUpdate
11362
+ frameState,
11363
+ id
11111
11364
  ]);
11365
+ if (!zoom.show) return null;
11366
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Zoom_ZoomOffsetContainer, {
11367
+ className: components_DragFrame_styles_module.DragFrame,
11368
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11369
+ className: `${components_DragFrame_styles_module.frame} ${frameState?.isScanSegmentsUpdateMagnify ? '' : components_DragFrame_styles_module.bias}`,
11370
+ style: frameState ? {
11371
+ left: `${frameState.left}%`,
11372
+ width: `${frameState.width}%`
11373
+ } : {}
11374
+ })
11375
+ });
11376
+ };
11377
+ const components_DragFrame = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(DragFrame);
11378
+ const originalColors = [
11379
+ '#B22222',
11380
+ '#CD5C5C',
11381
+ '#FF6347',
11382
+ '#FA8072',
11383
+ '#F08080',
11384
+ '#A0522D',
11385
+ '#FF4500',
11386
+ '#FF7F50',
11387
+ '#B8860B',
11388
+ '#FFA500',
11389
+ '#808000',
11390
+ '#9ACD32',
11391
+ '#32CD32',
11392
+ '#8FBC8F',
11393
+ '#2E8B57',
11394
+ '#3CB371',
11395
+ '#00FA9A',
11396
+ '#66CDAA',
11397
+ '#7FFFD4',
11398
+ '#2F4F4F',
11399
+ '#008080',
11400
+ '#00CED1',
11401
+ '#20B2AA',
11402
+ '#48D1CC',
11403
+ '#4682B4',
11404
+ '#778899',
11405
+ '#87CEFA',
11406
+ '#4169E1',
11407
+ '#4169E1',
11408
+ '#6495ED',
11409
+ '#483D8B',
11410
+ '#6A5ACD',
11411
+ '#7B68EE',
11412
+ '#9370DB',
11413
+ '#9370DB',
11414
+ '#9932CC',
11415
+ '#8A2BE2',
11416
+ '#BA55D3',
11417
+ '#800080',
11418
+ '#DDA0DD',
11419
+ '#C71585',
11420
+ '#DC143C'
11421
+ ];
11422
+ function hexToHsl(hex) {
11423
+ const r = parseInt(hex.slice(1, 3), 16) / 255;
11424
+ const g = parseInt(hex.slice(3, 5), 16) / 255;
11425
+ const b = parseInt(hex.slice(5, 7), 16) / 255;
11426
+ const max = Math.max(r, g, b);
11427
+ const min = Math.min(r, g, b);
11428
+ let h = 0;
11429
+ let s = 0;
11430
+ const l = (max + min) / 2;
11431
+ if (max !== min) {
11432
+ const d = max - min;
11433
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
11434
+ switch(max){
11435
+ case r:
11436
+ h = (g - b) / d + (g < b ? 6 : 0);
11437
+ break;
11438
+ case g:
11439
+ h = (b - r) / d + 2;
11440
+ break;
11441
+ case b:
11442
+ h = (r - g) / d + 4;
11443
+ break;
11444
+ }
11445
+ h /= 6;
11446
+ }
11112
11447
  return {
11113
- analyzer: analyzer.current,
11114
- updateLevelStreamData
11448
+ h: 360 * h,
11449
+ s: 100 * s,
11450
+ l: 100 * l
11115
11451
  };
11116
11452
  }
11117
- class Occupancy {
11118
- state;
11119
- constructor(props){
11120
- this.state = {
11121
- chart: null,
11122
- orientation: type_OrientationType.Vertical,
11123
- ...props
11453
+ const sortedColors = [
11454
+ ...originalColors
11455
+ ].map((color)=>({
11456
+ color,
11457
+ hsl: hexToHsl(color)
11458
+ })).sort((a, b)=>{
11459
+ if (Math.abs(a.hsl.h - b.hsl.h) > 10) return a.hsl.h - b.hsl.h;
11460
+ return a.hsl.l - b.hsl.l;
11461
+ }).map((item)=>item.color);
11462
+ function sortAndRecolorFrequencyAllocationData(data) {
11463
+ const sortedData = [
11464
+ ...data
11465
+ ].sort((a, b)=>Number(a.startFrequency) - Number(b.startFrequency));
11466
+ return sortedData.map((item, index)=>{
11467
+ const totalBands = sortedData.length;
11468
+ const colorCount = sortedColors.length;
11469
+ const startColorIndex = Math.floor(index / totalBands * colorCount);
11470
+ const endColorIndex = Math.floor((index + 1) / totalBands * colorCount);
11471
+ const startColor = sortedColors[Math.min(startColorIndex, colorCount - 1)];
11472
+ const endColor = sortedColors[Math.min(endColorIndex, colorCount - 1)];
11473
+ const finalEndColor = index === totalBands - 1 ? sortedColors[colorCount - 1] : endColor;
11474
+ return {
11475
+ ...item,
11476
+ color: startColor,
11477
+ gradientColors: [
11478
+ startColor,
11479
+ finalEndColor
11480
+ ]
11124
11481
  };
11125
- this.init();
11126
- }
11127
- init() {
11128
- const { id, orientation } = this.state;
11129
- const colors = [
11130
- ...getGradient()
11131
- ].reverse().map((c)=>hexToRGBA(c));
11132
- const chart = new Series({
11133
- id,
11134
- series: [
11135
- {
11136
- name: 'bar',
11137
- type: 'bar',
11138
- display: true,
11139
- color: getConfig('bar'),
11140
- orientation
11141
- }
11142
- ],
11143
- range: [
11144
- 0,
11145
- 100
11146
- ],
11147
- barValue2Color: true,
11148
- colors
11149
- });
11150
- this.state.chart = chart;
11151
- }
11152
- updateSeries(data) {
11153
- const { chart } = this.state;
11154
- chart.render({
11155
- name: 'bar',
11156
- data
11157
- });
11158
- }
11159
- reset() {
11160
- this.resize();
11161
- this.clear();
11162
- }
11163
- resize() {
11164
- this.state.chart.resize();
11165
- }
11166
- clear() {
11167
- this.state.chart.clear();
11482
+ });
11483
+ }
11484
+ const FrequencyAllocation_data = [
11485
+ {
11486
+ startFrequency: 87,
11487
+ stopFrequency: 108,
11488
+ stepFrequency: 100,
11489
+ bandwidth: 150,
11490
+ modulation: 'AM',
11491
+ demodulation: "\u4E0D\u89E3\u8C03",
11492
+ status: "\u5408\u6CD5",
11493
+ title: "FM\u5E7F\u64AD",
11494
+ description: "FM\u8C03\u9891\u5E7F\u64AD\u9891\u6BB5\uFF0C\u7528\u4E8E\u97F3\u9891\u5E7F\u64AD\u670D\u52A1"
11495
+ },
11496
+ {
11497
+ startFrequency: 108,
11498
+ stopFrequency: 118,
11499
+ stepFrequency: 50,
11500
+ bandwidth: 100,
11501
+ modulation: 'FM',
11502
+ demodulation: "\u89E3\u8C03",
11503
+ status: "\u5408\u6CD5",
11504
+ title: "\u822A\u7A7A\u5BFC\u822A",
11505
+ description: "\u822A\u7A7A\u65E0\u7EBF\u7535\u5BFC\u822A\u9891\u6BB5\uFF0C\u7528\u4E8E\u4EEA\u8868\u7740\u9646\u7CFB\u7EDF\u7B49"
11506
+ },
11507
+ {
11508
+ startFrequency: 118,
11509
+ stopFrequency: 137,
11510
+ stepFrequency: 25,
11511
+ bandwidth: 50,
11512
+ modulation: 'AM',
11513
+ demodulation: "\u89E3\u8C03",
11514
+ status: "\u5408\u6CD5",
11515
+ title: "\u822A\u7A7A\u8BED\u97F3\u901A\u4FE1",
11516
+ description: "\u6C11\u7528\u822A\u7A7A\u8BED\u97F3\u901A\u4FE1\u9891\u6BB5"
11517
+ },
11518
+ {
11519
+ startFrequency: 121,
11520
+ stopFrequency: 122,
11521
+ stepFrequency: 25,
11522
+ bandwidth: 50,
11523
+ modulation: 'FM',
11524
+ demodulation: "\u89E3\u8C03",
11525
+ status: "\u5408\u6CD5",
11526
+ title: "\u7D27\u6025\u901A\u4FE1",
11527
+ description: "\u7D27\u6025\u60C5\u51B5\u901A\u4FE1\u4E13\u7528\u9891\u6BB5"
11528
+ },
11529
+ {
11530
+ startFrequency: 136,
11531
+ stopFrequency: 174,
11532
+ stepFrequency: 25,
11533
+ bandwidth: 50,
11534
+ modulation: 'FM',
11535
+ demodulation: "\u89E3\u8C03",
11536
+ status: "\u5408\u6CD5",
11537
+ title: "\u5BF9\u8BB2\u901A\u4FE1",
11538
+ description: "\u4E13\u4E1A\u65E0\u7EBF\u5BF9\u8BB2\u901A\u4FE1\u9891\u6BB5"
11539
+ },
11540
+ {
11541
+ startFrequency: 161,
11542
+ stopFrequency: 162,
11543
+ stepFrequency: 25,
11544
+ bandwidth: 50,
11545
+ modulation: 'GMSK',
11546
+ demodulation: "\u89E3\u8C03",
11547
+ status: "\u5408\u6CD5",
11548
+ title: "AIS\u8239\u8236\u901A\u4FE1",
11549
+ description: "\u8239\u8236\u81EA\u52A8\u8BC6\u522B\u7CFB\u7EDF(AIS)\u4E13\u7528\u9891\u6BB5"
11550
+ },
11551
+ {
11552
+ startFrequency: 351,
11553
+ stopFrequency: 400,
11554
+ stepFrequency: 25,
11555
+ bandwidth: 50,
11556
+ modulation: 'FM',
11557
+ demodulation: "\u89E3\u8C03",
11558
+ status: "\u5408\u6CD5",
11559
+ title: "\u96C6\u7FA4\u901A\u4FE1",
11560
+ description: "\u4E13\u4E1A\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF\u9891\u6BB5"
11561
+ },
11562
+ {
11563
+ startFrequency: 400,
11564
+ stopFrequency: 470,
11565
+ stepFrequency: 25,
11566
+ bandwidth: 50,
11567
+ modulation: 'FM',
11568
+ demodulation: "\u89E3\u8C03",
11569
+ status: "\u5408\u6CD5",
11570
+ title: "\u4E13\u4E1A\u5BF9\u8BB2",
11571
+ description: "\u4E13\u4E1A\u65E0\u7EBF\u5BF9\u8BB2\u901A\u4FE1\u9891\u6BB5"
11572
+ },
11573
+ {
11574
+ startFrequency: 534,
11575
+ stopFrequency: 542,
11576
+ stepFrequency: 100,
11577
+ bandwidth: 8000,
11578
+ modulation: 'OFDM',
11579
+ demodulation: "\u89E3\u8C03",
11580
+ status: "\u5408\u6CD5",
11581
+ title: "\u6570\u5B57\u7535\u89C6",
11582
+ description: "\u6570\u5B57\u7535\u89C6\u5E7F\u64AD\u9891\u6BB5"
11583
+ },
11584
+ {
11585
+ startFrequency: 622,
11586
+ stopFrequency: 630,
11587
+ stepFrequency: 100,
11588
+ bandwidth: 8000,
11589
+ modulation: 'OFDM',
11590
+ demodulation: "\u89E3\u8C03",
11591
+ status: "\u5408\u6CD5",
11592
+ title: "\u6570\u5B57\u7535\u89C6",
11593
+ description: "\u6570\u5B57\u7535\u89C6\u5E7F\u64AD\u9891\u6BB5"
11594
+ },
11595
+ {
11596
+ startFrequency: 703,
11597
+ stopFrequency: 733,
11598
+ stepFrequency: 100,
11599
+ bandwidth: 30000,
11600
+ modulation: 'OFDMA',
11601
+ demodulation: "\u89E3\u8C03",
11602
+ status: "\u5408\u6CD5",
11603
+ title: "5G\u4E0A\u884C(\u5E7F\u7535/\u79FB\u52A8)",
11604
+ description: "\u5E7F\u7535\u548C\u79FB\u52A85G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11605
+ },
11606
+ {
11607
+ startFrequency: 758,
11608
+ stopFrequency: 788,
11609
+ stepFrequency: 100,
11610
+ bandwidth: 30000,
11611
+ modulation: 'OFDMA',
11612
+ demodulation: "\u89E3\u8C03",
11613
+ status: "\u5408\u6CD5",
11614
+ title: "5G\u4E0B\u884C(\u5E7F\u7535/\u79FB\u52A8)",
11615
+ description: "\u5E7F\u7535\u548C\u79FB\u52A85G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11616
+ },
11617
+ {
11618
+ startFrequency: 806,
11619
+ stopFrequency: 821,
11620
+ stepFrequency: 25,
11621
+ bandwidth: 50,
11622
+ modulation: "\u03C0/4DQPSK",
11623
+ demodulation: "\u89E3\u8C03",
11624
+ status: "\u5408\u6CD5",
11625
+ title: "\u6570\u5B57\u96C6\u7FA4\u4E0A\u884C",
11626
+ description: "\u6570\u5B57\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF(TETRA)\u4E0A\u884C\u9891\u6BB5"
11627
+ },
11628
+ {
11629
+ startFrequency: 824,
11630
+ stopFrequency: 835,
11631
+ stepFrequency: 100,
11632
+ bandwidth: 5000,
11633
+ modulation: 'QPSK',
11634
+ demodulation: "\u89E3\u8C03",
11635
+ status: "\u5408\u6CD5",
11636
+ title: "\u7535\u4FE13G/4G/5G\u4E0A\u884C",
11637
+ description: "\u4E2D\u56FD\u7535\u4FE13G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11638
+ },
11639
+ {
11640
+ startFrequency: 851,
11641
+ stopFrequency: 866,
11642
+ stepFrequency: 25,
11643
+ bandwidth: 50,
11644
+ modulation: "\u03C0/4DQPSK",
11645
+ demodulation: "\u89E3\u8C03",
11646
+ status: "\u5408\u6CD5",
11647
+ title: "\u6570\u5B57\u96C6\u7FA4\u4E0B\u884C",
11648
+ description: "\u6570\u5B57\u96C6\u7FA4\u901A\u4FE1\u7CFB\u7EDF(TETRA)\u4E0B\u884C\u9891\u6BB5"
11649
+ },
11650
+ {
11651
+ startFrequency: 869,
11652
+ stopFrequency: 880,
11653
+ stepFrequency: 100,
11654
+ bandwidth: 5000,
11655
+ modulation: 'QPSK',
11656
+ demodulation: "\u89E3\u8C03",
11657
+ status: "\u5408\u6CD5",
11658
+ title: "\u7535\u4FE13G/4G/5G\u4E0B\u884C",
11659
+ description: "\u4E2D\u56FD\u7535\u4FE13G/4G/5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11660
+ },
11661
+ {
11662
+ startFrequency: 885,
11663
+ stopFrequency: 889,
11664
+ stepFrequency: 200,
11665
+ bandwidth: 200,
11666
+ modulation: 'GMSK',
11667
+ demodulation: "\u89E3\u8C03",
11668
+ status: "\u5408\u6CD5",
11669
+ title: "GSM-R\u4E0A\u884C",
11670
+ description: "\u94C1\u8DEF\u4E13\u7528GSM-R\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11671
+ },
11672
+ {
11673
+ startFrequency: 889,
11674
+ stopFrequency: 904,
11675
+ stepFrequency: 200,
11676
+ bandwidth: 200,
11677
+ modulation: 'GMSK',
11678
+ demodulation: "\u89E3\u8C03",
11679
+ status: "\u5408\u6CD5",
11680
+ title: "\u79FB\u52A82G/4G\u4E0A\u884C",
11681
+ description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11682
+ },
11683
+ {
11684
+ startFrequency: 904,
11685
+ stopFrequency: 915,
11686
+ stepFrequency: 200,
11687
+ bandwidth: 200,
11688
+ modulation: 'QPSK',
11689
+ demodulation: "\u89E3\u8C03",
11690
+ status: "\u5408\u6CD5",
11691
+ title: "\u8054\u901A2/3/4/5G\u4E0A\u884C",
11692
+ description: "\u4E2D\u56FD\u8054\u901A2G/3G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11693
+ },
11694
+ {
11695
+ startFrequency: 930,
11696
+ stopFrequency: 934,
11697
+ stepFrequency: 200,
11698
+ bandwidth: 200,
11699
+ modulation: 'GMSK',
11700
+ demodulation: "\u89E3\u8C03",
11701
+ status: "\u5408\u6CD5",
11702
+ title: "GSM-R\u4E0B\u884C",
11703
+ description: "\u94C1\u8DEF\u4E13\u7528GSM-R\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11704
+ },
11705
+ {
11706
+ startFrequency: 934,
11707
+ stopFrequency: 949,
11708
+ stepFrequency: 200,
11709
+ bandwidth: 200,
11710
+ modulation: 'GMSK',
11711
+ demodulation: "\u89E3\u8C03",
11712
+ status: "\u5408\u6CD5",
11713
+ title: "\u79FB\u52A82G/4G\u4E0B\u884C",
11714
+ description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11715
+ },
11716
+ {
11717
+ startFrequency: 949,
11718
+ stopFrequency: 960,
11719
+ stepFrequency: 200,
11720
+ bandwidth: 200,
11721
+ modulation: 'QPSK',
11722
+ demodulation: "\u89E3\u8C03",
11723
+ status: "\u5408\u6CD5",
11724
+ title: "\u8054\u901A2/3/4/5G\u4E0B\u884C",
11725
+ description: "\u4E2D\u56FD\u8054\u901A2G/3G/4G/5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11726
+ },
11727
+ {
11728
+ startFrequency: 1164,
11729
+ stopFrequency: 1189,
11730
+ stepFrequency: 1000,
11731
+ bandwidth: 10000,
11732
+ modulation: 'BPSK',
11733
+ demodulation: "\u89E3\u8C03",
11734
+ status: "\u5408\u6CD5",
11735
+ title: "GPS L5\u9891\u6BB5",
11736
+ description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L5\u9891\u6BB5"
11737
+ },
11738
+ {
11739
+ startFrequency: 1215,
11740
+ stopFrequency: 1234,
11741
+ stepFrequency: 1000,
11742
+ bandwidth: 10000,
11743
+ modulation: 'BPSK',
11744
+ demodulation: "\u89E3\u8C03",
11745
+ status: "\u5408\u6CD5",
11746
+ title: "GPS L2\u9891\u6BB5",
11747
+ description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L2\u9891\u6BB5"
11748
+ },
11749
+ {
11750
+ startFrequency: 1447,
11751
+ stopFrequency: 1467,
11752
+ stepFrequency: 100,
11753
+ bandwidth: 10000,
11754
+ modulation: 'OFDMA',
11755
+ demodulation: "\u89E3\u8C03",
11756
+ status: "\u5408\u6CD5",
11757
+ title: "\u653F\u52A1\u516C\u5B89\u4E13\u7F51",
11758
+ description: "\u653F\u52A1\u548C\u516C\u5B89\u4E13\u7528LTE\u7F51\u7EDC\u9891\u6BB5"
11759
+ },
11760
+ {
11761
+ startFrequency: 1563,
11762
+ stopFrequency: 1587,
11763
+ stepFrequency: 1000,
11764
+ bandwidth: 10000,
11765
+ modulation: 'BPSK',
11766
+ demodulation: "\u89E3\u8C03",
11767
+ status: "\u5408\u6CD5",
11768
+ title: "GPS L1\u9891\u6BB5",
11769
+ description: "\u5168\u7403\u5B9A\u4F4D\u7CFB\u7EDFGPS L1\u9891\u6BB5"
11770
+ },
11771
+ {
11772
+ startFrequency: 1710,
11773
+ stopFrequency: 1735,
11774
+ stepFrequency: 200,
11775
+ bandwidth: 5000,
11776
+ modulation: 'QPSK',
11777
+ demodulation: "\u89E3\u8C03",
11778
+ status: "\u5408\u6CD5",
11779
+ title: "\u79FB\u52A82G/4G\u4E0A\u884C",
11780
+ description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11781
+ },
11782
+ {
11783
+ startFrequency: 1735,
11784
+ stopFrequency: 1765,
11785
+ stepFrequency: 200,
11786
+ bandwidth: 5000,
11787
+ modulation: 'QPSK',
11788
+ demodulation: "\u89E3\u8C03",
11789
+ status: "\u5408\u6CD5",
11790
+ title: "\u8054\u901A2/4G\u4E0A\u884C",
11791
+ description: "\u4E2D\u56FD\u8054\u901A2G/4G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11792
+ },
11793
+ {
11794
+ startFrequency: 1805,
11795
+ stopFrequency: 1830,
11796
+ stepFrequency: 200,
11797
+ bandwidth: 5000,
11798
+ modulation: 'QPSK',
11799
+ demodulation: "\u89E3\u8C03",
11800
+ status: "\u5408\u6CD5",
11801
+ title: "\u79FB\u52A82G/4G\u4E0B\u884C",
11802
+ description: "\u4E2D\u56FD\u79FB\u52A82G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11803
+ },
11804
+ {
11805
+ startFrequency: 1830,
11806
+ stopFrequency: 1860,
11807
+ stepFrequency: 200,
11808
+ bandwidth: 5000,
11809
+ modulation: 'QPSK',
11810
+ demodulation: "\u89E3\u8C03",
11811
+ status: "\u5408\u6CD5",
11812
+ title: "\u8054\u901A2/4G\u4E0B\u884C",
11813
+ description: "\u4E2D\u56FD\u8054\u901A2G/4G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11814
+ },
11815
+ {
11816
+ startFrequency: 1885,
11817
+ stopFrequency: 1915,
11818
+ stepFrequency: 100,
11819
+ bandwidth: 10000,
11820
+ modulation: 'OFDMA',
11821
+ demodulation: "\u89E3\u8C03",
11822
+ status: "\u5408\u6CD5",
11823
+ title: "\u79FB\u52A84G",
11824
+ description: "\u4E2D\u56FD\u79FB\u52A84G\u7F51\u7EDC\u9891\u6BB5"
11825
+ },
11826
+ {
11827
+ startFrequency: 1920,
11828
+ stopFrequency: 1940,
11829
+ stepFrequency: 100,
11830
+ bandwidth: 10000,
11831
+ modulation: 'OFDMA',
11832
+ demodulation: "\u89E3\u8C03",
11833
+ status: "\u5408\u6CD5",
11834
+ title: "\u7535\u4FE1/\u8054\u901A5G\u4E0A\u884C",
11835
+ description: "\u4E2D\u56FD\u7535\u4FE1/\u8054\u901A5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11836
+ },
11837
+ {
11838
+ startFrequency: 1940,
11839
+ stopFrequency: 1965,
11840
+ stepFrequency: 100,
11841
+ bandwidth: 10000,
11842
+ modulation: 'OFDMA',
11843
+ demodulation: "\u89E3\u8C03",
11844
+ status: "\u5408\u6CD5",
11845
+ title: "\u8054\u901A3/4/5G\u4E0A\u884C",
11846
+ description: "\u4E2D\u56FD\u8054\u901A3G/4G/5G\u7F51\u7EDC\u4E0A\u884C\u9891\u6BB5"
11847
+ },
11848
+ {
11849
+ startFrequency: 2110,
11850
+ stopFrequency: 2130,
11851
+ stepFrequency: 100,
11852
+ bandwidth: 10000,
11853
+ modulation: 'OFDMA',
11854
+ demodulation: "\u89E3\u8C03",
11855
+ status: "\u5408\u6CD5",
11856
+ title: "\u7535\u4FE1/\u8054\u901A5G\u4E0B\u884C",
11857
+ description: "\u4E2D\u56FD\u7535\u4FE1/\u8054\u901A5G\u7F51\u7EDC\u4E0B\u884C\u9891\u6BB5"
11858
+ },
11859
+ {
11860
+ startFrequency: 2300,
11861
+ stopFrequency: 2320,
11862
+ stepFrequency: 100,
11863
+ bandwidth: 10000,
11864
+ modulation: 'OFDMA',
11865
+ demodulation: "\u89E3\u8C03",
11866
+ status: "\u5408\u6CD5",
11867
+ title: "\u8054\u901A4G",
11868
+ description: "\u4E2D\u56FD\u8054\u901A4G\u7F51\u7EDC\u9891\u6BB5"
11869
+ },
11870
+ {
11871
+ startFrequency: 2320,
11872
+ stopFrequency: 2370,
11873
+ stepFrequency: 100,
11874
+ bandwidth: 10000,
11875
+ modulation: 'OFDMA',
11876
+ demodulation: "\u89E3\u8C03",
11877
+ status: "\u5408\u6CD5",
11878
+ title: "\u79FB\u52A84G",
11879
+ description: "\u4E2D\u56FD\u79FB\u52A84G\u7F51\u7EDC\u9891\u6BB5"
11880
+ },
11881
+ {
11882
+ startFrequency: 2400,
11883
+ stopFrequency: 2500,
11884
+ stepFrequency: 1,
11885
+ bandwidth: 20,
11886
+ modulation: 'OFDM',
11887
+ demodulation: "\u89E3\u8C03",
11888
+ status: "\u5408\u6CD5",
11889
+ title: 'ISM 2.4GHz',
11890
+ description: "WIFI\u3001\u84DD\u7259\u3001\u65E0\u4EBA\u673A\u7B49\u4F7F\u7528\u9891\u6BB5"
11891
+ },
11892
+ {
11893
+ startFrequency: 2515,
11894
+ stopFrequency: 2675,
11895
+ stepFrequency: 100,
11896
+ bandwidth: 10000,
11897
+ modulation: 'OFDMA',
11898
+ demodulation: "\u89E3\u8C03",
11899
+ status: "\u5408\u6CD5",
11900
+ title: "\u79FB\u52A85G/4G",
11901
+ description: "\u4E2D\u56FD\u79FB\u52A85G\u548C4G\u7F51\u7EDC\u9891\u6BB5"
11902
+ },
11903
+ {
11904
+ startFrequency: 3300,
11905
+ stopFrequency: 3600,
11906
+ stepFrequency: 100,
11907
+ bandwidth: 10000,
11908
+ modulation: 'OFDMA',
11909
+ demodulation: "\u89E3\u8C03",
11910
+ status: "\u5408\u6CD5",
11911
+ title: "5G\u9891\u6BB5",
11912
+ description: "\u7535\u4FE1\u3001\u8054\u901A\u3001\u5E7F\u75355G\u7F51\u7EDC\u9891\u6BB5"
11913
+ },
11914
+ {
11915
+ startFrequency: 4800,
11916
+ stopFrequency: 4900,
11917
+ stepFrequency: 100,
11918
+ bandwidth: 10000,
11919
+ modulation: 'OFDMA',
11920
+ demodulation: "\u89E3\u8C03",
11921
+ status: "\u5408\u6CD5",
11922
+ title: "\u79FB\u52A85G",
11923
+ description: "\u4E2D\u56FD\u79FB\u52A85G\u7F51\u7EDC\u9891\u6BB5"
11924
+ },
11925
+ {
11926
+ startFrequency: 4900,
11927
+ stopFrequency: 4960,
11928
+ stepFrequency: 100,
11929
+ bandwidth: 10000,
11930
+ modulation: 'OFDMA',
11931
+ demodulation: "\u89E3\u8C03",
11932
+ status: "\u5408\u6CD5",
11933
+ title: "\u5E7F\u75355G",
11934
+ description: "\u4E2D\u56FD\u5E7F\u75355G\u7F51\u7EDC\u9891\u6BB5"
11935
+ },
11936
+ {
11937
+ startFrequency: 5725,
11938
+ stopFrequency: 5875.5,
11939
+ stepFrequency: 5,
11940
+ bandwidth: 20,
11941
+ modulation: 'OFDM',
11942
+ demodulation: "\u89E3\u8C03",
11943
+ status: "\u5408\u6CD5",
11944
+ title: 'ISM 5GHz',
11945
+ description: "WIFI\u3001\u65E0\u4EBA\u673A\u7B49\u4F7F\u7528\u9891\u6BB5"
11168
11946
  }
11169
- }
11170
- const Level_Level = (props)=>{
11171
- const { state: { axisY, globalID } } = useStore_useStore();
11172
- const { opacity } = props;
11173
- const { chart, Chart } = hooks_useChart({
11174
- Render: Occupancy,
11175
- params: {
11176
- orientation: type_OrientationType.Horizontal
11177
- }
11178
- });
11179
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11180
- if (chart && globalID) tools(globalID, constants_ModuleType.LevelStream, (d)=>{
11181
- const { data } = d;
11182
- if (data) chart.updateSeries(data);
11183
- });
11184
- }, [
11185
- chart,
11186
- globalID
11187
- ]);
11188
- const style = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
11189
- opacity,
11190
- zIndex: 1
11191
- }), [
11192
- axisY,
11193
- opacity
11194
- ]);
11195
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {
11196
- style: style
11197
- });
11198
- };
11199
- const Level = Level_Level;
11200
- var Band_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/Band/styles.module.less");
11201
- var Band_styles_module_options = {};
11202
- Band_styles_module_options.styleTagTransform = styleTagTransform_default();
11203
- Band_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
11204
- Band_styles_module_options.insert = insertBySelector_default().bind(null, "head");
11205
- Band_styles_module_options.domAPI = styleDomAPI_default();
11206
- Band_styles_module_options.insertStyleElement = insertStyleElement_default();
11207
- injectStylesIntoStyleTag_default()(Band_styles_module.Z, Band_styles_module_options);
11208
- const components_Band_styles_module = Band_styles_module.Z && Band_styles_module.Z.locals ? Band_styles_module.Z.locals : void 0;
11209
- function useBand() {
11210
- const { state: { band }, dispatch } = useStore_useStore();
11211
- const setBand = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((e)=>{
11212
- const { show = true, width = 0 } = e;
11213
- dispatch({
11214
- payload: {
11215
- band: {
11216
- ...band,
11217
- show,
11218
- width
11219
- }
11220
- }
11221
- });
11222
- }, [
11223
- band
11224
- ]);
11225
- return setBand;
11226
- }
11227
- const Band_Band = ()=>{
11228
- const { state: { band: { show, width, left, color } } } = useStore_useStore();
11229
- if (!show) return null;
11230
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Zoom_ZoomOffsetContainer, {
11231
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11232
- className: components_Band_styles_module.band,
11233
- style: {
11234
- left: void 0 !== left ? `${left}%` : `calc(50% - ${width / 2}%)`,
11235
- width: `${width}%`,
11236
- backgroundColor: `${color}15`,
11237
- borderColor: `${color}`
11238
- }
11239
- })
11240
- });
11241
- };
11242
- const Band = Band_Band;
11243
- var DragFrame_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/DragFrame/styles.module.less");
11244
- var DragFrame_styles_module_options = {};
11245
- DragFrame_styles_module_options.styleTagTransform = styleTagTransform_default();
11246
- DragFrame_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
11247
- DragFrame_styles_module_options.insert = insertBySelector_default().bind(null, "head");
11248
- DragFrame_styles_module_options.domAPI = styleDomAPI_default();
11249
- DragFrame_styles_module_options.insertStyleElement = insertStyleElement_default();
11250
- injectStylesIntoStyleTag_default()(DragFrame_styles_module.Z, DragFrame_styles_module_options);
11251
- const components_DragFrame_styles_module = DragFrame_styles_module.Z && DragFrame_styles_module.Z.locals ? DragFrame_styles_module.Z.locals : void 0;
11252
- const maxIndexSegments2FrequencyBandwidth = ({ frequencyLeft, segments })=>leftSegments2frequency(segments)(frequencyLeft);
11253
- const startEnd2AnalyseFrequencyBandwidth = ({ e, zoom, segments, onChange, globalID })=>{
11254
- const { realData } = withDatabase(globalID).getAllRawData();
11255
- if (!realData) return;
11256
- const len = realData.length;
11257
- const { interval: { start: outsideStart, end: outsideEnd } } = zoom;
11258
- const potintLen = outsideEnd - outsideStart;
11259
- const { left: startLeft } = e;
11260
- const endLeft = e.left + e.width;
11261
- const left = convertCoordToVisualLeft({
11262
- coord: e,
11263
- segments,
11264
- zoom
11265
- });
11266
- const right = convertCoordToVisualLeft({
11267
- coord: {
11268
- left: endLeft
11269
- },
11270
- segments,
11271
- zoom
11272
- });
11273
- const start = Math.max(0, Math.ceil(len * left / 100) - 1);
11274
- const end = Math.ceil(len * right / 100);
11275
- const { maxIndex } = getDimInfo(Array.from(realData.slice(start, end)));
11276
- const frequencyLeft = (outsideStart + (start + maxIndex + 1) / len * potintLen) * 100 / segments.totalPoints;
11277
- const frequency = maxIndexSegments2FrequencyBandwidth({
11278
- frequencyLeft,
11279
- segments
11280
- });
11281
- const bandwidth = Math.round(1000 * scopeLeftSegments2bandwidth({
11282
- segments,
11283
- endLeft,
11284
- startLeft
11285
- }));
11286
- onChange({
11287
- frequency,
11288
- bandwidth,
11289
- left,
11290
- right
11291
- });
11292
- };
11293
- const DragFrame_COMPONENT_KEY = constants_ToolType.DragFrame;
11294
- const DragFrame = ({ id })=>{
11295
- const { state: { zoom, segments, signalAnalysis, globalID }, dispatch } = useStore_useStore();
11296
- const [frameState, setFrameState] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
11297
- const onChange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((e, isSignalAnalysis = false)=>{
11298
- if (signalAnalysis.show && signalAnalysis.display && isSignalAnalysis) return void startEnd2AnalyseFrequencyBandwidth({
11299
- e,
11300
- zoom,
11301
- segments,
11302
- onChange: signalAnalysis.onChange,
11303
- globalID
11304
- });
11305
- dispatch({
11306
- payload: {
11307
- zoom: {
11308
- ...zoom,
11309
- interval: e.interval,
11310
- isScanSegmentsUpdateMagnify: e.isScanSegmentsUpdateMagnify
11311
- }
11312
- }
11313
- });
11314
- }, [
11315
- signalAnalysis,
11316
- zoom,
11317
- segments,
11318
- globalID
11319
- ]);
11320
- const filterFrameState = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((startCoords, endCoords, _, isEventButtonsRight)=>{
11321
- if (startCoords && endCoords && isEventButtonsRight) {
11322
- const diffX = endCoords.left - startCoords.left;
11323
- setFrameState({
11324
- diffX,
11325
- left: diffX > 0 ? startCoords.left : endCoords.left,
11326
- width: Math.abs(diffX),
11327
- isScanSegmentsUpdateMagnify: diffX > 0
11328
- });
11329
- }
11330
- }, []);
11331
- const handleFrameRender = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
11332
- if (!frameState) return;
11333
- const { left, width, isScanSegmentsUpdateMagnify, diffX } = frameState;
11334
- const { totalPoints } = segments;
11335
- if (isScanSegmentsUpdateMagnify && diffX > 0) {
11336
- const nextPoint = 2 * Math.ceil(width / 100 * totalPoints / 2);
11337
- const start = Math.round(totalPoints * left / 100) - 1;
11338
- const end = nextPoint + start - 1;
11339
- if (nextPoint > 10) onChange({
11340
- interval: {
11341
- start,
11342
- end
11343
- },
11344
- isScanSegmentsUpdateMagnify,
11345
- left,
11346
- width
11347
- }, true);
11348
- }
11349
- if (diffX < 0) onChange({
11350
- interval: {
11351
- start: 0,
11352
- end: totalPoints - 1
11353
- },
11354
- isScanSegmentsUpdateMagnify,
11355
- left,
11356
- width
11357
- });
11358
- }, [
11359
- frameState,
11360
- segments,
11361
- zoom.interval.end,
11362
- onChange
11363
- ]);
11364
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11365
- if (zoom.show) {
11366
- const reset = ()=>{
11367
- setFrameState(null);
11368
- resetEventLevel(id, DragFrame_COMPONENT_KEY);
11369
- };
11370
- createMouseDownEventManager(id, DragFrame_COMPONENT_KEY, reset);
11371
- createMouseUpEventManager(id, DragFrame_COMPONENT_KEY, ()=>{
11372
- handleFrameRender();
11373
- reset();
11374
- });
11375
- createMouseLeaveEventManager(id, DragFrame_COMPONENT_KEY, reset);
11376
- createDragEventManager(id, DragFrame_COMPONENT_KEY, (...args)=>{
11377
- if (compareEventPriority(id, DragFrame_COMPONENT_KEY)) filterFrameState(args[0], args[1], args[2], args[3]);
11378
- });
11379
- }
11380
- }, [
11381
- zoom.show,
11382
- id,
11383
- handleFrameRender,
11384
- filterFrameState
11385
- ]);
11386
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11387
- if (!frameState) resetEventLevel(id, DragFrame_COMPONENT_KEY);
11388
- }, [
11389
- frameState,
11390
- id
11391
- ]);
11392
- if (!zoom.show) return null;
11393
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Zoom_ZoomOffsetContainer, {
11394
- className: components_DragFrame_styles_module.DragFrame,
11395
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11396
- className: `${components_DragFrame_styles_module.frame} ${frameState?.isScanSegmentsUpdateMagnify ? '' : components_DragFrame_styles_module.bias}`,
11397
- style: frameState ? {
11398
- left: `${frameState.left}%`,
11399
- width: `${frameState.width}%`
11400
- } : {}
11401
- })
11402
- });
11403
- };
11404
- const components_DragFrame = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(DragFrame);
11947
+ ];
11405
11948
  var FrequencyAllocation_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/FrequencyAllocation/styles.module.less");
11406
11949
  var FrequencyAllocation_styles_module_options = {};
11407
11950
  FrequencyAllocation_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -11417,7 +11960,7 @@ const SegmentContainer = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.mem
11417
11960
  children: bandPositions.map(({ band, range, position }, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11418
11961
  className: components_FrequencyAllocation_styles_module.item,
11419
11962
  style: {
11420
- background: band.gradientColors ? `linear-gradient(to right, ${band.gradientColors[0]}, ${band.gradientColors[1]})` : band.color,
11963
+ background: (band.gradientColors ? `linear-gradient(to right, ${band.gradientColors[0]}, ${band.gradientColors[1]})` : band.color) || 'var(--theme-color-primary)',
11421
11964
  left: position.left,
11422
11965
  width: position.width
11423
11966
  },
@@ -11437,7 +11980,7 @@ FrequencyAllocation_Tooltip_styles_module_options.domAPI = styleDomAPI_default()
11437
11980
  FrequencyAllocation_Tooltip_styles_module_options.insertStyleElement = insertStyleElement_default();
11438
11981
  injectStylesIntoStyleTag_default()(FrequencyAllocation_Tooltip_styles_module.Z, FrequencyAllocation_Tooltip_styles_module_options);
11439
11982
  const components_FrequencyAllocation_Tooltip_styles_module = FrequencyAllocation_Tooltip_styles_module.Z && FrequencyAllocation_Tooltip_styles_module.Z.locals ? FrequencyAllocation_Tooltip_styles_module.Z.locals : void 0;
11440
- const FrequencyAllocation_Tooltip_Tooltip = ({ title, description, visible, x, y, startFrequency, stopFrequency, centerFrequency, bandwidth, defaultStep, defaultBandwidth, modulation, demodulation, allocation, status })=>{
11983
+ const FrequencyAllocation_Tooltip_Tooltip = ({ title, description, visible, x, y, startFrequency, stopFrequency, centerFrequency, stepFrequency, bandwidth, modulation, demodulation, status })=>{
11441
11984
  const tooltipRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
11442
11985
  const [position, setPosition] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({
11443
11986
  x,
@@ -11480,13 +12023,13 @@ const FrequencyAllocation_Tooltip_Tooltip = ({ title, description, visible, x, y
11480
12023
  children: `\u{9891}\u{7387}\u{8303}\u{56F4}: ${startFrequency} - ${stopFrequency}`
11481
12024
  }),
11482
12025
  centerFrequency && bandwidth && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11483
- children: `\u{4E2D}\u{5FC3}\u{9891}\u{7387}: ${centerFrequency} & \u{5E26}\u{5BBD}: ${bandwidth}`
12026
+ children: `\u{4E2D}\u{5FC3}\u{9891}\u{7387}: ${centerFrequency} MHz & \u{5E26}\u{5BBD}: ${bandwidth} kHz`
11484
12027
  }),
11485
- defaultStep && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11486
- children: `\u{9ED8}\u{8BA4}\u{6B65}\u{8FDB}: ${defaultStep}`
12028
+ stepFrequency && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
12029
+ children: `\u{6B65}\u{8FDB}: ${stepFrequency} kHz`
11487
12030
  }),
11488
- defaultBandwidth && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11489
- children: `\u{9ED8}\u{8BA4}\u{5E26}\u{5BBD}: ${defaultBandwidth}`
12031
+ bandwidth && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
12032
+ children: `\u{5E26}\u{5BBD}: ${bandwidth} kHz`
11490
12033
  }),
11491
12034
  modulation && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11492
12035
  children: `\u{8C03}\u{5236}\u{65B9}\u{5F0F}: ${modulation}`
@@ -11494,9 +12037,6 @@ const FrequencyAllocation_Tooltip_Tooltip = ({ title, description, visible, x, y
11494
12037
  demodulation && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11495
12038
  children: `\u{89E3}\u{8C03}\u{65B9}\u{5F0F}: ${demodulation}`
11496
12039
  }),
11497
- allocation && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11498
- children: `\u{5212}\u{5206}\u{4FE1}\u{606F}: ${allocation}`
11499
- }),
11500
12040
  status && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11501
12041
  children: `\u{72B6}\u{6001}: ${status}`
11502
12042
  })
@@ -11512,38 +12052,42 @@ const FrequencyAllocation_Tooltip_Tooltip = ({ title, description, visible, x, y
11512
12052
  const FrequencyAllocation_Tooltip = FrequencyAllocation_Tooltip_Tooltip;
11513
12053
  const FrequencyAllocation_FrequencyAllocation = ()=>{
11514
12054
  const { state: { axisX: { unit }, segments, frequencyAllocation: { display, show, data }, zoom: { style: zoomOffStyle } } } = useStore_useStore();
12055
+ const frequencyAllocationData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
12056
+ const cachedData = getFrequencyAllocationFromCache();
12057
+ return sortAndRecolorFrequencyAllocationData(cachedData?.length > 0 ? cachedData : data?.length > 0 ? data : FrequencyAllocation_data);
12058
+ }, [
12059
+ data
12060
+ ]);
11515
12061
  const [tooltipInfo, setTooltipInfo] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({
11516
12062
  visible: false,
11517
12063
  x: 0,
11518
- y: 0,
11519
- title: '',
11520
- description: ''
12064
+ y: 0
11521
12065
  });
11522
12066
  const getFrequencyRange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((band)=>{
11523
12067
  if (null != band.startFrequency && null != band.stopFrequency) return {
11524
- start: band.startFrequency,
11525
- stop: band.stopFrequency,
12068
+ start: Number(band.startFrequency),
12069
+ stop: Number(band.stopFrequency),
11526
12070
  type: 'range'
11527
12071
  };
11528
12072
  if (null != band.centerFrequency && null != band.bandwidth) {
11529
- const [segment] = generateFrequencySegments({
12073
+ const [segment] = (0, utils.IS)({
11530
12074
  frequency: band.centerFrequency,
11531
12075
  bandwidth: band.bandwidth
11532
12076
  });
11533
12077
  return {
11534
12078
  start: segment.start,
11535
12079
  stop: segment.stop,
11536
- frequency: band.centerFrequency,
11537
- bandwidth: band.bandwidth,
12080
+ frequency: Number(band.centerFrequency),
12081
+ bandwidth: Number(band.bandwidth),
11538
12082
  type: 'centerBandwidth'
11539
12083
  };
11540
12084
  }
11541
12085
  return null;
11542
12086
  }, []);
11543
12087
  const segmentData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
11544
- if (!segments?.length || !data) return [];
12088
+ if (!segments?.length || !frequencyAllocationData) return [];
11545
12089
  return segments.map((segment, segmentIndex)=>{
11546
- const segmentBands = (Array.isArray(data) ? data : []).map((band)=>{
12090
+ const segmentBands = frequencyAllocationData.map((band)=>{
11547
12091
  const range = getFrequencyRange(band);
11548
12092
  if (range && !(range.stop < segment.start || range.start > segment.stop)) return {
11549
12093
  band,
@@ -11608,7 +12152,7 @@ const FrequencyAllocation_FrequencyAllocation = ()=>{
11608
12152
  };
11609
12153
  });
11610
12154
  }, [
11611
- data,
12155
+ frequencyAllocationData,
11612
12156
  segments,
11613
12157
  getFrequencyRange
11614
12158
  ]);
@@ -11620,19 +12164,12 @@ const FrequencyAllocation_FrequencyAllocation = ()=>{
11620
12164
  }, []);
11621
12165
  const handleMouseEnter = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((band, range)=>(e)=>{
11622
12166
  const tooltipData = {
12167
+ ...band,
11623
12168
  visible: true,
11624
12169
  x: e.clientX + 10,
11625
12170
  y: e.clientY + 10,
11626
- title: band.title,
11627
- description: band.description,
11628
12171
  startFrequency: `${range.start}${unit}`,
11629
- stopFrequency: `${range.stop}${unit}`,
11630
- defaultStep: null != band.defaultStep ? `${band.defaultStep}kHz` : void 0,
11631
- defaultBandwidth: null != band.defaultBandwidth ? `${band.defaultBandwidth}kHz` : void 0,
11632
- modulation: band.modulation,
11633
- demodulation: band.demodulation,
11634
- allocation: band.allocation,
11635
- status: band.status
12172
+ stopFrequency: `${range.stop}${unit}`
11636
12173
  };
11637
12174
  if ('centerBandwidth' === range.type && null != range.frequency && null != range.bandwidth) {
11638
12175
  tooltipData.centerFrequency = `${range.frequency}${unit}`;
@@ -11707,7 +12244,7 @@ const Board_Board = ({ id })=>{
11707
12244
  const handleChange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((e)=>{
11708
12245
  if (!e) return;
11709
12246
  const { index, frequency } = e;
11710
- if (!isNumberAlias(frequency)) return;
12247
+ if (!(0, utils.Ri)(frequency)) return;
11711
12248
  onChange({
11712
12249
  index,
11713
12250
  frequency
@@ -11736,7 +12273,7 @@ FrequencyMarkerLine_styles_module_options.insertStyleElement = insertStyleElemen
11736
12273
  injectStylesIntoStyleTag_default()(FrequencyMarkerLine_styles_module.Z, FrequencyMarkerLine_styles_module_options);
11737
12274
  const components_FrequencyMarkerLine_styles_module = FrequencyMarkerLine_styles_module.Z && FrequencyMarkerLine_styles_module.Z.locals ? FrequencyMarkerLine_styles_module.Z.locals : void 0;
11738
12275
  const FrequencyMarkerLine_COMPONENT_KEY = constants_ToolType.FrequencyMarkerLine;
11739
- const FrequencyMarkerLine = (props)=>{
12276
+ const FrequencyMarkerLine_FrequencyMarkerLine = (props)=>{
11740
12277
  const { state: { frequencyMarkerLine }, dispatch } = useStore_useStore();
11741
12278
  const { show, display, left, onChange } = frequencyMarkerLine;
11742
12279
  const { id } = props;
@@ -11810,7 +12347,7 @@ const FrequencyMarkerLine = (props)=>{
11810
12347
  })
11811
12348
  });
11812
12349
  };
11813
- const components_FrequencyMarkerLine = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(FrequencyMarkerLine);
12350
+ const FrequencyMarkerLine = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(FrequencyMarkerLine_FrequencyMarkerLine);
11814
12351
  var Limit_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/Limit/styles.module.less");
11815
12352
  var Limit_styles_module_options = {};
11816
12353
  Limit_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -11825,7 +12362,7 @@ const Item_Item = ({ value, onChange })=>{
11825
12362
  const { label, disabled } = limit;
11826
12363
  const { unit, range, step } = axisY;
11827
12364
  const [min, max] = range;
11828
- const diff = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>isdBm(unit) ? dBuV2dBm(0) : 0, [
12365
+ const diff = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>(0, utils.Bp)(unit) ? dBuV2dBm(0) : 0, [
11829
12366
  unit
11830
12367
  ]);
11831
12368
  const value2top = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((v)=>(max - v - diff) / (max - min) * 100, [
@@ -11964,7 +12501,7 @@ const Limit = ({ id })=>{
11964
12501
  });
11965
12502
  createDragEventManager(id, COMPONENT_NAME, (_, __, diff)=>{
11966
12503
  if (!canRender || disabled) return;
11967
- if (isNumberAlias(index) && compareEventPriority(id, COMPONENT_NAME)) {
12504
+ if ((0, utils.Ri)(index) && compareEventPriority(id, COMPONENT_NAME)) {
11968
12505
  if (diff?.top) setValue(index, Math.round(limit.value[index] - 100 * diff.top));
11969
12506
  }
11970
12507
  });
@@ -11983,7 +12520,7 @@ const Limit = ({ id })=>{
11983
12520
  children: segments?.map((i, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
11984
12521
  style: {
11985
12522
  width: `${100 * i.point / segments.totalPoints}%`,
11986
- opacity: isNumberAlias(value[index]) ? 1 : 0
12523
+ opacity: (0, utils.Ri)(value[index]) ? 1 : 0
11987
12524
  },
11988
12525
  className: components_Limit_styles_module.item,
11989
12526
  children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Item, {
@@ -12449,7 +12986,7 @@ function usePoints() {
12449
12986
  const { dispatch, state: { axisX } } = useStore_useStore();
12450
12987
  const setPoints = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((points)=>{
12451
12988
  if (points?.length) {
12452
- axisX.frequencyFormat = leftPoints2frequency(points);
12989
+ axisX.frequencyFormat = (0, utils.or)(points);
12453
12990
  dispatch({
12454
12991
  payload: {
12455
12992
  points,
@@ -12463,7 +13000,7 @@ function usePoints() {
12463
13000
  const Spectrum_Spectrum = (props)=>{
12464
13001
  const { selecter, children } = props;
12465
13002
  const { state: { axisY: { autoranging }, series: { weaken }, globalID } } = useStore_useStore();
12466
- const { id, chart, Chart } = hooks_useChart({
13003
+ const { id, chart, Chart } = useChart({
12467
13004
  Render: Spectrum,
12468
13005
  params: {
12469
13006
  autoranging,
@@ -12572,7 +13109,7 @@ const Spectrum_Spectrum = (props)=>{
12572
13109
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Stripe, {
12573
13110
  id: id
12574
13111
  }),
12575
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_FrequencyMarkerLine, {
13112
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyMarkerLine, {
12576
13113
  id: id
12577
13114
  }),
12578
13115
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyAllocation, {}),
@@ -12744,7 +13281,7 @@ const TotalLine = TotalLine_TotalLine;
12744
13281
  const Occupancy_Occupancy = (props)=>{
12745
13282
  const { occupancyAxisYDisabled } = props;
12746
13283
  const { state: { globalID } } = useStore_useStore();
12747
- const { id, chart, Chart } = hooks_useChart({
13284
+ const { id, chart, Chart } = useChart({
12748
13285
  Render: Occupancy
12749
13286
  });
12750
13287
  const [value, setValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(0);
@@ -12839,9 +13376,9 @@ const ThreeFixedTicks = ()=>{
12839
13376
  const { start, bandwidth = 0 } = segments[0] ?? {};
12840
13377
  const center = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
12841
13378
  if (!endIndex || !bandwidth || void 0 === start) return 0;
12842
- const midIndex = getMidIndex(intervalStart, intervalEnd);
13379
+ const midIndex = (0, utils.wF)(intervalStart, intervalEnd);
12843
13380
  const safeIndex = Math.max(0, Math.min(midIndex, endIndex));
12844
- return getFrequencyToFixed(start + safeIndex * bandwidth / (1000 * endIndex));
13381
+ return (0, utils.lj)(start + safeIndex * bandwidth / (1000 * endIndex));
12845
13382
  }, [
12846
13383
  intervalStart,
12847
13384
  intervalEnd,
@@ -12852,7 +13389,7 @@ const ThreeFixedTicks = ()=>{
12852
13389
  const bandwidthDiff = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
12853
13390
  if (!totalPoints || !bandwidth) return 0;
12854
13391
  const intervalWidth = intervalEnd - intervalStart + 1;
12855
- return getFrequencyToFixed(intervalWidth * bandwidth / (2 * totalPoints));
13392
+ return (0, utils.lj)(intervalWidth * bandwidth / (2 * totalPoints));
12856
13393
  }, [
12857
13394
  intervalStart,
12858
13395
  intervalEnd,
@@ -12977,7 +13514,7 @@ const AxisXTicks = ({ type })=>{
12977
13514
  });
12978
13515
  };
12979
13516
  const AxisX_Ticks = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(AxisXTicks);
12980
- const AxisX = ({ type })=>{
13517
+ const AxisX_AxisX = ({ type })=>{
12981
13518
  const { state: { axisX } } = useStore_useStore();
12982
13519
  const { children, unit, ticks } = axisX;
12983
13520
  const { width, pluginBoxWidth } = useAxisYWidth();
@@ -13015,7 +13552,7 @@ const AxisX = ({ type })=>{
13015
13552
  })
13016
13553
  });
13017
13554
  };
13018
- const components_AxisX = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(AxisX);
13555
+ const AxisX = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(AxisX_AxisX);
13019
13556
  var Blaze_styles_module = __webpack_require__("../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/Blaze/styles.module.less");
13020
13557
  var Blaze_styles_module_options = {};
13021
13558
  Blaze_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -13663,7 +14200,7 @@ function useSegments() {
13663
14200
  zoom,
13664
14201
  axisX
13665
14202
  };
13666
- if (0 === points.length) payload.axisX.frequencyFormat = leftSegments2frequency(s);
14203
+ if (0 === points.length) payload.axisX.frequencyFormat = (0, utils.Ax)(s);
13667
14204
  dispatch({
13668
14205
  payload
13669
14206
  });
@@ -13709,7 +14246,7 @@ function useSpectrumRule({ channel, onChannelChange }) {
13709
14246
  zoom
13710
14247
  }
13711
14248
  });
13712
- if (event === constants_SegmentsEvent.Cover) setSegments(generateGreatSegments(e.data));
14249
+ if (event === constants_SegmentsEvent.Cover) setSegments((0, utils.sl)(e.data));
13713
14250
  }, [
13714
14251
  segments
13715
14252
  ]);
@@ -13732,7 +14269,7 @@ function useSpectrumRule({ channel, onChannelChange }) {
13732
14269
  });
13733
14270
  const generateSegmentsFromPoints = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((points, newRule = ruleRef.current)=>{
13734
14271
  if (newRule.bandwidth && newRule.frequency && points) {
13735
- const segments = generateFrequencySegments({
14272
+ const segments = (0, utils.IS)({
13736
14273
  frequency: newRule?.frequency,
13737
14274
  bandwidth: newRule?.bandwidth,
13738
14275
  totalPoints: points
@@ -13785,7 +14322,7 @@ function useSpectrumRule({ channel, onChannelChange }) {
13785
14322
  }, []);
13786
14323
  return handleSpectrumRule;
13787
14324
  }
13788
- const SegmentsDisplayControl = ()=>{
14325
+ const SegmentsDisplayControl_SegmentsDisplayControl = ()=>{
13789
14326
  const { state: { segments, globalID } } = useStore_useStore();
13790
14327
  const [display, setDisplay] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)([]);
13791
14328
  const [selectedIndex, setSelectedIndex] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
@@ -13826,7 +14363,7 @@ const SegmentsDisplayControl = ()=>{
13826
14363
  onChange: handleSelect
13827
14364
  });
13828
14365
  };
13829
- const ToolsBar_SegmentsDisplayControl = SegmentsDisplayControl;
14366
+ const SegmentsDisplayControl = SegmentsDisplayControl_SegmentsDisplayControl;
13830
14367
  var SeriesDisplayControl_styles_module = __webpack_require__("../../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../../node_modules/.pnpm/@rsbuild+plugin-less@1.3.1_@rsbuild+core@1.4.12/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/ToolsBar/SeriesDisplayControl/styles.module.less");
13831
14368
  var SeriesDisplayControl_styles_module_options = {};
13832
14369
  SeriesDisplayControl_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -13836,7 +14373,7 @@ SeriesDisplayControl_styles_module_options.domAPI = styleDomAPI_default();
13836
14373
  SeriesDisplayControl_styles_module_options.insertStyleElement = insertStyleElement_default();
13837
14374
  injectStylesIntoStyleTag_default()(SeriesDisplayControl_styles_module.Z, SeriesDisplayControl_styles_module_options);
13838
14375
  const ToolsBar_SeriesDisplayControl_styles_module = SeriesDisplayControl_styles_module.Z && SeriesDisplayControl_styles_module.Z.locals ? SeriesDisplayControl_styles_module.Z.locals : void 0;
13839
- const SeriesDisplayControl = ()=>{
14376
+ const SeriesDisplayControl_SeriesDisplayControl = ()=>{
13840
14377
  const { state: { globalID, series }, dispatch } = useStore_useStore();
13841
14378
  const { data, legendExternal, forceDisplay } = series;
13842
14379
  const seriesArray = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>Array.from(data.keys()).filter((name)=>!legendExternal.includes(name)).filter((name)=>name !== constants_SeriesType.TemplateData), [
@@ -13950,7 +14487,7 @@ const SeriesDisplayControl = ()=>{
13950
14487
  ]
13951
14488
  });
13952
14489
  };
13953
- const ToolsBar_SeriesDisplayControl = SeriesDisplayControl;
14490
+ const SeriesDisplayControl = SeriesDisplayControl_SeriesDisplayControl;
13954
14491
  const SpacerLine = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
13955
14492
  className: components_ToolsBar_styles_module.spacerLine
13956
14493
  });
@@ -13986,7 +14523,7 @@ const ToolsBar = ({ type })=>{
13986
14523
  ]
13987
14524
  }),
13988
14525
  type === constants_ChartType.Scan && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
13989
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(ToolsBar_SegmentsDisplayControl, {})
14526
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(SegmentsDisplayControl, {})
13990
14527
  }),
13991
14528
  type === constants_ChartType.Heatmap && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
13992
14529
  children: [
@@ -13994,7 +14531,7 @@ const ToolsBar = ({ type })=>{
13994
14531
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(TimeRange_Switch, {})
13995
14532
  ]
13996
14533
  }),
13997
- (type === constants_ChartType.SingleFrequency || type === constants_ChartType.Scan || type === constants_ChartType.MScan) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(ToolsBar_SeriesDisplayControl, {})
14534
+ (type === constants_ChartType.SingleFrequency || type === constants_ChartType.Scan || type === constants_ChartType.MScan) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(SeriesDisplayControl, {})
13998
14535
  ]
13999
14536
  })
14000
14537
  });
@@ -14055,7 +14592,7 @@ function useMarkerLinkageZoom() {
14055
14592
  const SET_SERIES = (globalID, func)=>subscription_createSubscriptionManager(`SET_SERIES-${globalID}`, '0', func);
14056
14593
  const SERIES_DEFAULT_CONFIG = {
14057
14594
  label: '',
14058
- color: 'rgba(1,1,1,0.5)',
14595
+ color: '#11111150',
14059
14596
  thickness: 1,
14060
14597
  display: true,
14061
14598
  type: type_GraphicType.Stepline
@@ -14393,7 +14930,7 @@ function useSpectrumAnalyzer(props) {
14393
14930
  case constants_PSType.Heatmap:
14394
14931
  if (e.data) {
14395
14932
  const { data, timestamps } = e;
14396
- const waterfallData = convertToTimestampedArrays(data, timestamps);
14933
+ const waterfallData = (0, utils.P9)(data, timestamps);
14397
14934
  analyzer.current.setWaterfallData(waterfallData);
14398
14935
  }
14399
14936
  break;
@@ -14547,7 +15084,7 @@ const HeatmapPortal_Chart = (props)=>{
14547
15084
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Heatmap, {
14548
15085
  selecter: selecter
14549
15086
  }),
14550
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
15087
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(AxisX, {
14551
15088
  type: type
14552
15089
  })
14553
15090
  ]
@@ -14565,7 +15102,7 @@ const OccupancyPortal_Chart = (props)=>{
14565
15102
  type: constants_ChartType.Occupancy
14566
15103
  }),
14567
15104
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Occupancy, {}),
14568
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
15105
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(AxisX, {
14569
15106
  type: type
14570
15107
  })
14571
15108
  ]
@@ -14634,7 +15171,7 @@ const Spectrum_Chart_Chart = (props)=>{
14634
15171
  })
14635
15172
  ]
14636
15173
  }),
14637
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
15174
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(AxisX, {
14638
15175
  type: type
14639
15176
  })
14640
15177
  ]
@@ -14649,4 +15186,4 @@ const SpectrumChart = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react
14649
15186
  });
14650
15187
  const lib_Spectrum_Spectrum = withChartPublisher(SpectrumChart, 'Spectrum');
14651
15188
  const lib_Spectrum = lib_Spectrum_Spectrum;
14652
- export { constants_ChartType as ChartType, lib_Dial as Dial, lib_Gauge as Gauge, lib_Heatmap as Heatmap, store_HeatmapCaptureType as HeatmapCaptureType, lib_IQ as IQ, LevelStream, constants_MarkerEventType as MarkerEventType, lib_Occupancy as Occupancy, constants_OptionKey as OptionKey, constants_PSType as PSType, constants_SegmentsEvent as SegmentsEvent, constants_SeriesType as SeriesType, lib_Spectrum as Spectrum, useSafePublish };
15189
+ export { constants_ChartType as ChartType, lib_Dial as Dial, lib_Gauge as Gauge, lib_Heatmap as Heatmap, store_HeatmapCaptureType as HeatmapCaptureType, lib_IQ as IQ, LevelStream, constants_MarkerEventType as MarkerEventType, lib_Occupancy as Occupancy, constants_OptionKey as OptionKey, constants_PSType as PSType, constants_SegmentsEvent as SegmentsEvent, constants_SeriesType as SeriesType, lib_Spectrum as Spectrum, setFrequencyAllocationToCache, useSafePublish };