@rfkit/charts 1.2.8 → 1.2.10
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,12 @@
|
|
|
1
|
+
import type { StationInfoType } from '../../types';
|
|
2
|
+
interface UseStationFinderProps {
|
|
3
|
+
frequency: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 台站查找 Hook
|
|
7
|
+
* 基于鼠标位置(left)和频率,在台站数据中查找匹配的台站
|
|
8
|
+
*
|
|
9
|
+
* 使用索引 + 容差判断,解决 step 跳跃和窄台站难以 hover 的问题
|
|
10
|
+
*/
|
|
11
|
+
export declare function useStationFinder({ frequency }: UseStationFinderProps): StationInfoType | undefined;
|
|
12
|
+
export {};
|
|
@@ -6,6 +6,8 @@ interface StationPosition {
|
|
|
6
6
|
left: string;
|
|
7
7
|
width: string;
|
|
8
8
|
};
|
|
9
|
+
startIndex: number;
|
|
10
|
+
stopIndex: number;
|
|
9
11
|
signalColor?: string;
|
|
10
12
|
signalTypeName?: string;
|
|
11
13
|
tooltip: string;
|
|
@@ -16,9 +18,7 @@ interface SegmentContainerProps {
|
|
|
16
18
|
currentFrequency: number;
|
|
17
19
|
segmentIndex: number;
|
|
18
20
|
isCurrentSegment: boolean;
|
|
19
|
-
|
|
20
|
-
onStationMouseLeave: () => void;
|
|
21
|
-
isStationInHoverRange: (station: StationInfoType) => boolean;
|
|
21
|
+
currentPointIndex: number;
|
|
22
22
|
}
|
|
23
23
|
declare const SegmentContainer: React.FC<SegmentContainerProps>;
|
|
24
24
|
export default SegmentContainer;
|
package/index.js
CHANGED
|
@@ -2726,14 +2726,13 @@ var __webpack_modules__ = {
|
|
|
2726
2726
|
white-space: nowrap;
|
|
2727
2727
|
text-overflow: ellipsis;
|
|
2728
2728
|
text-align: center;
|
|
2729
|
-
height:
|
|
2729
|
+
height: 8px;
|
|
2730
2730
|
color: var(--theme-color-base);
|
|
2731
2731
|
opacity: .68;
|
|
2732
|
-
pointer-events:
|
|
2732
|
+
pointer-events: none;
|
|
2733
2733
|
justify-content: center;
|
|
2734
2734
|
align-items: center;
|
|
2735
2735
|
min-width: 1px;
|
|
2736
|
-
height: 8px;
|
|
2737
2736
|
font-size: 12px;
|
|
2738
2737
|
display: flex;
|
|
2739
2738
|
position: absolute;
|
|
@@ -2745,7 +2744,9 @@ var __webpack_modules__ = {
|
|
|
2745
2744
|
content: "";
|
|
2746
2745
|
opacity: .32;
|
|
2747
2746
|
background: var(--station-bg-color, var(--theme-color-base));
|
|
2747
|
+
pointer-events: none;
|
|
2748
2748
|
width: 100%;
|
|
2749
|
+
min-width: 1px;
|
|
2749
2750
|
height: 100%;
|
|
2750
2751
|
position: absolute;
|
|
2751
2752
|
top: 0;
|
|
@@ -2758,12 +2759,8 @@ var __webpack_modules__ = {
|
|
|
2758
2759
|
}
|
|
2759
2760
|
|
|
2760
2761
|
.segmentContainer-gDwnhB .item-ybDTIt.active-qDPFJm:after {
|
|
2761
|
-
opacity: .68;
|
|
2762
|
-
background: var(--station-bg-color, var(--theme-color-primary));
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2765
|
-
.segmentContainer-gDwnhB .item-ybDTIt:hover {
|
|
2766
2762
|
opacity: 1;
|
|
2763
|
+
background: var(--station-bg-color, var(--theme-color-primary));
|
|
2767
2764
|
}
|
|
2768
2765
|
`,
|
|
2769
2766
|
""
|
|
@@ -7965,13 +7962,79 @@ FrequencyDataBoard_styles_module_options.domAPI = styleDomAPI_default();
|
|
|
7965
7962
|
FrequencyDataBoard_styles_module_options.insertStyleElement = insertStyleElement_default();
|
|
7966
7963
|
injectStylesIntoStyleTag_default()(FrequencyDataBoard_styles_module.Z, FrequencyDataBoard_styles_module_options);
|
|
7967
7964
|
const components_FrequencyDataBoard_styles_module = FrequencyDataBoard_styles_module.Z && FrequencyDataBoard_styles_module.Z.locals ? FrequencyDataBoard_styles_module.Z.locals : void 0;
|
|
7968
|
-
|
|
7969
|
-
const { state: {
|
|
7965
|
+
function useStationFinder({ frequency }) {
|
|
7966
|
+
const { state: { cursor: { coord: { left } }, segments, stationInfo } } = useStore_useStore();
|
|
7967
|
+
const stationData = stationInfo.data;
|
|
7968
|
+
const totalSegmentPoints = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>segments?.reduce((sum, s)=>sum + s.point, 0) || 0, [
|
|
7969
|
+
segments
|
|
7970
|
+
]);
|
|
7971
|
+
const currentPosition = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
7972
|
+
if (!segments?.length || !totalSegmentPoints) return {
|
|
7973
|
+
segmentIndex: -1,
|
|
7974
|
+
pointIndex: -1
|
|
7975
|
+
};
|
|
7976
|
+
let totalPoints = 0;
|
|
7977
|
+
const mousePositionRatio = left / 100;
|
|
7978
|
+
for(let i = 0; i < segments.length; i++){
|
|
7979
|
+
const segmentRatio = segments[i].point / totalSegmentPoints;
|
|
7980
|
+
if (mousePositionRatio >= totalPoints && mousePositionRatio <= totalPoints + segmentRatio) {
|
|
7981
|
+
const relativeRatio = (mousePositionRatio - totalPoints) / segmentRatio;
|
|
7982
|
+
const pointIndex = Math.floor(relativeRatio * segments[i].point);
|
|
7983
|
+
return {
|
|
7984
|
+
segmentIndex: i,
|
|
7985
|
+
pointIndex
|
|
7986
|
+
};
|
|
7987
|
+
}
|
|
7988
|
+
totalPoints += segmentRatio;
|
|
7989
|
+
}
|
|
7990
|
+
return {
|
|
7991
|
+
segmentIndex: -1,
|
|
7992
|
+
pointIndex: -1
|
|
7993
|
+
};
|
|
7994
|
+
}, [
|
|
7995
|
+
segments,
|
|
7996
|
+
totalSegmentPoints,
|
|
7997
|
+
left
|
|
7998
|
+
]);
|
|
7999
|
+
const station = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
8000
|
+
if (!left || !stationData.length || !segments?.length) return;
|
|
8001
|
+
const currentSegment = segments[currentPosition.segmentIndex];
|
|
8002
|
+
if (!currentSegment) return;
|
|
8003
|
+
const f = Number(frequency);
|
|
8004
|
+
const TOLERANCE = 2;
|
|
8005
|
+
const rangeStart = currentPosition.pointIndex - TOLERANCE;
|
|
8006
|
+
const rangeEnd = currentPosition.pointIndex + TOLERANCE;
|
|
8007
|
+
const totalRange = currentSegment.stop - currentSegment.start;
|
|
8008
|
+
const matchedStation = stationData.find((i)=>{
|
|
8009
|
+
const yian = i.bandwidth / 2 / 1000;
|
|
8010
|
+
const startFrequency = i.frequency - yian;
|
|
8011
|
+
const endFrequency = i.frequency + yian;
|
|
8012
|
+
if (endFrequency < currentSegment.start || startFrequency > currentSegment.stop) return false;
|
|
8013
|
+
let startIndex = Math.ceil((startFrequency - currentSegment.start) / totalRange * currentSegment.point) - 1;
|
|
8014
|
+
let stopIndex = Math.floor((endFrequency - currentSegment.start) / totalRange * currentSegment.point) - 1;
|
|
8015
|
+
startIndex = Math.max(startIndex, 0);
|
|
8016
|
+
stopIndex = Math.min(stopIndex, currentSegment.point - 1);
|
|
8017
|
+
const isMatchByIndex = !(rangeEnd < startIndex || rangeStart > stopIndex);
|
|
8018
|
+
const isMatchByFrequency = f >= startFrequency && f <= endFrequency;
|
|
8019
|
+
return isMatchByIndex || isMatchByFrequency;
|
|
8020
|
+
});
|
|
8021
|
+
return matchedStation;
|
|
8022
|
+
}, [
|
|
8023
|
+
frequency,
|
|
8024
|
+
stationData,
|
|
8025
|
+
segments,
|
|
8026
|
+
currentPosition,
|
|
8027
|
+
left
|
|
8028
|
+
]);
|
|
8029
|
+
return station;
|
|
8030
|
+
}
|
|
8031
|
+
const FrequencyDataBoard_FrequencyDataBoard = ({ left, updateKey, onChange })=>{
|
|
8032
|
+
const { state: { axisY, axisX: { frequencyFormat, unit }, globalID } } = useStore_useStore();
|
|
7970
8033
|
const filteredSeries = useFilteredSeries(globalID);
|
|
7971
8034
|
const index = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(Number.NaN);
|
|
7972
8035
|
const calculateIndex = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((data, n, series)=>{
|
|
7973
8036
|
const values = data[n] || [];
|
|
7974
|
-
if (0 === values.length) return null;
|
|
8037
|
+
if (!values || 0 === values.length) return null;
|
|
7975
8038
|
index.current = Math.max(0, Math.ceil(values.length * left / 100) - 1);
|
|
7976
8039
|
const level = getVirtualLevel(axisY.unit, values[index.current])?.toFixed(1);
|
|
7977
8040
|
if (!(0, utils.Ri)(level)) return null;
|
|
@@ -8040,22 +8103,9 @@ const FrequencyDataBoard = ({ left, updateKey, onChange })=>{
|
|
|
8040
8103
|
frequency,
|
|
8041
8104
|
onChange
|
|
8042
8105
|
]);
|
|
8043
|
-
const
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
const item = stationInfo.data.find((i)=>{
|
|
8047
|
-
const yian = i.bandwidth / 2 / 1000;
|
|
8048
|
-
const startFrequency = i.frequency - yian;
|
|
8049
|
-
const endFrequency = i.frequency + yian;
|
|
8050
|
-
return f >= startFrequency && f <= endFrequency;
|
|
8051
|
-
});
|
|
8052
|
-
return item;
|
|
8053
|
-
}
|
|
8054
|
-
return '';
|
|
8055
|
-
}, [
|
|
8056
|
-
frequency,
|
|
8057
|
-
stationInfo
|
|
8058
|
-
]);
|
|
8106
|
+
const matchedStation = useStationFinder({
|
|
8107
|
+
frequency
|
|
8108
|
+
});
|
|
8059
8109
|
const hasValue = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>value && (Array.isArray(value) ? value.length > 0 : true), [
|
|
8060
8110
|
value
|
|
8061
8111
|
]);
|
|
@@ -8072,12 +8122,12 @@ const FrequencyDataBoard = ({ left, updateKey, onChange })=>{
|
|
|
8072
8122
|
}),
|
|
8073
8123
|
value,
|
|
8074
8124
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(StationInfo, {
|
|
8075
|
-
stationInfo:
|
|
8125
|
+
stationInfo: matchedStation
|
|
8076
8126
|
})
|
|
8077
8127
|
]
|
|
8078
8128
|
});
|
|
8079
8129
|
};
|
|
8080
|
-
const
|
|
8130
|
+
const FrequencyDataBoard = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(FrequencyDataBoard_FrequencyDataBoard);
|
|
8081
8131
|
const useUpdateKey = (key, id)=>{
|
|
8082
8132
|
const [updateKey, setUpdateKey] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(0);
|
|
8083
8133
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
@@ -8100,7 +8150,7 @@ const FrequencyDisplay = ({ frequency, unit })=>frequency ? /*#__PURE__*/ (0, __
|
|
|
8100
8150
|
const SpectrumPopover = ({ id })=>{
|
|
8101
8151
|
const { state: { cursor: { coord: { left } } } } = useStore_useStore();
|
|
8102
8152
|
const updateKey = useUpdateKey('SpectrumPopover', id);
|
|
8103
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
8153
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyDataBoard, {
|
|
8104
8154
|
left: left,
|
|
8105
8155
|
updateKey: updateKey
|
|
8106
8156
|
});
|
|
@@ -13475,7 +13525,7 @@ const Board_Board = ({ id })=>{
|
|
|
13475
13525
|
if (!show || !display) return null;
|
|
13476
13526
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
13477
13527
|
className: FrequencyTagLine_Board_styles_module.board,
|
|
13478
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
13528
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyDataBoard, {
|
|
13479
13529
|
left: left,
|
|
13480
13530
|
updateKey: updateKey,
|
|
13481
13531
|
onChange: handleChange
|
|
@@ -14689,13 +14739,17 @@ StationAllocation_styles_module_options.domAPI = styleDomAPI_default();
|
|
|
14689
14739
|
StationAllocation_styles_module_options.insertStyleElement = insertStyleElement_default();
|
|
14690
14740
|
injectStylesIntoStyleTag_default()(StationAllocation_styles_module.Z, StationAllocation_styles_module_options);
|
|
14691
14741
|
const components_StationAllocation_styles_module = StationAllocation_styles_module.Z && StationAllocation_styles_module.Z.locals ? StationAllocation_styles_module.Z.locals : void 0;
|
|
14692
|
-
const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(({ style, stationPositions, currentFrequency, segmentIndex, isCurrentSegment,
|
|
14742
|
+
const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(({ style, stationPositions, currentFrequency, segmentIndex, isCurrentSegment, currentPointIndex })=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
14693
14743
|
className: components_StationAllocation_styles_module.segmentContainer,
|
|
14694
14744
|
style: style,
|
|
14695
|
-
children: stationPositions.map(({ station, position, signalColor, tooltip }, index)=>{
|
|
14696
|
-
const
|
|
14697
|
-
const
|
|
14698
|
-
const
|
|
14745
|
+
children: stationPositions.map(({ station, position, signalColor, tooltip, startIndex, stopIndex }, index)=>{
|
|
14746
|
+
const TOLERANCE = 2;
|
|
14747
|
+
const rangeStart = currentPointIndex - TOLERANCE;
|
|
14748
|
+
const rangeEnd = currentPointIndex + TOLERANCE;
|
|
14749
|
+
const isActiveByIndex = isCurrentSegment && !(rangeEnd < startIndex || rangeStart > stopIndex);
|
|
14750
|
+
const isActiveByFrequency = isCurrentSegment && currentFrequency >= station.startFrequency && currentFrequency <= station.stopFrequency;
|
|
14751
|
+
const isActive = isActiveByIndex || isActiveByFrequency;
|
|
14752
|
+
const className = `${components_StationAllocation_styles_module.item}${isActive ? ` ${components_StationAllocation_styles_module.active}` : ''}`;
|
|
14699
14753
|
const itemStyle = {
|
|
14700
14754
|
left: position.left,
|
|
14701
14755
|
width: position.width,
|
|
@@ -14706,15 +14760,12 @@ const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __
|
|
|
14706
14760
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
14707
14761
|
className: className,
|
|
14708
14762
|
style: itemStyle,
|
|
14709
|
-
title: tooltip
|
|
14710
|
-
onMouseEnter: ()=>onStationMouseEnter(station),
|
|
14711
|
-
onMouseLeave: onStationMouseLeave
|
|
14763
|
+
title: tooltip
|
|
14712
14764
|
}, `segment-${segmentIndex}-station-${station.signalName}-${station.frequency}-${index}`);
|
|
14713
14765
|
})
|
|
14714
14766
|
}));
|
|
14715
14767
|
const StationAllocation_SegmentContainer = StationAllocation_SegmentContainer_SegmentContainer;
|
|
14716
14768
|
const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
14717
|
-
const [hoveredFrequencyRange, setHoveredFrequencyRange] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
|
|
14718
14769
|
const { state: { segments, axisX: { frequencyFormat }, zoom: { style: zoomOffStyle }, cursor: { coord: { left } }, stationInfo } } = useStore_useStore();
|
|
14719
14770
|
const stationData = stationInfo.data;
|
|
14720
14771
|
const shouldDisplay = stationInfo.show && display;
|
|
@@ -14722,54 +14773,49 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14722
14773
|
left,
|
|
14723
14774
|
frequencyFormat
|
|
14724
14775
|
]);
|
|
14725
|
-
const
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
start: startFreq,
|
|
14731
|
-
stop: stopFreq
|
|
14732
|
-
});
|
|
14733
|
-
}, []);
|
|
14734
|
-
const handleStationMouseLeave = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
|
|
14735
|
-
setHoveredFrequencyRange(null);
|
|
14736
|
-
}, []);
|
|
14737
|
-
const isStationInHoverRange = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((station)=>{
|
|
14738
|
-
if (!hoveredFrequencyRange) return false;
|
|
14739
|
-
const yian = station.bandwidth / 2 / 1000;
|
|
14740
|
-
const startFreq = station.frequency - yian;
|
|
14741
|
-
const stopFreq = station.frequency + yian;
|
|
14742
|
-
return !(stopFreq < hoveredFrequencyRange.start || startFreq > hoveredFrequencyRange.stop);
|
|
14743
|
-
}, [
|
|
14744
|
-
hoveredFrequencyRange
|
|
14745
|
-
]);
|
|
14746
|
-
const currentSegmentIndex = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14747
|
-
if (!segments?.length) return -1;
|
|
14776
|
+
const currentPosition = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14777
|
+
if (!segments?.length) return {
|
|
14778
|
+
segmentIndex: -1,
|
|
14779
|
+
pointIndex: -1
|
|
14780
|
+
};
|
|
14748
14781
|
let totalPoints = 0;
|
|
14749
14782
|
const totalSegmentPoints = segments.reduce((sum, s)=>sum + s.point, 0);
|
|
14750
14783
|
const mousePositionRatio = left / 100;
|
|
14751
14784
|
for(let i = 0; i < segments.length; i++){
|
|
14752
14785
|
const segmentRatio = segments[i].point / totalSegmentPoints;
|
|
14753
|
-
if (mousePositionRatio >= totalPoints && mousePositionRatio <= totalPoints + segmentRatio)
|
|
14786
|
+
if (mousePositionRatio >= totalPoints && mousePositionRatio <= totalPoints + segmentRatio) {
|
|
14787
|
+
const relativeRatio = (mousePositionRatio - totalPoints) / segmentRatio;
|
|
14788
|
+
const pointIndex = Math.floor(relativeRatio * segments[i].point);
|
|
14789
|
+
return {
|
|
14790
|
+
segmentIndex: i,
|
|
14791
|
+
pointIndex
|
|
14792
|
+
};
|
|
14793
|
+
}
|
|
14754
14794
|
totalPoints += segmentRatio;
|
|
14755
14795
|
}
|
|
14756
|
-
return
|
|
14796
|
+
return {
|
|
14797
|
+
segmentIndex: -1,
|
|
14798
|
+
pointIndex: -1
|
|
14799
|
+
};
|
|
14757
14800
|
}, [
|
|
14758
14801
|
segments,
|
|
14759
14802
|
left
|
|
14760
14803
|
]);
|
|
14761
14804
|
const segmentData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14762
14805
|
if (!segments?.length || !stationData.length) return [];
|
|
14806
|
+
const totalSegmentPoints = segments.reduce((sum, s)=>sum + s.point, 0);
|
|
14763
14807
|
return segments.map((segment, segmentIndex)=>{
|
|
14764
14808
|
const segmentStations = stationData.filter((station)=>{
|
|
14765
|
-
const
|
|
14809
|
+
const bandwidthMHz = station.bandwidth / 1000;
|
|
14810
|
+
const yian = bandwidthMHz / 2;
|
|
14766
14811
|
const startFreq = station.frequency - yian;
|
|
14767
14812
|
const stopFreq = station.frequency + yian;
|
|
14768
14813
|
return !(stopFreq < segment.start || startFreq > segment.stop);
|
|
14769
14814
|
});
|
|
14770
14815
|
const stationPositions = segmentStations.map((station)=>{
|
|
14771
14816
|
const totalRange = segment.stop - segment.start;
|
|
14772
|
-
const
|
|
14817
|
+
const bandwidthMHz = station.bandwidth / 1000;
|
|
14818
|
+
const yian = bandwidthMHz / 2;
|
|
14773
14819
|
const startFreq = station.frequency - yian;
|
|
14774
14820
|
const stopFreq = station.frequency + yian;
|
|
14775
14821
|
let startIndex = Math.ceil((startFreq - segment.start) / totalRange * segment.point) - 1;
|
|
@@ -14795,7 +14841,6 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14795
14841
|
stopIndex = Math.min(bestStopIndex, segment.point - 1);
|
|
14796
14842
|
const calculatedWidth = (stopIndex - startIndex + 1) / segment.point * 100;
|
|
14797
14843
|
const leftPos = startIndex / segment.point * 100;
|
|
14798
|
-
const width = 0 === calculatedWidth ? '1px' : `${calculatedWidth}%`;
|
|
14799
14844
|
const signalType = station.signalType;
|
|
14800
14845
|
const signalTypeInfo = SIGNAL_TYPE_MAP[signalType];
|
|
14801
14846
|
const signalColor = signalTypeInfo?.color;
|
|
@@ -14814,15 +14859,17 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14814
14859
|
},
|
|
14815
14860
|
position: {
|
|
14816
14861
|
left: `${leftPos}%`,
|
|
14817
|
-
width
|
|
14862
|
+
width: `${calculatedWidth}%`
|
|
14818
14863
|
},
|
|
14864
|
+
startIndex,
|
|
14865
|
+
stopIndex,
|
|
14819
14866
|
signalColor,
|
|
14820
14867
|
signalTypeName,
|
|
14821
14868
|
tooltip
|
|
14822
14869
|
};
|
|
14823
14870
|
});
|
|
14824
|
-
const segmentWidth = segment.point /
|
|
14825
|
-
const segmentLeft = segments.slice(0, segmentIndex).reduce((sum, s)=>sum + s.point /
|
|
14871
|
+
const segmentWidth = segment.point / totalSegmentPoints * 100;
|
|
14872
|
+
const segmentLeft = segments.slice(0, segmentIndex).reduce((sum, s)=>sum + s.point / totalSegmentPoints * 100, 0);
|
|
14826
14873
|
return {
|
|
14827
14874
|
segment,
|
|
14828
14875
|
segmentIndex,
|
|
@@ -14848,10 +14895,8 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14848
14895
|
stationPositions: stationPositions,
|
|
14849
14896
|
currentFrequency: currentFrequency,
|
|
14850
14897
|
segmentIndex: segmentIndex,
|
|
14851
|
-
isCurrentSegment:
|
|
14852
|
-
|
|
14853
|
-
onStationMouseLeave: handleStationMouseLeave,
|
|
14854
|
-
isStationInHoverRange: isStationInHoverRange
|
|
14898
|
+
isCurrentSegment: currentPosition.segmentIndex === segmentIndex,
|
|
14899
|
+
currentPointIndex: currentPosition.pointIndex
|
|
14855
14900
|
}, `segment-${segmentIndex}`))
|
|
14856
14901
|
})
|
|
14857
14902
|
});
|
|
@@ -15535,7 +15580,7 @@ const AxisXTicks = ({ type })=>{
|
|
|
15535
15580
|
});
|
|
15536
15581
|
};
|
|
15537
15582
|
const AxisX_Ticks = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(AxisXTicks);
|
|
15538
|
-
const
|
|
15583
|
+
const AxisX = ({ type })=>{
|
|
15539
15584
|
const { state: { axisX } } = useStore_useStore();
|
|
15540
15585
|
const { children, unit, ticks } = axisX;
|
|
15541
15586
|
const { width, pluginBoxWidth } = useAxisYWidth_useAxisYWidth();
|
|
@@ -15573,7 +15618,7 @@ const AxisX_AxisX = ({ type })=>{
|
|
|
15573
15618
|
})
|
|
15574
15619
|
});
|
|
15575
15620
|
};
|
|
15576
|
-
const
|
|
15621
|
+
const components_AxisX = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(AxisX);
|
|
15577
15622
|
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.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/Blaze/styles.module.less");
|
|
15578
15623
|
var Blaze_styles_module_options = {};
|
|
15579
15624
|
Blaze_styles_module_options.styleTagTransform = styleTagTransform_default();
|
|
@@ -16211,7 +16256,7 @@ const HeatmapPortal_Chart = (props)=>{
|
|
|
16211
16256
|
type: constants_ChartType.Heatmap
|
|
16212
16257
|
}),
|
|
16213
16258
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Heatmap, {}),
|
|
16214
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
16259
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
|
|
16215
16260
|
type: type
|
|
16216
16261
|
})
|
|
16217
16262
|
]
|
|
@@ -16229,7 +16274,7 @@ const OccupancyPortal_Chart = (props)=>{
|
|
|
16229
16274
|
type: constants_ChartType.Occupancy
|
|
16230
16275
|
}),
|
|
16231
16276
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Occupancy, {}),
|
|
16232
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
16277
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
|
|
16233
16278
|
type: type
|
|
16234
16279
|
})
|
|
16235
16280
|
]
|
|
@@ -16297,7 +16342,7 @@ const Spectrum_Chart_Chart = (props)=>{
|
|
|
16297
16342
|
})
|
|
16298
16343
|
]
|
|
16299
16344
|
}),
|
|
16300
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
16345
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_AxisX, {
|
|
16301
16346
|
type: type
|
|
16302
16347
|
})
|
|
16303
16348
|
]
|