Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
21fcae82
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
1 年多 前同步成功
通知
88
Star
4655
Fork
642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VisualDL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
21fcae82
编写于
9月 05, 2020
作者:
P
Peter Pan
提交者:
GitHub
9月 05, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add smoothed data only option in scalar page (#795)
上级
19ac0b3c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
18 deletion
+55
-18
frontend/packages/core/public/locales/en/scalar.json
frontend/packages/core/public/locales/en/scalar.json
+1
-0
frontend/packages/core/public/locales/zh/scalar.json
frontend/packages/core/public/locales/zh/scalar.json
+1
-0
frontend/packages/core/src/components/ScalarPage/ScalarChart.tsx
...d/packages/core/src/components/ScalarPage/ScalarChart.tsx
+5
-2
frontend/packages/core/src/pages/scalar.tsx
frontend/packages/core/src/pages/scalar.tsx
+21
-2
frontend/packages/core/src/resource/scalar/chart.ts
frontend/packages/core/src/resource/scalar/chart.ts
+27
-14
未找到文件。
frontend/packages/core/public/locales/en/scalar.json
浏览文件 @
21fcae82
...
...
@@ -7,6 +7,7 @@
"minimize"
:
"Minimize"
,
"restore"
:
"Selection restore"
,
"smoothed"
:
"Smoothed"
,
"smoothed-data-only"
:
"Smoothed Data Only"
,
"smoothing"
:
"Smoothing"
,
"toggle-log-axis"
:
"Logarithmic axis"
,
"tooltip-sorting"
:
"Tooltip Sorting"
,
...
...
frontend/packages/core/public/locales/zh/scalar.json
浏览文件 @
21fcae82
...
...
@@ -7,6 +7,7 @@
"minimize"
:
"最小化"
,
"restore"
:
"还原图表框选"
,
"smoothed"
:
"Smoothed"
,
"smoothed-data-only"
:
"仅显示平滑后数据"
,
"smoothing"
:
"平滑度"
,
"toggle-log-axis"
:
"切换对数坐标轴"
,
"tooltip-sorting"
:
"详情数据排序"
,
...
...
frontend/packages/core/src/components/ScalarPage/ScalarChart.tsx
浏览文件 @
21fcae82
...
...
@@ -86,6 +86,7 @@ type ScalarChartProps = {
xAxis
:
XAxis
;
sortingMethod
:
SortingMethod
;
outlier
?:
boolean
;
smoothedOnly
?:
boolean
;
running
?:
boolean
;
};
...
...
@@ -97,6 +98,7 @@ const ScalarChart: FunctionComponent<ScalarChartProps> = ({
xAxis
,
sortingMethod
,
outlier
,
smoothedOnly
,
running
})
=>
{
const
{
t
,
i18n
}
=
useTranslation
([
'
scalar
'
,
'
common
'
]);
...
...
@@ -163,9 +165,10 @@ const ScalarChart: FunctionComponent<ScalarChartProps> = ({
chartData
({
data
:
smoothedDatasets
.
slice
(
0
,
runs
.
length
),
runs
,
xAxis
xAxis
,
smoothedOnly
}),
[
smoothedDatasets
,
runs
,
xAxis
]
[
smoothedDatasets
,
runs
,
xAxis
,
smoothedOnly
]
);
const
maxStepLength
=
useMemo
(
...
...
frontend/packages/core/src/pages/scalar.tsx
浏览文件 @
21fcae82
...
...
@@ -46,6 +46,8 @@ const Scalar: FunctionComponent = () => {
const
[
ignoreOutliers
,
setIgnoreOutliers
]
=
useState
(
false
);
const
[
smoothedDataOnly
,
setSmoothedDataOnly
]
=
useState
(
false
);
const
aside
=
useMemo
(
()
=>
runs
.
length
?
(
...
...
@@ -76,6 +78,11 @@ const Scalar: FunctionComponent = () => {
<
Field
label
=
{
t
(
'
scalar:smoothing
'
)
}
>
<
Slider
min
=
{
0
}
max
=
{
0.99
}
step
=
{
0.01
}
value
=
{
smoothing
}
onChangeComplete
=
{
setSmoothing
}
/>
</
Field
>
<
Field
>
<
Checkbox
value
=
{
smoothedDataOnly
}
onChange
=
{
setSmoothedDataOnly
}
>
{
t
(
'
scalar:smoothed-data-only
'
)
}
</
Checkbox
>
</
Field
>
</
AsideSection
>
<
AsideSection
>
<
Field
label
=
{
t
(
'
scalar:x-axis
'
)
}
>
...
...
@@ -84,7 +91,18 @@ const Scalar: FunctionComponent = () => {
</
AsideSection
>
</
RunAside
>
)
:
null
,
[
t
,
ignoreOutliers
,
onChangeRuns
,
running
,
runs
,
selectedRuns
,
smoothing
,
tooltipSorting
,
xAxis
]
[
t
,
ignoreOutliers
,
smoothedDataOnly
,
onChangeRuns
,
running
,
runs
,
selectedRuns
,
smoothing
,
tooltipSorting
,
xAxis
]
);
const
withChart
=
useCallback
<
WithChart
<
Tag
>>
(
...
...
@@ -97,10 +115,11 @@ const Scalar: FunctionComponent = () => {
xAxis
=
{
xAxis
}
sortingMethod
=
{
tooltipSorting
}
outlier
=
{
ignoreOutliers
}
smoothedOnly
=
{
smoothedDataOnly
}
running
=
{
running
}
/>
),
[
smoothing
,
xAxis
,
tooltipSorting
,
ignoreOutliers
,
running
]
[
smoothing
,
xAxis
,
tooltipSorting
,
ignoreOutliers
,
smoothedDataOnly
,
running
]
);
return
(
...
...
frontend/packages/core/src/resource/scalar/chart.ts
浏览文件 @
21fcae82
...
...
@@ -17,7 +17,17 @@ export const options = {
}
};
export
const
chartData
=
({
data
,
runs
,
xAxis
}:
{
data
:
Dataset
[];
runs
:
Run
[];
xAxis
:
XAxis
})
=>
export
const
chartData
=
({
data
,
runs
,
xAxis
,
smoothedOnly
}:
{
data
:
Dataset
[];
runs
:
Run
[];
xAxis
:
XAxis
;
smoothedOnly
?:
boolean
;
})
=>
data
.
map
((
dataset
,
i
)
=>
{
// smoothed data:
...
...
@@ -29,38 +39,41 @@ export const chartData = ({data, runs, xAxis}: {data: Dataset[]; runs: Run[]; xA
const
name
=
runs
[
i
].
label
;
const
color
=
runs
[
i
].
colors
[
0
];
const
colorAlt
=
runs
[
i
].
colors
[
1
];
return
[
const
result
=
[
{
name
,
z
:
i
,
z
:
runs
.
length
+
i
,
itemStyle
:
{
color
:
colorAlt
color
},
lineStyle
:
{
color
:
colorAlt
color
},
data
:
dataset
,
encode
:
{
x
:
[
xAxisMap
[
xAxis
]],
y
:
[
2
]
y
:
[
3
]
}
},
{
}
];
if
(
!
smoothedOnly
)
{
result
.
push
({
name
,
z
:
runs
.
length
+
i
,
z
:
i
,
itemStyle
:
{
color
color
:
colorAlt
},
lineStyle
:
{
color
color
:
colorAlt
},
data
:
dataset
,
encode
:
{
x
:
[
xAxisMap
[
xAxis
]],
y
:
[
3
]
y
:
[
2
]
}
}
];
});
}
return
result
;
})
.
flat
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录