@rfkit/charts 1.1.4 → 1.1.6

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.
@@ -1,9 +1,10 @@
1
1
  import type React from 'react';
2
- import type { BandPosition, FrequencyBand, FrequencyRange } from './types';
2
+ import type { FrequencyAllocationItem } from '../../types';
3
+ import type { BandPosition, FrequencyRange } from './types';
3
4
  interface SegmentContainerProps {
4
5
  style: React.CSSProperties;
5
6
  bandPositions: BandPosition[];
6
- onMouseEnter: (band: FrequencyBand, range: FrequencyRange) => (e: React.MouseEvent) => void;
7
+ onMouseEnter: (band: FrequencyAllocationItem, range: FrequencyRange) => (e: React.MouseEvent) => void;
7
8
  onMouseMove: (e: React.MouseEvent) => void;
8
9
  onMouseLeave: () => void;
9
10
  }
@@ -1,20 +1,4 @@
1
1
  import type React from 'react';
2
- interface TooltipProps {
3
- title: string;
4
- description?: string;
5
- visible: boolean;
6
- x: number;
7
- y: number;
8
- startFrequency?: string;
9
- stopFrequency?: string;
10
- centerFrequency?: string;
11
- bandwidth?: string;
12
- defaultStep?: string;
13
- defaultBandwidth?: string;
14
- modulation?: string;
15
- demodulation?: string;
16
- allocation?: string;
17
- status?: string;
18
- }
19
- declare const Tooltip: React.FC<TooltipProps>;
2
+ import type { TooltipState } from '../types';
3
+ declare const Tooltip: React.FC<TooltipState>;
20
4
  export default Tooltip;
@@ -0,0 +1,8 @@
1
+ import type { FrequencyAllocationItem } from '../../types';
2
+ export declare const optimizedColors: string[];
3
+ export declare function hexToHsl(hex: string): {
4
+ h: number;
5
+ s: number;
6
+ l: number;
7
+ };
8
+ export declare function sortAndRecolorFrequencyAllocationData(data: FrequencyAllocationItem[]): FrequencyAllocationItem[];
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ startFrequency: number;
3
+ stopFrequency: number;
4
+ stepFrequency: number;
5
+ bandwidth: number;
6
+ modulation: string;
7
+ demodulation: string;
8
+ status: string;
9
+ title: string;
10
+ description: string;
11
+ }[];
12
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import type { FrequencyAllocationItem } from '../../types';
2
+ /**
3
+ * 从本地缓存读取FrequencyAllocation数据
4
+ * @returns FrequencyAllocationItem数组或null
5
+ */
6
+ export declare const getFrequencyAllocationFromCache: () => FrequencyAllocationItem[] | null;
7
+ /**
8
+ * 将FrequencyAllocation数据保存到本地缓存
9
+ * @param data FrequencyAllocationItem数组
10
+ */
11
+ export declare const setFrequencyAllocationToCache: (data: FrequencyAllocationItem[]) => void;
12
+ /**
13
+ * 清除本地缓存的FrequencyAllocation数据
14
+ */
15
+ export declare const clearFrequencyAllocationCache: () => void;
16
+ /**
17
+ * 检查本地缓存是否存在FrequencyAllocation数据
18
+ * @returns boolean
19
+ */
20
+ export declare const hasFrequencyAllocationCache: () => boolean;
@@ -1,35 +1,8 @@
1
- export interface FrequencyBand {
2
- startFrequency?: number;
3
- stopFrequency?: number;
4
- centerFrequency?: number;
5
- bandwidth?: number;
6
- defaultStep?: number;
7
- defaultBandwidth?: number;
8
- modulation?: string;
9
- demodulation?: string;
10
- allocation?: string;
11
- status?: string;
12
- color: string;
13
- title: string;
14
- description?: string;
15
- gradientColors?: [string, string];
16
- }
17
- export interface TooltipState {
1
+ import type { FrequencyAllocationItem } from '../../types';
2
+ export interface TooltipState extends FrequencyAllocationItem {
18
3
  visible: boolean;
19
4
  x: number;
20
5
  y: number;
21
- title: string;
22
- description?: string;
23
- startFrequency?: string;
24
- stopFrequency?: string;
25
- centerFrequency?: string;
26
- bandwidth?: string;
27
- defaultStep?: string;
28
- defaultBandwidth?: string;
29
- modulation?: string;
30
- demodulation?: string;
31
- allocation?: string;
32
- status?: string;
33
6
  }
34
7
  export interface FrequencyRange {
35
8
  start: number;
@@ -39,7 +12,7 @@ export interface FrequencyRange {
39
12
  bandwidth?: number;
40
13
  }
41
14
  export interface BandPosition {
42
- band: FrequencyBand;
15
+ band: FrequencyAllocationItem;
43
16
  range: FrequencyRange;
44
17
  position: {
45
18
  left: string;
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { setFrequencyAllocationToCache } from './components/FrequencyAllocation/tools';
1
2
  export { ChartType, MarkerEventType, OptionKey, PSType, SegmentsEvent, SeriesType } from './config';
2
3
  export { default as useSafePublish } from './hooks/useSafePublish';
3
4
  export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './lib';