+ {generateMergeFileList(checkedKeys, 'selectedFiles')}
{t('mergeFileName')}:
{
diff --git a/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/FileTreeList.tsx b/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/FileTreeList.tsx
index 636eef9dd7e0d5901bcdb55621e9bd6b913ac698..7af28f7163fee80e1cd0cf48a1ee65d6a7e982b4 100644
--- a/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/FileTreeList.tsx
+++ b/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/FileTreeList.tsx
@@ -138,7 +138,7 @@ export const FileTreeList = ({ lossShowInfo, tag, setConfigChange, updateConfig
if (!exist) {
const obj: TreeItem = { title: '', selectable: false, key: '' };
if (index === len - 1) {
- obj.title = isMerge ? ({name}) : name;
+ obj.title = isMerge ? ({name}) : name;
obj.key = path;
if (isMerge) {
cur.unshift(obj);
@@ -331,7 +331,7 @@ export const FileTreeList = ({ lossShowInfo, tag, setConfigChange, updateConfig
fileList.find(item => item.tag === oneTag)?.file.forEach(file => {
const isMerge = file.isMerge;
if (isMerge) {
- tree.unshift({ title: ({`${oneTag}:${file.fileName}`}), key: `${oneTag}&&${file.fileName}:${file.filePath}`, selectable: false, checkable: true });
+ tree.unshift({ title: ({`${oneTag}:${file.fileName}`}), key: `${oneTag}&&${file.fileName}:${file.filePath}`, selectable: false, checkable: true });
} else {
tree.push({ title: `${oneTag}:${file.fileName}`, key: `${oneTag}&&${file.fileName}:${file.filePath}`, selectable: false, checkable: true });
}
diff --git a/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/Smoothing.tsx b/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/Smoothing.tsx
index eca378ba68cc8d241c5f820f2fd14dcd4c0fc4eb..fe91f3c46b1018f619939cca5e46b4aed2933345 100644
--- a/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/Smoothing.tsx
+++ b/plugins/mindstudio-insight-plugins/Scalar/front/src/components/LossShow/Smoothing.tsx
@@ -11,12 +11,26 @@ import eventBus from '@/eventBus';
export const Smoothing = ({ lossShowInfo, tag }: { lossShowInfo: LossShowInfo; tag: string | string[] }): JSX.Element => {
const { t } = useTranslation('lossShow');
- const [algorithmValue, setAlgorithmValue] = useState('');
- const [rateValue, setRateValue] = useState(0);
+ const [algorithmValue, setAlgorithmValue] = useState(''); //算法名称
+ const [rateValue, setRateValue] = useState(0); //权重值
+ const [windowSize, setWindowSize] = useState(20); //windowSize大小
+ const [top, setTop] = useState(0.25); //topX大小
const algorithmOptions = [
+ {
+ label: 'None',
+ value: '',
+ },
{
label: 'First Order IR Sample',
value: 'smoothing',
+ },
+ {
+ label: 'WindowMedian',
+ value: 'windowMedian',
+ },
+ {
+ label: 'WindowTopx',
+ value: 'windowTopx',
}
];
@@ -25,26 +39,37 @@ export const Smoothing = ({ lossShowInfo, tag }: { lossShowInfo: LossShowInfo; t
debounceUpdataSmoothingConfig();
};
- const rateChange = (value: number | null) => {
+ const configChange = (type: string, value: number | null) => {
if (Number.isNaN(value) || value === null) {
return;
}
- setRateValue(value);
+ switch (type) {
+ case 'rateValue':
+ setRateValue(value);
+ break;
+ case 'windowSize':
+ setWindowSize(value);
+ break;
+ case 'top':
+ setTop(value);
+ break;
+ default:
+ break;
+ }
debounceUpdataSmoothingConfig();
};
const debounceUpdataSmoothingConfig = useDebounce(() => {
- if (algorithmValue === '') {
- return;
- }
- lossShowInfo.modifySmoothingConfig(tag, { sampleAlgorithm: algorithmValue, sampleWeight: rateValue });
+ lossShowInfo.modifySmoothingConfig(tag, { sampleAlgorithm: algorithmValue, sampleWeight: rateValue, sampleWindowsize: windowSize, sampleTop: top });
eventBus.emit('updataChartData');
- }, 500);
+ }, 200);
const init = () => {
- const { sampleAlgorithm, sampleWeight } = lossShowInfo.getSmothingConfig(tag);
+ const { sampleAlgorithm, sampleWeight, sampleWindowsize, sampleTop } = lossShowInfo.getSmothingConfig(tag);
setAlgorithmValue(sampleAlgorithm);
setRateValue(sampleWeight);
+ setWindowSize(sampleWindowsize);
+ setTop(sampleTop);
debounceUpdataSmoothingConfig();
};
@@ -60,11 +85,28 @@ export const Smoothing = ({ lossShowInfo, tag }: { lossShowInfo: LossShowInfo; t
onChange={algorithmChange} options={algorithmOptions} maxTagCount={'responsive'} size="small" />
-