@rfkit/charts 1.2.7 → 1.2.9
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum SignalType {
|
|
2
|
+
LEGITIMATE = "Legitimate",
|
|
3
|
+
KNOWN = "Know",
|
|
4
|
+
UNKNOWN = "UnKnown",
|
|
5
|
+
ILLEGAL = "Illegal"
|
|
6
|
+
}
|
|
7
|
+
export declare const SIGNAL_TYPE_MAP: Record<string, {
|
|
8
|
+
name: string;
|
|
9
|
+
color: string;
|
|
10
|
+
isLegitimate: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const signalTypeMap: Record<string, {
|
|
13
|
+
name: string;
|
|
14
|
+
color: string;
|
|
15
|
+
isLegitimate: boolean;
|
|
16
|
+
}>;
|
package/index.js
CHANGED
|
@@ -2729,9 +2729,11 @@ var __webpack_modules__ = {
|
|
|
2729
2729
|
height: 100%;
|
|
2730
2730
|
color: var(--theme-color-base);
|
|
2731
2731
|
opacity: .68;
|
|
2732
|
+
pointer-events: auto;
|
|
2732
2733
|
justify-content: center;
|
|
2733
2734
|
align-items: center;
|
|
2734
|
-
|
|
2735
|
+
min-width: 1px;
|
|
2736
|
+
height: 8px;
|
|
2735
2737
|
font-size: 12px;
|
|
2736
2738
|
display: flex;
|
|
2737
2739
|
position: absolute;
|
|
@@ -2742,7 +2744,7 @@ var __webpack_modules__ = {
|
|
|
2742
2744
|
.segmentContainer-gDwnhB .item-ybDTIt:after {
|
|
2743
2745
|
content: "";
|
|
2744
2746
|
opacity: .32;
|
|
2745
|
-
background: var(--theme-color-base);
|
|
2747
|
+
background: var(--station-bg-color, var(--theme-color-base));
|
|
2746
2748
|
width: 100%;
|
|
2747
2749
|
height: 100%;
|
|
2748
2750
|
position: absolute;
|
|
@@ -2757,7 +2759,7 @@ var __webpack_modules__ = {
|
|
|
2757
2759
|
|
|
2758
2760
|
.segmentContainer-gDwnhB .item-ybDTIt.active-qDPFJm:after {
|
|
2759
2761
|
opacity: .68;
|
|
2760
|
-
background: var(--theme-color-primary);
|
|
2762
|
+
background: var(--station-bg-color, var(--theme-color-primary));
|
|
2761
2763
|
}
|
|
2762
2764
|
|
|
2763
2765
|
.segmentContainer-gDwnhB .item-ybDTIt:hover {
|
|
@@ -7857,6 +7859,28 @@ function useFilteredSeries(globalID, filter) {
|
|
|
7857
7859
|
]);
|
|
7858
7860
|
return filteredData;
|
|
7859
7861
|
}
|
|
7862
|
+
const SIGNAL_TYPE_MAP = {
|
|
7863
|
+
Legitimate: {
|
|
7864
|
+
name: "\u5408\u6CD5",
|
|
7865
|
+
color: '#52c41a',
|
|
7866
|
+
isLegitimate: true
|
|
7867
|
+
},
|
|
7868
|
+
Know: {
|
|
7869
|
+
name: "\u5DF2\u77E5",
|
|
7870
|
+
color: '#ff9900',
|
|
7871
|
+
isLegitimate: true
|
|
7872
|
+
},
|
|
7873
|
+
UnKnown: {
|
|
7874
|
+
name: "\u672A\u77E5",
|
|
7875
|
+
color: '#bfbfbf',
|
|
7876
|
+
isLegitimate: false
|
|
7877
|
+
},
|
|
7878
|
+
Illegal: {
|
|
7879
|
+
name: "\u4E0D\u5408\u6CD5",
|
|
7880
|
+
color: '#f5222d',
|
|
7881
|
+
isLegitimate: false
|
|
7882
|
+
}
|
|
7883
|
+
};
|
|
7860
7884
|
var StationInfo_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.5.0_@rsbuild+core@1.6.0/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/FrequencyDataBoard/StationInfo/styles.module.less");
|
|
7861
7885
|
var StationInfo_styles_module_options = {};
|
|
7862
7886
|
StationInfo_styles_module_options.styleTagTransform = styleTagTransform_default();
|
|
@@ -7866,7 +7890,15 @@ StationInfo_styles_module_options.domAPI = styleDomAPI_default();
|
|
|
7866
7890
|
StationInfo_styles_module_options.insertStyleElement = insertStyleElement_default();
|
|
7867
7891
|
injectStylesIntoStyleTag_default()(StationInfo_styles_module.Z, StationInfo_styles_module_options);
|
|
7868
7892
|
const FrequencyDataBoard_StationInfo_styles_module = StationInfo_styles_module.Z && StationInfo_styles_module.Z.locals ? StationInfo_styles_module.Z.locals : void 0;
|
|
7869
|
-
const
|
|
7893
|
+
const StationInfo_StationInfo = ({ stationInfo })=>{
|
|
7894
|
+
const signalTypeInfo = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
7895
|
+
if (!stationInfo?.signalType) return null;
|
|
7896
|
+
return SIGNAL_TYPE_MAP[stationInfo.signalType];
|
|
7897
|
+
}, [
|
|
7898
|
+
stationInfo?.signalType
|
|
7899
|
+
]);
|
|
7900
|
+
const signalColor = signalTypeInfo?.color;
|
|
7901
|
+
const signalTypeName = signalTypeInfo?.name || stationInfo?.signalType;
|
|
7870
7902
|
if (!stationInfo) return null;
|
|
7871
7903
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
7872
7904
|
className: FrequencyDataBoard_StationInfo_styles_module.stationInfo,
|
|
@@ -7903,10 +7935,15 @@ const StationInfo = ({ stationInfo })=>{
|
|
|
7903
7935
|
stationInfo.modulation
|
|
7904
7936
|
]
|
|
7905
7937
|
}),
|
|
7906
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
7938
|
+
signalTypeName && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
7907
7939
|
children: [
|
|
7908
|
-
"\
|
|
7909
|
-
|
|
7940
|
+
"\u7C7B\u578B\uFF1A",
|
|
7941
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
7942
|
+
style: {
|
|
7943
|
+
color: signalColor
|
|
7944
|
+
},
|
|
7945
|
+
children: signalTypeName
|
|
7946
|
+
})
|
|
7910
7947
|
]
|
|
7911
7948
|
}),
|
|
7912
7949
|
stationInfo.remark && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
@@ -7918,7 +7955,7 @@ const StationInfo = ({ stationInfo })=>{
|
|
|
7918
7955
|
]
|
|
7919
7956
|
});
|
|
7920
7957
|
};
|
|
7921
|
-
const
|
|
7958
|
+
const StationInfo = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(StationInfo_StationInfo);
|
|
7922
7959
|
var FrequencyDataBoard_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.5.0_@rsbuild+core@1.6.0/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/FrequencyDataBoard/styles.module.less");
|
|
7923
7960
|
var FrequencyDataBoard_styles_module_options = {};
|
|
7924
7961
|
FrequencyDataBoard_styles_module_options.styleTagTransform = styleTagTransform_default();
|
|
@@ -8034,7 +8071,7 @@ const FrequencyDataBoard = ({ left, updateKey, onChange })=>{
|
|
|
8034
8071
|
]
|
|
8035
8072
|
}),
|
|
8036
8073
|
value,
|
|
8037
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
8074
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(StationInfo, {
|
|
8038
8075
|
stationInfo: sf
|
|
8039
8076
|
})
|
|
8040
8077
|
]
|
|
@@ -8631,7 +8668,7 @@ Area_styles_module_options.insertStyleElement = insertStyleElement_default();
|
|
|
8631
8668
|
injectStylesIntoStyleTag_default()(Area_styles_module.Z, Area_styles_module_options);
|
|
8632
8669
|
const HeatmapCapture_Area_styles_module = Area_styles_module.Z && Area_styles_module.Z.locals ? Area_styles_module.Z.locals : void 0;
|
|
8633
8670
|
const Area_COMPONENT_KEY = constants_ToolType.HeatmapCapture;
|
|
8634
|
-
const
|
|
8671
|
+
const Area_Area = (props)=>{
|
|
8635
8672
|
const { state: { heatmapCapture, segments, axisX: { frequencyFormat, unit }, system, globalID } } = useStore_useStore();
|
|
8636
8673
|
const { id } = props;
|
|
8637
8674
|
const { type, show, sync, onChange } = heatmapCapture;
|
|
@@ -8798,7 +8835,7 @@ const Area = (props)=>{
|
|
|
8798
8835
|
]
|
|
8799
8836
|
});
|
|
8800
8837
|
};
|
|
8801
|
-
const
|
|
8838
|
+
const Area = Area_Area;
|
|
8802
8839
|
var RowIndex_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.5.0_@rsbuild+core@1.6.0/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/HeatmapCapture/RowIndex/styles.module.less");
|
|
8803
8840
|
var RowIndex_styles_module_options = {};
|
|
8804
8841
|
RowIndex_styles_module_options.styleTagTransform = styleTagTransform_default();
|
|
@@ -9182,7 +9219,7 @@ const HeatmapCapture_HeatmapCapture = (props)=>{
|
|
|
9182
9219
|
...props
|
|
9183
9220
|
}) : type === store_HeatmapCaptureType.RowIndex ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HeatmapCapture_RowIndex, {
|
|
9184
9221
|
...props
|
|
9185
|
-
}) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
9222
|
+
}) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Area, {
|
|
9186
9223
|
...props
|
|
9187
9224
|
});
|
|
9188
9225
|
};
|
|
@@ -14655,16 +14692,21 @@ const components_StationAllocation_styles_module = StationAllocation_styles_modu
|
|
|
14655
14692
|
const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(({ style, stationPositions, currentFrequency, segmentIndex, isCurrentSegment, onStationMouseEnter, onStationMouseLeave, isStationInHoverRange })=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
14656
14693
|
className: components_StationAllocation_styles_module.segmentContainer,
|
|
14657
14694
|
style: style,
|
|
14658
|
-
children: stationPositions.map(({ station, position }, index)=>{
|
|
14695
|
+
children: stationPositions.map(({ station, position, signalColor, tooltip }, index)=>{
|
|
14659
14696
|
const isActive = isCurrentSegment && currentFrequency >= station.startFrequency && currentFrequency <= station.stopFrequency;
|
|
14660
14697
|
const isHovered = isStationInHoverRange(station);
|
|
14698
|
+
const className = `${components_StationAllocation_styles_module.item}${isActive ? ` ${components_StationAllocation_styles_module.active}` : ''}${isHovered ? ` ${components_StationAllocation_styles_module.hovered}` : ''}`;
|
|
14699
|
+
const itemStyle = {
|
|
14700
|
+
left: position.left,
|
|
14701
|
+
width: position.width,
|
|
14702
|
+
...signalColor && {
|
|
14703
|
+
'--station-bg-color': signalColor
|
|
14704
|
+
}
|
|
14705
|
+
};
|
|
14661
14706
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
14662
|
-
className:
|
|
14663
|
-
style:
|
|
14664
|
-
|
|
14665
|
-
width: position.width
|
|
14666
|
-
},
|
|
14667
|
-
title: `${station.signalName} - ${station.frequency}${station.orgName ? ` (${station.orgName})` : ''}`,
|
|
14707
|
+
className: className,
|
|
14708
|
+
style: itemStyle,
|
|
14709
|
+
title: tooltip,
|
|
14668
14710
|
onMouseEnter: ()=>onStationMouseEnter(station),
|
|
14669
14711
|
onMouseLeave: onStationMouseLeave
|
|
14670
14712
|
}, `segment-${segmentIndex}-station-${station.signalName}-${station.frequency}-${index}`);
|
|
@@ -14673,14 +14715,14 @@ const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __
|
|
|
14673
14715
|
const StationAllocation_SegmentContainer = StationAllocation_SegmentContainer_SegmentContainer;
|
|
14674
14716
|
const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
14675
14717
|
const [hoveredFrequencyRange, setHoveredFrequencyRange] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
|
|
14676
|
-
const { state: { segments, axisX: { frequencyFormat }, zoom: { style: zoomOffStyle }, cursor: { coord: { left } }, stationInfo } } = useStore_useStore();
|
|
14718
|
+
const { state: { segments, axisX: { frequencyFormat }, zoom: { style: zoomOffStyle }, cursor: { coord: { left } }, stationInfo, system: { width: containerWidth } } } = useStore_useStore();
|
|
14677
14719
|
const stationData = stationInfo.data;
|
|
14678
14720
|
const shouldDisplay = stationInfo.show && display;
|
|
14679
14721
|
const currentFrequency = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>Number(frequencyFormat(left)), [
|
|
14680
14722
|
left,
|
|
14681
14723
|
frequencyFormat
|
|
14682
14724
|
]);
|
|
14683
|
-
const handleStationMouseEnter = (station)=>{
|
|
14725
|
+
const handleStationMouseEnter = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((station)=>{
|
|
14684
14726
|
const yian = station.bandwidth / 2 / 1000;
|
|
14685
14727
|
const startFreq = station.frequency - yian;
|
|
14686
14728
|
const stopFreq = station.frequency + yian;
|
|
@@ -14688,17 +14730,19 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14688
14730
|
start: startFreq,
|
|
14689
14731
|
stop: stopFreq
|
|
14690
14732
|
});
|
|
14691
|
-
};
|
|
14692
|
-
const handleStationMouseLeave = ()=>{
|
|
14733
|
+
}, []);
|
|
14734
|
+
const handleStationMouseLeave = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
|
|
14693
14735
|
setHoveredFrequencyRange(null);
|
|
14694
|
-
};
|
|
14695
|
-
const isStationInHoverRange = (station)=>{
|
|
14736
|
+
}, []);
|
|
14737
|
+
const isStationInHoverRange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((station)=>{
|
|
14696
14738
|
if (!hoveredFrequencyRange) return false;
|
|
14697
14739
|
const yian = station.bandwidth / 2 / 1000;
|
|
14698
14740
|
const startFreq = station.frequency - yian;
|
|
14699
14741
|
const stopFreq = station.frequency + yian;
|
|
14700
14742
|
return !(stopFreq < hoveredFrequencyRange.start || startFreq > hoveredFrequencyRange.stop);
|
|
14701
|
-
}
|
|
14743
|
+
}, [
|
|
14744
|
+
hoveredFrequencyRange
|
|
14745
|
+
]);
|
|
14702
14746
|
const currentSegmentIndex = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14703
14747
|
if (!segments?.length) return -1;
|
|
14704
14748
|
let totalPoints = 0;
|
|
@@ -14716,6 +14760,7 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14716
14760
|
]);
|
|
14717
14761
|
const segmentData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14718
14762
|
if (!segments?.length || !stationData.length) return [];
|
|
14763
|
+
const MIN_WIDTH_THRESHOLD = 1 / containerWidth * 100;
|
|
14719
14764
|
return segments.map((segment, segmentIndex)=>{
|
|
14720
14765
|
const segmentStations = stationData.filter((station)=>{
|
|
14721
14766
|
const yian = station.bandwidth / 2 / 1000;
|
|
@@ -14749,8 +14794,19 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14749
14794
|
}
|
|
14750
14795
|
startIndex = Math.max(bestStartIndex, 0);
|
|
14751
14796
|
stopIndex = Math.min(bestStopIndex, segment.point - 1);
|
|
14752
|
-
const
|
|
14797
|
+
const calculatedWidth = (stopIndex - startIndex + 1) / segment.point * 100;
|
|
14753
14798
|
const leftPos = startIndex / segment.point * 100;
|
|
14799
|
+
const width = calculatedWidth < MIN_WIDTH_THRESHOLD ? '1px' : `${calculatedWidth}%`;
|
|
14800
|
+
const signalType = station.signalType;
|
|
14801
|
+
const signalTypeInfo = SIGNAL_TYPE_MAP[signalType];
|
|
14802
|
+
const signalColor = signalTypeInfo?.color;
|
|
14803
|
+
const signalTypeName = signalTypeInfo?.name || station.signalType;
|
|
14804
|
+
const tooltip = [
|
|
14805
|
+
station.signalName,
|
|
14806
|
+
`${station.frequency}MHz`,
|
|
14807
|
+
station.orgName && `\u{5355}\u{4F4D}: ${station.orgName}`,
|
|
14808
|
+
signalTypeName && `\u{7C7B}\u{578B}: ${signalTypeName}`
|
|
14809
|
+
].filter(Boolean).join(' | ');
|
|
14754
14810
|
return {
|
|
14755
14811
|
station: {
|
|
14756
14812
|
...station,
|
|
@@ -14759,8 +14815,11 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14759
14815
|
},
|
|
14760
14816
|
position: {
|
|
14761
14817
|
left: `${leftPos}%`,
|
|
14762
|
-
width
|
|
14763
|
-
}
|
|
14818
|
+
width
|
|
14819
|
+
},
|
|
14820
|
+
signalColor,
|
|
14821
|
+
signalTypeName,
|
|
14822
|
+
tooltip
|
|
14764
14823
|
};
|
|
14765
14824
|
});
|
|
14766
14825
|
const segmentWidth = segment.point / segments.reduce((sum, s)=>sum + s.point, 0) * 100;
|
|
@@ -14777,7 +14836,8 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14777
14836
|
});
|
|
14778
14837
|
}, [
|
|
14779
14838
|
segments,
|
|
14780
|
-
stationData
|
|
14839
|
+
stationData,
|
|
14840
|
+
containerWidth
|
|
14781
14841
|
]);
|
|
14782
14842
|
if (!show || !shouldDisplay) return null;
|
|
14783
14843
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|