Skip to content

Commit 990796c

Browse files
authored
Delete unused code in Plots (#3367)
1 parent 51e210a commit 990796c

File tree

4 files changed

+4
-29
lines changed

4 files changed

+4
-29
lines changed

webview/src/plots/components/PlotsContainer.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ import {
2323
import { isSelecting } from '../../util/strings'
2424
import { isTooltip } from '../../util/helpers'
2525

26-
export interface CommonPlotsContainerProps {
27-
onResize: (size: number) => void
28-
}
29-
30-
export interface PlotsContainerProps extends CommonPlotsContainerProps {
26+
export interface PlotsContainerProps {
3127
sectionCollapsed: boolean
3228
sectionKey: Section
3329
title: string

webview/src/plots/components/checkpointPlots/CheckpointPlotsWrapper.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { Section } from 'dvc/src/plots/webview/contract'
22
import { MessageFromWebviewType } from 'dvc/src/webview/contract'
33
import React, { useEffect, useState } from 'react'
4-
import { useSelector, useDispatch } from 'react-redux'
4+
import { useSelector } from 'react-redux'
55
import { CheckpointPlots } from './CheckpointPlots'
6-
import { changeSize } from './checkpointPlotsSlice'
76
import { PlotsContainer } from '../PlotsContainer'
87
import { sendMessage } from '../../../shared/vscode'
98
import { PlotsState } from '../../store'
109

1110
export const CheckpointPlotsWrapper: React.FC = () => {
12-
const dispatch = useDispatch()
1311
const { plotsIds, size, selectedMetrics, isCollapsed, colors } = useSelector(
1412
(state: PlotsState) => state.checkpoint
1513
)
@@ -29,10 +27,6 @@ export const CheckpointPlotsWrapper: React.FC = () => {
2927
})
3028
}
3129

32-
const handleResize = (size: number) => {
33-
dispatch(changeSize(size))
34-
}
35-
3630
const menu =
3731
plotsIds.length > 0
3832
? {
@@ -49,7 +43,6 @@ export const CheckpointPlotsWrapper: React.FC = () => {
4943
menu={menu}
5044
currentSize={size}
5145
sectionCollapsed={isCollapsed}
52-
onResize={handleResize}
5346
>
5447
<CheckpointPlots plotsIds={selectedPlots} colors={colors} />
5548
</PlotsContainer>

webview/src/plots/components/comparisonTable/ComparisonTableWrapper.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
import { Section } from 'dvc/src/plots/webview/contract'
22
import React from 'react'
3-
import { useSelector, useDispatch } from 'react-redux'
3+
import { useSelector } from 'react-redux'
44
import { ComparisonTable } from './ComparisonTable'
5-
import { changeSize } from './comparisonTableSlice'
65
import { PlotsContainer } from '../PlotsContainer'
76
import { PlotsState } from '../../store'
87

98
export const ComparisonTableWrapper: React.FC = () => {
10-
const dispatch = useDispatch()
119
const { size, isCollapsed } = useSelector(
1210
(state: PlotsState) => state.comparison
1311
)
14-
const handleResize = (size: number) => {
15-
dispatch(changeSize(size))
16-
}
1712

1813
return (
1914
<PlotsContainer
2015
title="Images"
2116
sectionKey={Section.COMPARISON_TABLE}
2217
currentSize={size}
2318
sectionCollapsed={isCollapsed}
24-
onResize={handleResize}
2519
>
2620
<ComparisonTable />
2721
</PlotsContainer>

webview/src/plots/components/templatePlots/TemplatePlotsWrapper.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
import { Section } from 'dvc/src/plots/webview/contract'
22
import React from 'react'
3-
import { useSelector, useDispatch } from 'react-redux'
3+
import { useSelector } from 'react-redux'
44
import { TemplatePlots } from './TemplatePlots'
5-
import { changeSize } from './templatePlotsSlice'
65
import { PlotsContainer } from '../PlotsContainer'
76
import { PlotsState } from '../../store'
87

98
export const TemplatePlotsWrapper: React.FC = () => {
10-
const dispatch = useDispatch()
119
const { size, isCollapsed } = useSelector(
1210
(state: PlotsState) => state.template
1311
)
14-
15-
const handleResize = (size: number) => {
16-
dispatch(changeSize(size))
17-
}
18-
1912
return (
2013
<PlotsContainer
2114
title="Data Series"
2215
sectionKey={Section.TEMPLATE_PLOTS}
2316
currentSize={size}
2417
sectionCollapsed={isCollapsed}
25-
onResize={handleResize}
2618
>
2719
<TemplatePlots />
2820
</PlotsContainer>

0 commit comments

Comments
 (0)