From da4761513e70c63feeb5bd1eab1b8e29b476baed Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 29 Jan 2019 02:11:19 -0500 Subject: improve interface; add logo --- src/App.js | 48 ++++++++++++++++++++++++++++++++++-------------- src/Logo.js | 34 ++++++++++++++++++++++++++++++++++ src/cr.svg | 25 +++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 14 deletions(-) create mode 100644 src/Logo.js create mode 100644 src/cr.svg (limited to 'src') diff --git a/src/App.js b/src/App.js index f0023f1..a8acbc8 100755 --- a/src/App.js +++ b/src/App.js @@ -1,9 +1,9 @@ +import React from 'react'; +import PropTypes from 'prop-types'; import 'typeface-roboto'; import 'react-dates/initialize'; import 'react-dates/lib/css/_datepicker.css'; import { DateRangePicker, DayPickerRangeController } from 'react-dates'; -import React from 'react'; -import PropTypes from 'prop-types'; import classNames from 'classnames'; import { withStyles } from '@material-ui/core/styles'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; @@ -28,7 +28,10 @@ import FormControl from '@material-ui/core/FormControl'; import FormGroup from '@material-ui/core/FormGroup'; import Grid from '@material-ui/core/Grid'; import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined'; +import AddCircleIcon from '@material-ui/icons/AddCircle'; +import IconButton from '@material-ui/core/IconButton'; import { PieChart, Pie, Cell, Tooltip } from 'recharts'; +import Logo from './Logo'; const default_chart_data = [{name: 'Work', value: 10, color: cyan[300]}, {name: 'Wasted', value: 10, color: cyan[300]}]; @@ -92,9 +95,6 @@ const styles = theme => ({ display: 'flex', height: '100vh', }, - icon: { - margin: theme.spacing.unit * 2, - }, appBar: { zIndex: theme.zIndex.drawer + 1, transition: theme.transitions.create(['width', 'margin'], { @@ -117,11 +117,15 @@ const styles = theme => ({ buttonSpacer: { marginBottom: theme.spacing.unit * 4, }, + patternTableWrapper: { + overflowX: 'auto', + overflowY: 'hidden' + }, patternTable: { - overflowX: 'auto' + minWidth: 600 }, pieChart: { - margin: '0 auto' + margin: '0 auto', }, fab: { margin: theme.spacing.unit, @@ -155,21 +159,24 @@ function ChromiclePieChart(props) { return ( - +
+ `${value.toFixed(2)} hr`}/> +
- +
+ `${value.toFixed(2)} hr`}/> +
); } @@ -231,6 +239,14 @@ class Dashboard extends React.Component { this.setState({ patterns }); }; + newPattern = () => { + let patterns = [{name: '', cal: '', event: '', idx: 0 }, + ...this.state.patterns]; + for (let i = 1; i < patterns.length; i++) + patterns[i].idx = i; + this.setState({ patterns }); + }; + analyze = () => { if (!(this.state.startDate && this.state.endDate)) { alert("Please choose a valid time range."); @@ -319,7 +335,7 @@ class Dashboard extends React.Component { className={classes.appBar}> - Chromicle + Chromicle @@ -332,8 +348,12 @@ class Dashboard extends React.Component { Event Patterns + this.newPattern()}> - +
+
{Dashboard.patternHead.map(s => ({s.label}))} @@ -352,7 +372,6 @@ class Dashboard extends React.Component { { position: 'absolute', right: 0, height: 48 }) || { display: 'none' }}> this.removePattern(p.idx)} /> @@ -363,6 +382,7 @@ class Dashboard extends React.Component { )}
+ + + + + + + + Cr + + + + + diff --git a/src/cr.svg b/src/cr.svg new file mode 100644 index 0000000..b2df947 --- /dev/null +++ b/src/cr.svg @@ -0,0 +1,25 @@ + + + + + + + Cr + + + + + -- cgit v1.2.3-70-g09d2