Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when scalar data empty #298

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions frontend/mock/data/plugin/histograms/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,27 @@ module.exports = function (path, queryParam, postParam) {
data: {
"test": {
"layer1/Wx_plus_b/pre_activations":
{
"displayName": "layer1/Wx_plus_b/pre_activations",
"description": ""
},
{
"displayName": "layer1/Wx_plus_b/pre_activations",
"description": ""
},
"layer1/Wx_plus_b/pre_activations_1":
{
"displayName": "layer1/Wx_plus_b/pre_activations_1",
"description": ""
}
{
"displayName": "layer1/Wx_plus_b/pre_activations_1",
"description": ""
}
},
"train": {
"layer1/Wx_plus_b/pre_activations":
{
"displayName": "layer1/Wx_plus_b/pre_activations",
"description": ""
},
"layer1/Wx_plus_b/pre_activations_1":
{
"displayName": "layer1/Wx_plus_b/pre_activations_1",
"description": ""
}
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/graph/ui/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ export default {
return {
width: 800,
height: 600,
data: [
{
name: 'train',
value: []
}
],
graphUrl: '',
};
},
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/histogram/ui/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ export default {
props: ['tagInfo', 'runs', 'chartType', 'running', 'runsItems'],
data() {
return {
data: [
{
name: 'train',
value: []
}
],
originData: [],
isExpand: false
};
Expand Down Expand Up @@ -99,7 +93,8 @@ export default {
let title = {
text: tag,
textStyle: {
fontSize: '12'
fontSize: '12',
fontFamily: 'Merriweather Sans'
}
};
if (chartType === 'overlay') {
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/scalars/ui/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ export default {
return {
width: 400,
height: 300,
data: [
{
name: 'train',
value: []
}
],
// choose run type for download file
runItemForDownload: {},
isExpand: false,
Expand Down Expand Up @@ -272,6 +266,7 @@ export default {

setChartData() {
let seriesData = this.originData.map(lineData => {
if (lineData.length == 0) return [];
// add the smoothed data
this.transformDataset(lineData);
return [
Expand Down Expand Up @@ -353,7 +348,7 @@ export default {

// Chart outlier options methods and functions ---- start.
// Compute Y domain from originData.
setChartsOutlier(seriesData) {
setChartsOutlier() {
let domainRangeArray = this.originData.map(seriesData => this.computeDataRange(seriesData, this.outlier));

// Compare, get the best Y domain.
Expand All @@ -373,6 +368,7 @@ export default {
// Compute max and min from array, if outlier is true, return quantile range.
computeDataRange(arr, isQuantile) {
// Get data range.
if (arr.length == 0) return [];
let max;
let min;
if (!isQuantile) {
Expand Down