|
|
|
@@ -8,7 +8,7 @@ import G6, { G6GraphEvent, Graph, Item } from '@antv/g6'; |
|
|
|
import { ResourceInfoTabKeys } from '@/pages/Dataset/components/ResourceIntro'; |
|
|
|
import { Flex, Select } from 'antd'; |
|
|
|
import { useEffect, useRef, useState } from 'react'; |
|
|
|
import GraphLegand from '../GraphLegand'; |
|
|
|
import GraphLegend from '../GraphLegend'; |
|
|
|
import NodeTooltips from '../NodeTooltips'; |
|
|
|
import styles from './index.less'; |
|
|
|
import type { ModelDepsData, ProjectDependency, TrainDataset } from './utils'; |
|
|
|
@@ -41,16 +41,16 @@ function ModelEvolution({ |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
initGraph(); |
|
|
|
const changSize = () => { |
|
|
|
const changeSize = () => { |
|
|
|
if (!graph || graph.get('destroyed')) return; |
|
|
|
if (!graphRef.current) return; |
|
|
|
graph.changeSize(graphRef.current.clientWidth, graphRef.current.clientHeight); |
|
|
|
graph.fitView(); |
|
|
|
}; |
|
|
|
|
|
|
|
window.addEventListener('resize', changSize); |
|
|
|
window.addEventListener('resize', changeSize); |
|
|
|
return () => { |
|
|
|
window.removeEventListener('resize', changSize); |
|
|
|
window.removeEventListener('resize', changeSize); |
|
|
|
}; |
|
|
|
}, []); |
|
|
|
|
|
|
|
@@ -158,7 +158,7 @@ function ModelEvolution({ |
|
|
|
|
|
|
|
setHoverNodeData(model); |
|
|
|
setNodeToolTipX(point.x + offsetX); |
|
|
|
// 92: 版本选择器的高度,296: tooltip的高度 |
|
|
|
// 92: 版本选择器的高度,296: tooltip 的高度 |
|
|
|
setNodeToolTipY(point.y + 92 - 296 - offsetY); |
|
|
|
setShowNodeTooltip(true); |
|
|
|
}); |
|
|
|
@@ -258,7 +258,7 @@ function ModelEvolution({ |
|
|
|
onChange={onVersionChange} |
|
|
|
options={versionList} |
|
|
|
/> |
|
|
|
<GraphLegand style={{ marginRight: 0, marginLeft: 'auto' }}></GraphLegand> |
|
|
|
<GraphLegend style={{ marginRight: 0, marginLeft: 'auto' }}></GraphLegend> |
|
|
|
</Flex> |
|
|
|
<div className={styles['model-evolution__graph']} id="canvas" ref={graphRef}></div> |
|
|
|
{(showNodeTooltip || enterTooltip) && ( |
|
|
|
|