From 539030e9fdfa6085c9c7ffc0f0c7cd9d6d2069d0 Mon Sep 17 00:00:00 2001 From: goodmice Date: Sun, 14 Aug 2022 15:03:48 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D1=8B=20=D0=BC=D0=BE=D0=BD=D0=B8=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BE=D0=B1=D1=89=D1=83?= =?UTF-8?q?=D1=8E=20=D0=B4=D0=B8=D1=80=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d3/index.ts | 2 -- .../D3HorizontalCursor.tsx | 8 ++++---- .../D3MonitoringChartEditor.tsx | 5 +++-- .../d3/{ => monitoring}/D3MonitoringCharts.tsx | 17 +++++++++-------- .../D3MonitoringGroupsEditor.tsx | 2 +- src/components/d3/monitoring/index.ts | 1 + src/components/d3/plugins/index.ts | 1 - src/pages/Telemetry/Archive/index.jsx | 2 +- src/pages/Telemetry/TelemetryView/index.jsx | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) rename src/components/d3/{plugins => monitoring}/D3HorizontalCursor.tsx (95%) rename src/components/d3/{ => monitoring}/D3MonitoringChartEditor.tsx (97%) rename src/components/d3/{ => monitoring}/D3MonitoringCharts.tsx (98%) rename src/components/d3/{ => monitoring}/D3MonitoringGroupsEditor.tsx (99%) create mode 100644 src/components/d3/monitoring/index.ts diff --git a/src/components/d3/index.ts b/src/components/d3/index.ts index 8fd3688..4811ec3 100644 --- a/src/components/d3/index.ts +++ b/src/components/d3/index.ts @@ -1,6 +1,4 @@ export * from './D3Chart' export type { D3ChartProps } from './D3Chart' -export * from './D3MonitoringCharts' - export * from './types' diff --git a/src/components/d3/plugins/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx similarity index 95% rename from src/components/d3/plugins/D3HorizontalCursor.tsx rename to src/components/d3/monitoring/D3HorizontalCursor.tsx index 3b99157..a8a1d12 100644 --- a/src/components/d3/plugins/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -1,12 +1,12 @@ -import { CSSProperties, ReactNode, SVGProps, useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState } from 'react' import * as d3 from 'd3' +import { wrapPlugin } from '@components/d3/plugins/base' import { useD3MouseZone } from '@components/d3/D3MouseZone' -import { ChartGroup, ChartSizes } from '@components/d3/D3MonitoringCharts' +import { D3TooltipPosition } from '@components/d3/plugins/D3Tooltip' import { getChartIcon, isDev, usePartialProps } from '@utils' -import { wrapPlugin } from './base' -import { D3TooltipPosition } from './D3Tooltip' +import { ChartGroup, ChartSizes } from './D3MonitoringCharts' import '@styles/d3.less' diff --git a/src/components/d3/D3MonitoringChartEditor.tsx b/src/components/d3/monitoring/D3MonitoringChartEditor.tsx similarity index 97% rename from src/components/d3/D3MonitoringChartEditor.tsx rename to src/components/d3/monitoring/D3MonitoringChartEditor.tsx index 462e9ff..86ffdeb 100644 --- a/src/components/d3/D3MonitoringChartEditor.tsx +++ b/src/components/d3/monitoring/D3MonitoringChartEditor.tsx @@ -1,9 +1,10 @@ import { Button, Form, FormItemProps, Input, InputNumber, Select, Tooltip } from 'antd' import { memo, useCallback, useEffect, useMemo } from 'react' -import { ColorPicker, Color } from '../ColorPicker' +import { MinMax } from '@components/d3/types' +import { ColorPicker, Color } from '@components/ColorPicker' + import { ExtendedChartDataset } from './D3MonitoringCharts' -import { MinMax } from './types' const { Item: RawItem } = Form diff --git a/src/components/d3/D3MonitoringCharts.tsx b/src/components/d3/monitoring/D3MonitoringCharts.tsx similarity index 98% rename from src/components/d3/D3MonitoringCharts.tsx rename to src/components/d3/monitoring/D3MonitoringCharts.tsx index 86ee9c0..35db3ab 100644 --- a/src/components/d3/D3MonitoringCharts.tsx +++ b/src/components/d3/monitoring/D3MonitoringCharts.tsx @@ -16,18 +16,19 @@ import { ChartRegistry, ChartTick, MinMax -} from './types' +} from '@components/d3/types' import { BasePluginSettings, D3ContextMenu, D3ContextMenuSettings, - D3HorizontalCursor, - D3HorizontalCursorSettings -} from './plugins' -import D3MouseZone from './D3MouseZone' +} from '@components/d3/plugins' +import D3MouseZone from '@components/d3/D3MouseZone' +import { getByAccessor, getChartClass, getGroupClass, getTicks } from '@components/d3/functions' +import { renderArea, renderLine, renderNeedle, renderPoint, renderRectArea } from '@components/d3/renders' + import D3MonitoringGroupsEditor from './D3MonitoringGroupsEditor' -import { getByAccessor, getChartClass, getGroupClass, getTicks } from './functions' -import { renderArea, renderLine, renderNeedle, renderPoint, renderRectArea } from './renders' +import { D3HorizontalCursor, D3HorizontalCursorSettings } from './D3HorizontalCursor' +import D3MonitoringLimitChart from './D3MonitoringLimitChart' const roundTo = (v: number, to: number = 50) => { if (v === 0) return v @@ -73,7 +74,7 @@ const defaultOffsets: ChartOffset = { top: 10, bottom: 10, left: 100, - right: 10, + right: 20, } const getDefaultYAxisConfig = (): ChartAxis => ({ diff --git a/src/components/d3/D3MonitoringGroupsEditor.tsx b/src/components/d3/monitoring/D3MonitoringGroupsEditor.tsx similarity index 99% rename from src/components/d3/D3MonitoringGroupsEditor.tsx rename to src/components/d3/monitoring/D3MonitoringGroupsEditor.tsx index 25f9f13..90bbc4e 100644 --- a/src/components/d3/D3MonitoringGroupsEditor.tsx +++ b/src/components/d3/monitoring/D3MonitoringGroupsEditor.tsx @@ -3,11 +3,11 @@ import { Button, Divider, Empty, Modal, Popconfirm, Tooltip, Tree } from 'antd' import { UndoOutlined } from '@ant-design/icons' import { EventDataNode } from 'antd/lib/tree' +import { notify } from '@components/factory' import { getChartIcon } from '@utils' import { ExtendedChartDataset } from './D3MonitoringCharts' import D3MonitoringChartEditor from './D3MonitoringChartEditor' -import { notify } from '../factory' export type D3MonitoringGroupsEditorProps = { visible?: boolean diff --git a/src/components/d3/monitoring/index.ts b/src/components/d3/monitoring/index.ts new file mode 100644 index 0000000..59688d8 --- /dev/null +++ b/src/components/d3/monitoring/index.ts @@ -0,0 +1 @@ +export * from './D3MonitoringCharts' diff --git a/src/components/d3/plugins/index.ts b/src/components/d3/plugins/index.ts index c2fa895..40c5d84 100644 --- a/src/components/d3/plugins/index.ts +++ b/src/components/d3/plugins/index.ts @@ -1,6 +1,5 @@ export * from './base' export * from './D3ContextMenu' export * from './D3Cursor' -export * from './D3HorizontalCursor' export * from './D3Legend' export * from './D3Tooltip' diff --git a/src/pages/Telemetry/Archive/index.jsx b/src/pages/Telemetry/Archive/index.jsx index 03b20b9..cb57c64 100755 --- a/src/pages/Telemetry/Archive/index.jsx +++ b/src/pages/Telemetry/Archive/index.jsx @@ -5,7 +5,7 @@ import { Select } from 'antd' import { useIdWell } from '@asb/context' import { Flex } from '@components/Grid' -import { D3MonitoringCharts } from '@components/d3' +import { D3MonitoringCharts } from '@components/d3/monitoring' import { CopyUrlButton } from '@components/CopyUrl' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index dca17a5..6e69057 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -4,7 +4,7 @@ import { Button, Select } from 'antd' import { useIdWell } from '@asb/context' import { makeDateSorter } from '@components/Table' -import { D3MonitoringCharts } from '@components/d3' +import { D3MonitoringCharts } from '@components/d3/monitoring' import LoaderPortal from '@components/LoaderPortal' import { Grid, GridItem, Flex } from '@components/Grid' import { invokeWebApiWrapperAsync } from '@components/factory'