Skip to content

Commit

Permalink
Application Tour (#252)
Browse files Browse the repository at this point in the history
* Begins implementing a general vCDAT tour feature.

* Fills in the rest of the tour tips. Fixes isue where the tour only ran once. Adjusts css

* Fixes a bit of grammar and adds some css to try and emphasize that they have to select something before clicking edit. (This is a weirdly common issue amoung users)
  • Loading branch information
James-Crean authored and mattben committed Mar 28, 2018
1 parent cb66aac commit 49ff1e0
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 53 deletions.
59 changes: 59 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"react-dnd": "^2.2.4",
"react-dnd-html5-backend": "^2.2.4",
"react-dom": "^15.1.0",
"react-joyride": "^1.11.4",
"react-redux": "^4.4.5",
"react-toastify": "^3.3.1",
"redux": "=3.5.2",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/components/GMList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var GMList = React.createClass({
});

return (
<div className='left-side-list scroll-area-list-parent'>
<div className='left-side-list scroll-area-list-parent gm-list-container'>
<AddEditRemoveNav
title='Graphics Methods'
editAction={this.clickedEdit}
Expand Down
86 changes: 47 additions & 39 deletions frontend/src/js/components/PlotInspector/PlotInspector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,52 @@ class PlotInspector extends React.PureComponent {
return (
<div className="plot-inspector-wrapper">
<div className="tools-container">
<p className="tools-header">Tools</p>
<button
className='btn btn-default btn-sm'
onClick={this.props.onUndo}
disabled={!this.props.undoEnabled}>
<i className='glyphicon glyphicon-share-alt icon-flipped'></i>
<span> Undo</span>
</button>
<button
className='btn btn-default btn-sm'
onClick={this.props.onRedo}
disabled={!this.props.redoEnabled}>
<i className='glyphicon glyphicon-share-alt'></i>
<span> Redo</span>
</button>
<button
id="add-plot-button"
className="btn btn-default btn-sm"
onClick={this.props.handleAddPlot}
disabled={!(this.props.cell_row > -1 && this.props.cell_col > -1)}>
<i className="glyphicon glyphicon-plus green"></i>
<span> Add Plot</span>
</button>
<button
id="clear-canvas-button"
className="btn btn-default btn-sm material-icons-button"
onClick={this.props.handleClearCell}
title="Clear selected plot">
<i className="material-icons" style={{color: "red"}}>clear</i>
<span> Clear Cell</span>
</button>
<button
id="open-colormap-editor-button"
className="btn btn-default btn-sm material-icons-button"
onClick={this.props.handleOpenColormapEditor}
title="Open the colormap editor">
<i className="material-icons" style={{color: "blue"}}>color_lens</i>
<span> Colormap Editor</span>
</button>
<div className="tools-header">
<p>Tools</p>
<span onClick={this.props.startTour} className="help-button main-help btn btn-xs btn-default"><i className="glyphicon glyphicon-question-sign"></i> Help</span>
</div>
<span className="btn-group" role="group">
<button
className='btn btn-default btn-sm'
onClick={this.props.onUndo}
disabled={!this.props.undoEnabled}>
<i className='glyphicon glyphicon-share-alt icon-flipped'></i>
<span> Undo</span>
</button>
<button
className='btn btn-default btn-sm'
onClick={this.props.onRedo}
disabled={!this.props.redoEnabled}>
<i className='glyphicon glyphicon-share-alt'></i>
<span> Redo</span>
</button>
<button
id="add-plot-button"
className="btn btn-default btn-sm"
onClick={this.props.handleAddPlot}
disabled={!(this.props.cell_row > -1 && this.props.cell_col > -1)}>
<i className="glyphicon glyphicon-plus green"></i>
<span> Add Plot</span>
</button>
</span>
<span className="btn-group" role="group">
<button
id="clear-canvas-button"
className="btn btn-default btn-sm material-icons-button"
onClick={this.props.handleClearCell}
title="Clear selected plot">
<i className="material-icons" style={{color: "red"}}>clear</i>
<span> Clear Cell</span>
</button>
<button
id="open-colormap-editor-button"
className="btn btn-default btn-sm material-icons-button"
onClick={this.props.handleOpenColormapEditor}
title="Open the colormap editor">
<i className="material-icons" style={{color: "blue"}}>color_lens</i>
<span> Colormap Editor</span>
</button>
</span>
</div>
<div className="plot-inspector-container">
<table className="table table-condensed">
Expand Down Expand Up @@ -202,6 +209,7 @@ PlotInspector.propTypes = {
undoEnabled: PropTypes.bool,
redoEnabled: PropTypes.bool,
show_colormap_editor: PropTypes.bool,
startTour: PropTypes.func,
}

export default PlotInspector;
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/js/components/PlotInspector/PlotInspector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
}

.tools-header{
display: flex;
justify-content: space-between;
align-items: baseline;
margin-top: 5px;
margin-left: 7px;
p{
display: inline;
}
}

.glyphicon.green{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/components/TemplateList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var TemplateList = React.createClass({
render() {
let template = this.state.active_template ? this.props.templates[this.state.active_template] : this.props.templates.default;
return (
<div className='left-side-list scroll-area-list-parent'>
<div className='left-side-list scroll-area-list-parent template-list-container'>
<AddEditRemoveNav
editAction={this.editTemplate}
addText="Adding templates is not supported yet"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/components/VarList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var VarList = React.createClass({
},
render() {
return (
<div className='left-side-list scroll-area-list-parent'>
<div className='left-side-list scroll-area-list-parent var-list-container'>
<AddEditRemoveNav
title='Variables'
addAction={()=>this.setState({ showFile: true, showEdit: false, selectedTab: tabs.file })}
Expand Down
109 changes: 109 additions & 0 deletions frontend/src/js/constants/Constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
const ONE_VAR_PLOTS = ["boxfill", "isofill", "isoline"] // meshfill can be either 1 or 2
const TWO_VAR_PLOTS = ["vector", "3d_vector", "streamline"]

const JOYRIDE_STEPS = [
{
title: 'Welcome to vCDAT!',
text: 'The following tour will help guide you through the basic features of vCDAT. '.concat(
'Click "Next" to continue the tour.'
),
selector: '.joyride',
position: 'top',
type: 'click',
style: {
arrow: {
display: 'none'
},
skip: {
color: '#f04'
},
}
},
{
title: 'Plot Parts',
text: 'There are three parts to any given plot. Variables, a Graphics Method, and a Template.'.concat(
' Each of these can be dragged and dropped into a cell.'
),
selector: '#left-side-bar',
position: 'right',
type: 'click',
style: {
hole: {
marginTop: "-1px"
}
}
},
{
title: 'Variables',
text: 'Use the <span style="color: rgba(40, 167, 69, 0.8);">Add</span> <span style="color: rgba(217, 120, 36, 0.8);">Edit</span> and '.concat(
'<span style="color: rgba(196, 28, 31, 0.8);">Delete</span> buttons to modify what variables are loaded. ',
'In order to edit or delete a variable, ',
'click on it to <span style="color: white; background-color: #df691a;">Select</span> it first. ',
'Graphics Methods and Templates can be edited in the same manner.'
),
selector: '.var-list-container',
position: 'right',
type: 'click',
},
{
title: 'Graphics Methods',
text: 'Graphics Methods define what the plot itself should look like. '.concat(
'<span style="color: white; background-color: #df691a;">Select</span> one to edit the colormap, projection, and more.'
),
selector: '.gm-list-container',
position: 'right',
type: 'click',
},
{
title: 'Templates',
text: 'Templates define how the plot is presented. '.concat(
'They control everything about the labels and axes as well as the size and location of the plots inside a cell.'
),
selector: '.template-list-container',
position: 'right',
type: 'click',
},
{
title: 'Spreadsheet',
text: 'The spreadsheet is made up of Cells. Each cell provides areas to drop variables, '.concat(
'graphics methods and templates, as well as an area to drop these items to create a new plot within the cell. ',
'Clicking on a cell will select it.'
),
selector: '.spreadsheet-div',
position: 'top',
type: 'click',
},
{
title: 'Spreadsheet Toolbar',
text: 'The spreadsheet toolbar controls how many rows and columns of cells should be in a given sheet. It also allows for creating and switching between sheets.',
selector: '.spreadsheet-toolbar',
position: 'right',
type: 'click',
style: {
hole: {
marginTop: "-1px"
}
}
},
{
title: 'Inspecting Plots',
text: 'When a cell is selected, each plot inside the cell is listed here. '.concat(
'Use this window to inspect and change things such as the variables or templates that define the plot, ',
'as well as remove plots when there is more than one in a cell.'
),
selector: '.plot-inspector-container',
position: 'right',
type: 'click',
},
{
title: 'Tools',
text: 'The tools section contains various tools and actions that you may find useful. '.concat(
'</br><span style="color: green;">Add Plot</span> will add an additional plot to a cell. ',
'Use this as an overlay or as an in-cell side-by-side comparison.',
'</br><span style="color: red;">Clear Cell</span> will reset the cell back to the default. ',
'This can be undone if you accidentally click it with the undo button.',
'</br><span style="color: blue;">Colormap Editor</span> will open a window for creating, editing, and applying colormaps.'
),
selector: '.tools-container',
position: 'right',
type: 'click',
},
]
export { JOYRIDE_STEPS }
export { ONE_VAR_PLOTS }
export { TWO_VAR_PLOTS }
Loading

0 comments on commit 49ff1e0

Please sign in to comment.