@rfkit/charts 1.2.8 → 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.
- package/index.js +5 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14715,7 +14715,7 @@ const StationAllocation_SegmentContainer_SegmentContainer = /*#__PURE__*/ (0, __
|
|
|
14715
14715
|
const StationAllocation_SegmentContainer = StationAllocation_SegmentContainer_SegmentContainer;
|
|
14716
14716
|
const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
14717
14717
|
const [hoveredFrequencyRange, setHoveredFrequencyRange] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
|
|
14718
|
-
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();
|
|
14719
14719
|
const stationData = stationInfo.data;
|
|
14720
14720
|
const shouldDisplay = stationInfo.show && display;
|
|
14721
14721
|
const currentFrequency = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>Number(frequencyFormat(left)), [
|
|
@@ -14760,6 +14760,7 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14760
14760
|
]);
|
|
14761
14761
|
const segmentData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
14762
14762
|
if (!segments?.length || !stationData.length) return [];
|
|
14763
|
+
const MIN_WIDTH_THRESHOLD = 1 / containerWidth * 100;
|
|
14763
14764
|
return segments.map((segment, segmentIndex)=>{
|
|
14764
14765
|
const segmentStations = stationData.filter((station)=>{
|
|
14765
14766
|
const yian = station.bandwidth / 2 / 1000;
|
|
@@ -14795,7 +14796,7 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14795
14796
|
stopIndex = Math.min(bestStopIndex, segment.point - 1);
|
|
14796
14797
|
const calculatedWidth = (stopIndex - startIndex + 1) / segment.point * 100;
|
|
14797
14798
|
const leftPos = startIndex / segment.point * 100;
|
|
14798
|
-
const width =
|
|
14799
|
+
const width = calculatedWidth < MIN_WIDTH_THRESHOLD ? '1px' : `${calculatedWidth}%`;
|
|
14799
14800
|
const signalType = station.signalType;
|
|
14800
14801
|
const signalTypeInfo = SIGNAL_TYPE_MAP[signalType];
|
|
14801
14802
|
const signalColor = signalTypeInfo?.color;
|
|
@@ -14835,7 +14836,8 @@ const StationAllocation_StationAllocation = ({ show = true, display = true })=>{
|
|
|
14835
14836
|
});
|
|
14836
14837
|
}, [
|
|
14837
14838
|
segments,
|
|
14838
|
-
stationData
|
|
14839
|
+
stationData,
|
|
14840
|
+
containerWidth
|
|
14839
14841
|
]);
|
|
14840
14842
|
if (!show || !shouldDisplay) return null;
|
|
14841
14843
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|