From 15333510fdac913f191ab98cfa8f387f8e0a7d3e Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 10 Aug 2022 14:39:03 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=82=D1=83=D0=BB?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=95=D0=A1=D0=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/icons/WellIcon.tsx | 8 ++++---- src/pages/WellOperations/Tvd/TLChart.jsx | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) 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])