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'