From 1240c15401ef7fd7ce226840b22cb519ee12ce81 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Wed, 17 Aug 2022 15:28:07 +0400 Subject: [PATCH 1/6] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8=20=D0=BA?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B8?= =?UTF-8?q?=20=D0=B0=D1=80=D1=85=D0=B8=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/monitoring/D3HorizontalCursor.tsx | 8 +++++--- src/components/d3/monitoring/D3MonitoringCharts.tsx | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index a8a1d12..44d1ec1 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -139,7 +139,7 @@ const _D3HorizontalCursor = ({ if (!mouseState.visible || fixed) return let top = mouseState.y + offsetY - if (top + height >= sizes.chartsHeight) { + if (top + height / 2 >= sizes.chartsHeight) { setPosition('bottom') top = mouseState.y - offsetY - height } else { @@ -179,14 +179,16 @@ const _D3HorizontalCursor = ({ -
+
{tooltipBodies[i]}
diff --git a/src/components/d3/monitoring/D3MonitoringCharts.tsx b/src/components/d3/monitoring/D3MonitoringCharts.tsx index 5d7f582..18a3261 100644 --- a/src/components/d3/monitoring/D3MonitoringCharts.tsx +++ b/src/components/d3/monitoring/D3MonitoringCharts.tsx @@ -559,6 +559,7 @@ const _D3MonitoringCharts = >({ groups={groups} sizes={sizes} data={data} + height={height} /> From ccd2158f36e51468d75cba4aa775fdaa04ec93c1 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Thu, 18 Aug 2022 13:14:51 +0400 Subject: [PATCH 2/6] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B2=D1=8B=D1=80=D0=B0=D0=B2=D0=BD=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=20=D0=BB=D0=B5=D0=B2?= =?UTF-8?q?=D0=BE=D0=BC=D1=83=20=D0=BA=D1=80=D0=B0=D1=8E=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BB=D0=B5=D0=B2=D0=BE=D0=B3=D0=BE=20=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=BB=D0=B1=D0=B8=D0=BA=D0=B0=20=D0=BF=D0=BE=D0=B4=D1=81?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8=20=D0=BA=D1=83=D1=80=D1=81=D0=BE?= =?UTF-8?q?=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=B3=D1=80=D0=B0=D1=84?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=BC=D0=BE=D0=BD=D0=B8=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B8=20=D0=B0=D1=80=D1=85?= =?UTF-8?q?=D0=B8=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/monitoring/D3HorizontalCursor.tsx | 3 ++- src/styles/d3.less | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index 44d1ec1..335475d 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState } from 'react' +import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState, isValidElement, cloneElement } from 'react' import * as d3 from 'd3' import { wrapPlugin } from '@components/d3/plugins/base' @@ -166,6 +166,7 @@ const _D3HorizontalCursor = ({ }) const bodies = groups.map((group) => render(group, chartData)) + .map(body => isValidElement(body) ? cloneElement(body, {className: 'tooltip-body' }) : body) setTooltipBodies(bodies) }, [groups, data, yAxis, lineY, fixed, mouseState.visible]) diff --git a/src/styles/d3.less b/src/styles/d3.less index 6ec1bb0..daadea4 100644 --- a/src/styles/d3.less +++ b/src/styles/d3.less @@ -99,6 +99,13 @@ } } } + + & .tooltip-body { + + & > div:nth-child(n+3):nth-child(3n+1) { + text-align: end; + } + } } } From 0e432df77cbf236933d5a60556eafb6f65a0aaaf Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Fri, 19 Aug 2022 12:19:42 +0400 Subject: [PATCH 3/6] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8=20=D0=BA?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B8?= =?UTF-8?q?=20=D0=B0=D1=80=D1=85=D0=B8=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/monitoring/D3HorizontalCursor.tsx | 5 ++--- src/pages/Telemetry/TelemetryView/cursorRender.jsx | 2 +- src/styles/d3.less | 7 ------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index 335475d..4466254 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState, isValidElement, cloneElement } from 'react' +import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState } from 'react' import * as d3 from 'd3' import { wrapPlugin } from '@components/d3/plugins/base' @@ -166,7 +166,6 @@ const _D3HorizontalCursor = ({ }) const bodies = groups.map((group) => render(group, chartData)) - .map(body => isValidElement(body) ? cloneElement(body, {className: 'tooltip-body' }) : body) setTooltipBodies(bodies) }, [groups, data, yAxis, lineY, fixed, mouseState.visible]) @@ -180,7 +179,7 @@ const _D3HorizontalCursor = ({ { {getChartIcon(chart)} {chart.shortLabel || chart.label} - {xFormat(chart)} + {xFormat(chart)} ) })} diff --git a/src/styles/d3.less b/src/styles/d3.less index daadea4..6ec1bb0 100644 --- a/src/styles/d3.less +++ b/src/styles/d3.less @@ -99,13 +99,6 @@ } } } - - & .tooltip-body { - - & > div:nth-child(n+3):nth-child(3n+1) { - text-align: end; - } - } } } From 20f002111de705cacf3f21fbaead22a3b740b8a2 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Fri, 19 Aug 2022 13:16:46 +0400 Subject: [PATCH 4/6] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8=20=D0=BA?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B8?= =?UTF-8?q?=20=D0=B0=D1=80=D1=85=D0=B8=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/monitoring/D3HorizontalCursor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index 4466254..af75ff0 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -139,7 +139,7 @@ const _D3HorizontalCursor = ({ if (!mouseState.visible || fixed) return let top = mouseState.y + offsetY - if (top + height / 2 >= sizes.chartsHeight) { + if (mouseState.y >= sizes.chartsHeight / 2) { setPosition('bottom') top = mouseState.y - offsetY - height } else { From 3f7fd3c0c0d02b0e5fe89fc97b453ce206eb236c Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Mon, 22 Aug 2022 10:34:19 +0400 Subject: [PATCH 5/6] =?UTF-8?q?=D0=A3=D0=B2=D0=B5=D0=BB=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=88=D0=B8=D1=80=D0=B8=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Telemetry/TelemetryView/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index c0c0242..884b23c 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -295,7 +295,7 @@ const TelemetryView = memo(() => { plugins={{ menu: { enabled: false }, cursor: { - width: 200, + width: 220, render: cursorRender, }, }} From 1a86f1727a5067270f44f2e81a84dc6963a11415 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Mon, 22 Aug 2022 10:36:54 +0400 Subject: [PATCH 6/6] =?UTF-8?q?=D0=A3=D0=B2=D0=B5=D0=BB=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=88=D0=B8=D1=80=D0=B8=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Telemetry/Archive/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Telemetry/Archive/index.jsx b/src/pages/Telemetry/Archive/index.jsx index fa0fbb3..4db24f0 100755 --- a/src/pages/Telemetry/Archive/index.jsx +++ b/src/pages/Telemetry/Archive/index.jsx @@ -255,7 +255,7 @@ const Archive = memo(() => { plugins={{ menu: { enabled: false }, cursor: { - width: 200, + width: 220, render: cursorRender, } }}