diff --git a/src/components/icons/WellIcon.tsx b/src/components/icons/WellIcon.tsx index f0b7ddf..e0f8ed1 100755 --- a/src/components/icons/WellIcon.tsx +++ b/src/components/icons/WellIcon.tsx @@ -31,7 +31,7 @@ const defaultProps: WellIconProps = { } export const WellIcon = React.memo(({ width, height, state, online, colors, ...other } : WellIconProps = defaultProps) => { - colors = {...defaultColors, ...colors} + colors = { ...defaultColors, ...colors } return ( {online && ( // Полоски, показывающие наличие свежей телеметрии - - - + + + )} diff --git a/src/pages/WellOperations/Tvd/TLChart.jsx b/src/pages/WellOperations/Tvd/TLChart.jsx index 84b431d..2d5feca 100644 --- a/src/pages/WellOperations/Tvd/TLChart.jsx +++ b/src/pages/WellOperations/Tvd/TLChart.jsx @@ -137,8 +137,7 @@ export const TLChart = memo(({ .selectAll('rect') .filter((d) => d.idCategory === data.idCategory) .attr('stroke-width', '2px') - const rect = e.target.getBoundingClientRect() - setTooltipPos({ x: rect.x, y: rect.y }) + setTooltipPos(e.target.getBoundingClientRect()) setSelected(data) }) .on('mouseout', (e, data) => { @@ -153,8 +152,8 @@ export const TLChart = memo(({ const tooltipStyle = useMemo(() => { return { ...tooltipSize, - left: tooltipPos.x - tooltipSize.width - 8, - top: tooltipPos.y - tooltipSize.height / 2 + barHeight / 2, + left: Math.min(tooltipPos.x, screen.width) - tooltipSize.width - 8, + top: Math.min(tooltipPos.y - tooltipSize.height / 2 + barHeight / 2, screen.height - tooltipSize.height - 160), } }, [tooltipPos, tooltipSize, barHeight])