-
Notifications
You must be signed in to change notification settings - Fork 629
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
Integrate chart to scalar with Vue #268
Merged
nickyfantasy
merged 5 commits into
PaddlePaddle:migrateFromSanToVue
from
nickyfantasy:scalarWithVue
Feb 20, 2018
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0773fd6
Fix warnings from Vue compiler
nickyfantasy c9d7c90
refract naming style, fix scalar options
nickyfantasy b51b2ea
Fix config UI
nickyfantasy ea238d8
Add chart and chart page and integrate to scalar
nickyfantasy 32d4702
update with varun and jeff's comments
nickyfantasy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
<template> | ||
<div class="visual-dl-page-container"> | ||
<div>I AM SCALARS</div> | ||
|
||
<div class="visual-dl-page-left"> | ||
<div> | ||
<p> | ||
I am chart page, to show all matched tags | ||
</p> | ||
<p> | ||
tagList: {{ filteredConfig }} | ||
</p> | ||
<p> | ||
runsItems: {{ runsItems }} | ||
</p> | ||
<p> | ||
title="Tags matching {{config.groupNameReg}}" | ||
</p> | ||
</div> | ||
|
||
<div> | ||
<p> | ||
I am also a chart page, but I should render groupedTags | ||
</p> | ||
</div> | ||
<ui-chart-page | ||
:expand="true" | ||
:config="filteredConfig" | ||
:runsItems="runsItems" | ||
:tagList="filteredTagsList" | ||
:title="'Tags matching' + config.groupNameReg" | ||
></ui-chart-page> | ||
<ui-chart-page | ||
v-for="item in groupedTags" | ||
:config="filteredConfig" | ||
:runsItems="runsItems" | ||
:tagList="item.tags" | ||
:title="item.group" | ||
></ui-chart-page> | ||
</div> | ||
|
||
<div class="visual-dl-page-right"> | ||
<div class="visual-dl-page-config-container"> | ||
<Config :runsItems="config.runs" | ||
<ui-config :runsItems="runsItems" | ||
:config="config" | ||
></Config> | ||
></ui-config> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -39,14 +32,15 @@ import {getPluginScalarsTags, getRuns} from '../service'; | |
import {debounce, flatten, uniq, isArray} from 'lodash'; | ||
import autoAdjustHeight from '../common/util/autoAdjustHeight'; | ||
|
||
import Config from './ui/config' | ||
import Config from './ui/Config.vue' | ||
import ChartPage from './ui/ChartPage'; | ||
|
||
export default { | ||
components: { | ||
Config | ||
'ui-config': Config, | ||
'ui-chart-page': ChartPage | ||
}, | ||
name: 'Scalars', | ||
data () { | ||
data() { | ||
return { | ||
runsArray: [], | ||
tags: [], | ||
|
@@ -59,7 +53,8 @@ export default { | |
outlier: [], | ||
runs: [], | ||
running: true | ||
} | ||
}, | ||
filteredTagsList: [] | ||
} | ||
}, | ||
computed: { | ||
|
@@ -119,12 +114,12 @@ export default { | |
}); | ||
}, | ||
filteredConfig() { | ||
let tansformArr = ['downloadLink', 'outlier']; | ||
let transformArr = ['downloadLink', 'outlier']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
let config = this.config || {}; | ||
let filteredConfig = {}; | ||
Object.keys(config).forEach(key => { | ||
let val = config[key]; | ||
if (tansformArr.indexOf(key) > -1) { | ||
if (transformArr.indexOf(key) > -1) { | ||
filteredConfig[key] = isArray(val) && val[0] === 'yes'; | ||
} | ||
else { | ||
|
@@ -144,8 +139,8 @@ export default { | |
}); | ||
|
||
getRuns().then(({errno, data}) => { | ||
this.runsArray = data | ||
this.config.runs = data | ||
this.runsArray = data; | ||
this.config.runs = data; | ||
}); | ||
|
||
// TODO: Migrate this line from San to Vue | ||
|
@@ -162,8 +157,7 @@ export default { | |
} | ||
let tagsList = this.tagsList || []; | ||
let regExp = new RegExp(groupNameReg); | ||
let filtedTagsList = tagsList.filter(item => regExp.test(item.tag)); | ||
this.filteredTagsList = filtedTagsList; | ||
this.filteredTagsList = tagsList.filter(item => regExp.test(item.tag)); | ||
} | ||
} | ||
}; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also do
import ui-config from './ui/Config.vue'
and simply do components: {
ui-config
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm...compiler complains when I do import ui-config, "-" is not allowed in this case