Skip to content

Commit

Permalink
Merge branch 'main' into zoomed-in-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sroy3 authored May 24, 2022
2 parents 6ce64a8 + 89d4a4c commit 0d76c6f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ComparisonPlots,
ComparisonRevision,
PlotsComparisonData
} from 'dvc/src/plots/webview/contract'
Expand Down Expand Up @@ -26,6 +27,7 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
}) => {
const pinnedColumn = useRef(currentPinnedColumn || '')
const [columns, setColumns] = useState<ComparisonTableColumn[]>([])
const [comparisonPlots, setComparisonPlots] = useState<ComparisonPlots>([])

const isPinned = (column: ComparisonTableColumn): boolean =>
column.revision === pinnedColumn.current
Expand Down Expand Up @@ -54,6 +56,8 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
[revisions, getPinnedColumnRevision]
)

useEffect(() => setComparisonPlots(plots), [plots])

const setColumnsOrder = (order: string[]) => {
const newOrder = reorderObjectList<ComparisonRevision>(
order,
Expand Down Expand Up @@ -91,7 +95,7 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
setColumnsOrder={setColumnsOrder}
setPinnedColumn={changePinnedColumn}
/>
{plots.map(({ path, revisions: revs }) => (
{comparisonPlots.map(({ path, revisions: revs }) => (
<ComparisonTableRow
key={path}
path={path}
Expand Down

0 comments on commit 0d76c6f

Please sign in to comment.