Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Some little style (#2762)
Browse files Browse the repository at this point in the history
Co-authored-by: Lijiao <15910218274@163.com>
  • Loading branch information
Lijiaoa and lvybriage authored Aug 11, 2020
1 parent 995f625 commit 59b76c2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 23 deletions.
15 changes: 12 additions & 3 deletions src/webui/src/components/Modals/Compare.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import * as React from 'react';
import { Stack, Modal, IconButton } from 'office-ui-fabric-react';
import { Stack, Modal, IconButton, IDragOptions, ContextualMenu } from 'office-ui-fabric-react';
import ReactEcharts from 'echarts-for-react';
import IntermediateVal from '../public-child/IntermediateVal';
import { TRIALS } from '../../static/datamodel';
import { TableRecord, Intermedia, TooltipForIntermediate } from '../../static/interface';
import { contentStyles, iconButtonStyles } from '../Buttons/ModalTheme';
import '../../static/style/compare.scss';
import { TableRecord, Intermedia, TooltipForIntermediate } from '../../static/interface';

const dragOptions: IDragOptions = {
moveMenuItemText: 'Move',
closeMenuItemText: 'Close',
menu: ContextualMenu
};

// the modal of trial compare
interface CompareProps {
Expand Down Expand Up @@ -79,7 +85,8 @@ class Compare extends React.Component<CompareProps, {}> {
containLabel: true
},
legend: {
data: idsList
// more than 10 trials will hide legend
data: idsList.length > 10 ? null : idsList
},
xAxis: {
type: 'category',
Expand Down Expand Up @@ -209,6 +216,8 @@ class Compare extends React.Component<CompareProps, {}> {
isOpen={true}
containerClassName={contentStyles.container}
className="compare-modal"
allowTouchBodyScroll={true}
dragOptions={dragOptions}
>
<div>
<div className={contentStyles.header}>
Expand Down
27 changes: 14 additions & 13 deletions src/webui/src/components/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ import TrialInfo from './overview/TrialProfile';
import '../static/style/overview.scss';
import '../static/style/logPath.scss';

const stackTokens: IStackTokens = {
childrenGap: 30,
};

const entriesOption = [
{ key: '10', text: 'Display top 10 trials' },
{ key: '20', text: 'Display top 20 trials' },
{ key: '30', text: 'Display top 30 trials' },
{ key: '50', text: 'Display top 50 trials' },
{ key: '100', text: 'Display top 100 trials' }
];

interface OverviewProps {
experimentUpdateBroadcast: number;
trialsUpdateBroadcast: number;
Expand Down Expand Up @@ -70,17 +82,6 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
const titleMaxbgcolor = (metricGraphMode === 'max' ? '#333' : '#b3b3b3');
const titleMinbgcolor = (metricGraphMode === 'min' ? '#333' : '#b3b3b3');

const stackTokens: IStackTokens = {
childrenGap: 30,
};

const entriesOption = [
{ key: '10', text: 'Display top 10 trials' },
{ key: '20', text: 'Display top 20 trials' },
{ key: '30', text: 'Display top 30 trials' },
{ key: '50', text: 'Display top 50 trials' },
{ key: '100', text: 'Display top 100 trials' }
];
return (
<div className="overview">
{/* status and experiment block */}
Expand Down Expand Up @@ -123,7 +124,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
</Stack>

<Stack style={{backgroundColor: '#fff'}}>
<Stack horizontal className="top10bg" style={{position: 'relative'}}>
<Stack horizontal className="top10bg" style={{position: 'relative', height: 42}}>
<div
className="title"
onClick={this.clickMaxTop}
Expand All @@ -136,7 +137,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
>
<Title1 text="Top minimal trials" icon="min.png" fontColor={titleMinbgcolor} />
</div>
<div style={{position: 'absolute', right: 52, top: 6}}>
<div style={{position: 'absolute', right: '2%', top: 8}}>
<Dropdown
selectedKey={bestTrialEntries}
options={entriesOption}
Expand Down
1 change: 1 addition & 0 deletions src/webui/src/components/trial-detail/TableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
style={{
width: 0.5 * modalIntermediateWidth,
height: 0.7 * modalIntermediateHeight,
maxHeight: 534,
padding: 20
}}
theme="my_theme"
Expand Down
3 changes: 2 additions & 1 deletion src/webui/src/static/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ const intermediateGraphOption = (intermediateArr: number[], id: string): any =>
yAxis: {
name: 'Default metric',
type: 'value',
data: intermediateArr
data: intermediateArr,
scale: true
},
series: [{
symbolSize: 6,
Expand Down
7 changes: 5 additions & 2 deletions src/webui/src/static/style/compare.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.compare-modal{
/* decide modal size */
.ms-Dialog-main{
max-width: 70%;
width: 50%;
overflow: hidden;
}

/* compare-md: table style */
&-table{
width: 92%;
table-layout: fixed;
margin: 0 auto;
margin-bottom: 20px;
border: 1px solid transparent;
overflow: auto;
color: #333;
tr{
line-height: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/webui/src/static/style/overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
padding: 15px 20px;
height: 100%;
min-width: 500px;
overflow-y: scroll;
overflow-y: auto;
}

.padItem{
Expand Down
2 changes: 1 addition & 1 deletion src/webui/src/static/style/succTable.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#succTable{
height: 404px;
overflow-y: scroll;
overflow: auto;
position: relative;
.succTable-tooltip{
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions src/webui/src/static/style/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
height: 324px;
overflow: hidden;
#succeTable .commonTableStyle{
overflow-y: scroll;
overflow-y: auto;
}
}

Expand Down Expand Up @@ -55,5 +55,5 @@
}
.columns-height{
max-height: 335px;
overflow-y: scroll;
overflow-y: auto;
}

0 comments on commit 59b76c2

Please sign in to comment.