Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
ee7e2efb
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
接近 2 年 前同步成功
通知
89
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看板
提交
ee7e2efb
编写于
12月 26, 2017
作者:
B
BingBlog
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix scalars tooltip display problem
上级
516f18ea
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
123 addition
and
11 deletion
+123
-11
frontend/src/common/ui/Charts/chart.san
frontend/src/common/ui/Charts/chart.san
+115
-8
frontend/src/common/ui/ui-common.styl
frontend/src/common/ui/ui-common.styl
+4
-0
frontend/src/common/util/index.js
frontend/src/common/util/index.js
+2
-1
frontend/src/scalars/Scalars.san
frontend/src/scalars/Scalars.san
+1
-1
frontend/src/scalars/ui/config.san
frontend/src/scalars/ui/config.san
+1
-1
未找到文件。
frontend/src/common/ui/Charts/chart.san
浏览文件 @
ee7e2efb
...
@@ -34,6 +34,7 @@ import {isFinite, flatten, maxBy, minBy, sortBy, max, min} from 'lodash';
...
@@ -34,6 +34,7 @@ import {isFinite, flatten, maxBy, minBy, sortBy, max, min} from 'lodash';
import echarts from 'echarts';
import echarts from 'echarts';
import {generateJsonAndDownload} from '../../../common/util/downLoadFile';
import {generateJsonAndDownload} from '../../../common/util/downLoadFile';
import {quantile} from '../../../common/util/index';
import {quantile} from '../../../common/util/index';
import moment from 'moment';
// service
// service
import {getPluginScalarsScalars} from '../../../service';
import {getPluginScalarsScalars} from '../../../service';
...
@@ -80,7 +81,7 @@ export default {
...
@@ -80,7 +81,7 @@ export default {
this.initDownloadType();
this.initDownloadType();
});
});
this.watch('or
ginData', or
ginData => {
this.watch('or
iginData', ori
ginData => {
this.setChartData();
this.setChartData();
this.setChartsOutlier();
this.setChartsOutlier();
this.setChartHorizon();
this.setChartHorizon();
...
@@ -174,6 +175,7 @@ export default {
...
@@ -174,6 +175,7 @@ export default {
);
);
seriesOption = flatten(seriesOption);
seriesOption = flatten(seriesOption);
let legendOptions = tagList.map(item => item.run);
let legendOptions = tagList.map(item => item.run);
let that = this;
let option = {
let option = {
title: {
title: {
text: tag,
text: tag,
...
@@ -186,7 +188,12 @@ export default {
...
@@ -186,7 +188,12 @@ export default {
axisPointer: {
axisPointer: {
animation: true
animation: true
},
},
position: ['10%', '90%']
position: ['10%', '90%'],
formatter(params, ticket, callback) {
let data = that.getFormatterPoints(params[0].data);
return that.tansformFormatterData(data);
}
},
},
toolbox: {
toolbox: {
show: true,
show: true,
...
@@ -246,13 +253,13 @@ export default {
...
@@ -246,13 +253,13 @@ export default {
return getPluginScalarsScalars(params);
return getPluginScalarsScalars(params);
});
});
axios.all(requestList).then(resArray => {
axios.all(requestList).then(resArray => {
this.data.set('orginData', resArray.map(res => res.data));
this.data.set('or
i
ginData', resArray.map(res => res.data));
});
});
},
},
setChartData() {
setChartData() {
let or
ginData = this.data.get('or
ginData');
let or
iginData = this.data.get('ori
ginData');
let seriesData = orginData.map(lineData => {
let seriesData = or
i
ginData.map(lineData => {
// add the smoothed data
// add the smoothed data
this.tansformDataset(lineData);
this.tansformDataset(lineData);
return [
return [
...
@@ -319,7 +326,7 @@ export default {
...
@@ -319,7 +326,7 @@ export default {
startValue = millisecond;
startValue = millisecond;
}
}
// relative time, millisecond to hours
// relative time, millisecond to hours
d[4] = Math.floor(millisecond - startValue);
d[4] = Math.floor(millisecond - startValue)
/ (60 * 60 * 1000)
;
if (!isFinite(nextVal)) {
if (!isFinite(nextVal)) {
d[3] = nextVal;
d[3] = nextVal;
} else {
} else {
...
@@ -339,8 +346,8 @@ export default {
...
@@ -339,8 +346,8 @@ export default {
// compute Y domain from originData
// compute Y domain from originData
setChartsOutlier(seriesData) {
setChartsOutlier(seriesData) {
let outlier = this.data.get('outlier');
let outlier = this.data.get('outlier');
let or
ginData = this.data.get('or
ginData');
let or
iginData = this.data.get('ori
ginData');
let domainRangeArray = orginData.map(seriesData => this.computeDataRange(seriesData, outlier));
let domainRangeArray = or
i
ginData.map(seriesData => this.computeDataRange(seriesData, outlier));
// compare,get the best Y domain。
// compare,get the best Y domain。
let flattenNumbers = flatten(domainRangeArray);
let flattenNumbers = flatten(domainRangeArray);
...
@@ -453,6 +460,106 @@ export default {
...
@@ -453,6 +460,106 @@ export default {
},
},
getFormatterPoints(data) {
let originData = this.data.get('originData');
let tagList = this.data.get('tagInfo.tagList');
let sortingMethod = this.data.get('sortingMethod');
// Can't know exactly the tigger runs.
// If the step is same, regard the point as the trigger point.
let triggerValue = data[2];
let step = data[1];
let points = originData.map((series, index) => {
let nearestItem;
if (step === 0) {
nearestItem = series[0];
}
else {
for(let i = 0; i < series.length; i++) {
let item = series[i];
if (item[1] === step) {
nearestItem = item;
break;
}
if (item[1] > step) {
nearestItem = series[i -1];
break;
}
if (!nearestItem) {
nearestItem = series[series.length - 1];
}
}
}
return {
run: tagList[index].run,
item: nearestItem
};
});
if (sortingMethod === 'default' || !sortingMethod) {
return points;
}
let sortedPoints;
switch (sortingMethod) {
case 'desc':
sortedPoints = sortBy(points, one => one.item[3]);
sortedPoints.reverse();
break;
case 'asc':
sortedPoints = sortBy(points, one => one.item[3]);
break;
case 'nearest':
// compare other ponts width the trigger point, caculate the nearest sort.
sortedPoints = sortBy(points, one => one.item[3] - triggerValue);
break;
default:
sortedPoints = points
}
return sortedPoints;
},
tansformFormatterData(data) {
let indexPropMap = {
Time: 0,
Step: 1,
Value: 2,
Smoothed: 3,
Relative: 4
};
let tranformedData = data.map(item => {
let data = item.item;
return {
Run: item.run,
// keep six number for easy-read
Smoothed: data[indexPropMap['Smoothed']].toString().slice(0, 6),
Value: data[indexPropMap['Value']].toString().slice(0, 6),
Step: data[indexPropMap['Step']],
Time: moment(Math.floor(data[indexPropMap['Time'] * 1000]), 'X').format('YYYY-MM-DD HH:mm:ss'),
// relative display value should take easy-read into consideration.
// better to tranform data to 'day:hour', 'hour:minutes', 'minute: seconds' and second only.
Relative: Math.floor(data[indexPropMap['Relative']] * 60 * 60) + 's'
};
});
let headerHtml = '<tr>';
headerHtml += Object.keys(tranformedData[0]).map(key => {
return '<td style="padding: 4px">' + key + '</td>';
}).join('');
headerHtml += '</tr>';
let content = tranformedData.map(item => {
let str = '<tr>';
str += Object.keys(item).map(val => {
return '<td style="padding: 4px">' + item[val] + '</td>';
}).join('');
str += '</tr>';
return str;
}).join('');
return '<table style="font-size:12px;text-align: left;padding: 2px;"><thead>' + headerHtml + '</thead>'
+ '<tbody>' + content + '</tbody><table>';
},
setChartsRuns() {
setChartsRuns() {
// let tagInfo = this.data.get('tagInfo');
// let tagInfo = this.data.get('tagInfo');
// let runs = this.data.get('config.runs');
// let runs = this.data.get('config.runs');
...
...
frontend/src/common/ui/ui-common.styl
浏览文件 @
ee7e2efb
html {
font-family: "RobotoDraft", "Roboto", sans-serif;
}
// initual style
// initual style
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { margin:0; padding:0; } body, button, input, select, textarea { font:12px/1.5tahoma, arial, \5b8b\4f53; } h1, h2, h3, h4, h5, h6{ font-size:100%; } address, cite, dfn, em, var { font-style:normal; } code, kbd, pre, samp { font-family:couriernew, courier, monospace; } small{ font-size:12px; } ul, ol { list-style:none; } a { text-decoration:none; } a:hover { text-decoration:underline; } sup { vertical-align:text-top; } sub{ vertical-align:text-bottom; } legend { color:#000; } fieldset, img { border:0; } button, input, select, textarea { font-size:100%; } table { border-collapse:collapse; border-spacing:0; }
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { margin:0; padding:0; } body, button, input, select, textarea { font:12px/1.5tahoma, arial, \5b8b\4f53; } h1, h2, h3, h4, h5, h6{ font-size:100%; } address, cite, dfn, em, var { font-style:normal; } code, kbd, pre, samp { font-family:couriernew, courier, monospace; } small{ font-size:12px; } ul, ol { list-style:none; } a { text-decoration:none; } a:hover { text-decoration:underline; } sup { vertical-align:text-top; } sub{ vertical-align:text-bottom; } legend { color:#000; } fieldset, img { border:0; } button, input, select, textarea { font-size:100%; } table { border-collapse:collapse; border-spacing:0; }
...
...
frontend/src/common/util/index.js
浏览文件 @
ee7e2efb
import
quantile
from
'
./quantile
'
;
import
quantile
from
'
./quantile
'
;
export
{
export
{
quantile
quantile
,
compare
};
};
frontend/src/scalars/Scalars.san
浏览文件 @
ee7e2efb
...
@@ -116,7 +116,7 @@ export default {
...
@@ -116,7 +116,7 @@ export default {
groupNameReg: '.*',
groupNameReg: '.*',
smoothing: 0.6,
smoothing: 0.6,
horizontal: 'step',
horizontal: 'step',
sortingMethod: '
2
',
sortingMethod: '
default
',
downloadLink: [],
downloadLink: [],
outlier: [],
outlier: [],
runs: [],
runs: [],
...
...
frontend/src/scalars/ui/config.san
浏览文件 @
ee7e2efb
...
@@ -66,7 +66,7 @@ export default {
...
@@ -66,7 +66,7 @@ export default {
groupNameReg: '.*',
groupNameReg: '.*',
smoothing: '0.6',
smoothing: '0.6',
horizontal: 'step',
horizontal: 'step',
sortingMethod: '
2
',
sortingMethod: '
default
',
downloadLink: [],
downloadLink: [],
outlier: [],
outlier: [],
running: true
running: true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录