Skip to content

Commit

Permalink
Merge pull request #137 from arielclj/dev
Browse files Browse the repository at this point in the history
PR for issue #133 & issue #136
  • Loading branch information
NLGithubWP committed Sep 7, 2020
2 parents 20e9369 + f83f993 commit 9491460
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
24 changes: 15 additions & 9 deletions web/src/app/PlotManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export default class PlotManager {
const xAxisType = _.get(plotOption, "xAxis.type", "time")

return {
...(plotOption.title
...(series.name
? {
title: {
text: plotOption.title,
text: series.name,
},
}
: {}),
Expand All @@ -69,13 +69,19 @@ export default class PlotManager {
show: false,
},
},
series: series.map(x => {
return {
name: x.name,
type: "line",
data: x.data,
}
}),
series: {
name: series.name,
type: "line",
data: series.data.filter(y => y.reduce(z => {return z})),
}
// series.map(x => {
// return {
// name: x.name,
// type: "line",
// data: x.data.filter(y => y.reduce(z => {return z})),
// }
// })
,
}
}
}
12 changes: 6 additions & 6 deletions web/src/components/ConsoleSideBar/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ListTrainJobsIcon from "@material-ui/icons/Timeline"
import CreateTrainJobIcon from '@material-ui/icons/PostAdd';
// inference jobs
import DnsRoundedIcon from "@material-ui/icons/DnsRounded"
import TrackChangesIcon from '@material-ui/icons/TrackChanges';
// import TrackChangesIcon from '@material-ui/icons/TrackChanges';
// for nested list
import Collapse from "@material-ui/core/Collapse"
import ExpandLess from "@material-ui/icons/ExpandLess"
Expand Down Expand Up @@ -190,11 +190,11 @@ class Navigator extends React.Component {
icon: <DnsRoundedIcon />,
pathname: "/console/inferencejobs/list-inferencejobs",
},
{
id: "Run Prediction",
icon: <TrackChangesIcon />,
pathname: "/console/inferencejobs/run-prediction",
},
// {
// id: "Run Prediction",
// icon: <TrackChangesIcon />,
// pathname: "/console/inferencejobs/run-prediction",
// },
],
},
]
Expand Down
4 changes: 2 additions & 2 deletions web/src/containers/InferenceJobs/InferenceJobDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ class InferenceJobDetails extends React.Component {
</CopyToClipboard>
{this.state.copied ? alert('Host link copied to clipboard'):null}
</Grid>
<Grid item >
{/* <Grid item >
<Button
onClick={this.handleClickRunPrediction}
color="secondary"
variant="contained"
>
Predict
</Button>
</Grid>
</Grid> */}
<Grid item>
<Button
onClick={this.handleClickStopInferenceJob}
Expand Down
8 changes: 4 additions & 4 deletions web/src/containers/InferenceJobs/Prediction.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as ConsoleActions from "../ConsoleAppFrame/actions"
import { withStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import Divider from '@material-ui/core/Divider';
import Button from '@material-ui/core/Button';
// import Button from '@material-ui/core/Button';
import LinearProgress from '@material-ui/core/LinearProgress';

// for display of response
Expand Down Expand Up @@ -157,7 +157,7 @@ class RunPrediction extends React.Component {

try {
const res = await axios.post(
`http://${this.state.predictorHost}/predict`,
`http://${this.state.predictorHost}`,
formData,
{
headers: {
Expand Down Expand Up @@ -318,7 +318,7 @@ class RunPrediction extends React.Component {
UploadType={`Image`}
/>
<br />
<Button
{/* <Button
variant="contained"
color="primary"
onClick={this.handleCommit}
Expand All @@ -327,7 +327,7 @@ class RunPrediction extends React.Component {
this.state.formState === "loading"}
>
Predict
</Button>
</Button> */}
</div>
</MainContent>
<MainContent>
Expand Down
14 changes: 11 additions & 3 deletions web/src/containers/Jobs/TrialDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Typography from '@material-ui/core/Typography';
import Divider from '@material-ui/core/Divider';
import Button from '@material-ui/core/Button';
import LinearProgress from '@material-ui/core/LinearProgress';
import Grid from '@material-ui/core/Grid'


const styles = theme => ({
Expand Down Expand Up @@ -122,7 +123,10 @@ class TrialDetails extends React.Component {

for (const i in logs.plots) {
const { series, plotOption } = getPlotDetails(logs.plots[i], logs.metrics)
plotManager.updatePlot(`plot-${i}`, series, plotOption)
console.log(series, plotOption)
for (const j in logs.plots[i].metrics) {
plotManager.updatePlot(`plot-${j}`, series[j], plotOption)
}
}
}

Expand Down Expand Up @@ -216,15 +220,19 @@ class TrialDetails extends React.Component {
<Typography gutterBottom variant="h3">
Plots
</Typography>
{Object.values(logs.plots).map((x, i) => {
<Grid container spacing={24}>
{Object.values(logs.plots[0].metrics).map((x, i) => {
return (
<Grid item sm ={6}>
<Paper
key={x.title}
id={`plot-${i}`}
className={classes.plotPaper}
></Paper>
)
</Grid>
)
})}
</Grid>
</React.Fragment>
)
)
Expand Down

0 comments on commit 9491460

Please sign in to comment.