Skip to content
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

WIP New Feature: State recording #16

Closed
wants to merge 312 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
312 commits
Select commit Hold shift + click to select a range
603de52
debug
ricgillams May 22, 2018
4c6fa57
debug
ricgillams May 22, 2018
8fc39b3
debug
ricgillams May 22, 2018
4ad697c
debug
ricgillams May 22, 2018
e8c9c92
debug
ricgillams May 22, 2018
fa8f900
debug
ricgillams May 22, 2018
9692765
debug
ricgillams May 22, 2018
f2f115c
debug
ricgillams May 22, 2018
7b6566e
debug
ricgillams May 22, 2018
e0c9209
debug
ricgillams May 22, 2018
21f584a
debug
ricgillams May 23, 2018
d25c30b
debug
ricgillams May 23, 2018
0f4691c
debug
ricgillams May 23, 2018
746b781
debug
ricgillams May 23, 2018
d2d1713
debug
ricgillams May 23, 2018
1e6ea03
debug
ricgillams May 23, 2018
c54bc40
debug
ricgillams May 23, 2018
bdba058
debug
ricgillams May 23, 2018
02b0420
debug
ricgillams May 23, 2018
399dfd2
debug
ricgillams May 23, 2018
33f0b31
debug
ricgillams May 23, 2018
18cfdf4
debug
ricgillams May 23, 2018
7c6957b
debug
ricgillams May 23, 2018
2dd12a2
debug
ricgillams May 23, 2018
1adb1ab
debug
ricgillams May 23, 2018
a7e3542
debug
ricgillams May 23, 2018
758a6a2
debug
ricgillams May 23, 2018
17831ad
debug
ricgillams May 23, 2018
15ca4ea
debug
ricgillams May 23, 2018
2ecc9b4
debug
ricgillams May 23, 2018
43182b4
debug
ricgillams May 23, 2018
d503dcf
debug
ricgillams May 23, 2018
ff66f4e
debug
ricgillams May 23, 2018
46480f0
debug
ricgillams May 23, 2018
88d758c
debug
ricgillams May 23, 2018
828c9a7
debug
ricgillams May 23, 2018
7c9b21f
debug
ricgillams May 23, 2018
2e60c02
debug
ricgillams May 23, 2018
30a4d2f
debug
ricgillams May 23, 2018
6080f81
debug
ricgillams May 23, 2018
ec53aa7
debug
ricgillams May 23, 2018
9be7df1
debug
ricgillams May 23, 2018
6c9aa63
debug
ricgillams May 23, 2018
f194adf
debug
ricgillams May 23, 2018
072f4f3
debug
ricgillams May 23, 2018
7170d33
debug
ricgillams May 23, 2018
9b26bfe
debug
ricgillams May 23, 2018
0c1577a
debug
ricgillams May 23, 2018
16452d6
debug
ricgillams May 23, 2018
b87b5af
debug
ricgillams May 23, 2018
50c963a
debug
ricgillams May 23, 2018
26aff78
debug
ricgillams May 23, 2018
3baa13c
debug
ricgillams May 23, 2018
dd064a1
debug
ricgillams May 23, 2018
0f768b6
debug
ricgillams May 23, 2018
035f6b8
Merge branch 'master' of github.com:xchem/fragalysis-frontend
ricgillams May 23, 2018
524398b
debug
ricgillams May 23, 2018
8f2e3e1
debug
ricgillams May 24, 2018
8dc3a18
debug
ricgillams May 24, 2018
7404646
debug
ricgillams May 24, 2018
20fbcf9
debug
ricgillams May 24, 2018
b82b59f
debug
ricgillams May 24, 2018
fe6aa77
debug
ricgillams May 24, 2018
6bd99c4
debug
ricgillams May 24, 2018
0cc1570
debug
ricgillams May 24, 2018
a902a3f
debug
ricgillams May 24, 2018
be5754f
debug
ricgillams May 24, 2018
1590b8f
debug
ricgillams May 24, 2018
578608c
debug
ricgillams May 24, 2018
eeecdec
debug
ricgillams May 24, 2018
8122618
debug
ricgillams May 24, 2018
9e9ab33
debug
ricgillams May 24, 2018
1e732c4
debug
ricgillams May 24, 2018
b6c9755
debug
ricgillams May 24, 2018
dc4ce46
debug
ricgillams May 24, 2018
eafa3a0
debug
ricgillams May 24, 2018
11dc3da
debug
ricgillams May 24, 2018
5a2f7c0
debug
ricgillams May 24, 2018
0138cd8
debug
ricgillams May 24, 2018
4cd5160
debug
ricgillams May 24, 2018
18b14a3
debug
ricgillams May 24, 2018
0f8143d
debug
ricgillams May 24, 2018
edfedf9
debug
ricgillams May 24, 2018
56bc259
debug
ricgillams May 24, 2018
a22ba1b
debug
ricgillams May 24, 2018
23ec9a9
debug
ricgillams May 24, 2018
b1495d8
debug
ricgillams May 24, 2018
c012e2f
debug
ricgillams May 24, 2018
cb53b85
debug
ricgillams May 24, 2018
9d09ec2
debug
ricgillams May 24, 2018
a07f254
debug
ricgillams May 25, 2018
e97892b
debug
ricgillams May 25, 2018
a722308
debug
ricgillams May 25, 2018
0e41ab1
debug
ricgillams May 25, 2018
2908770
debug
ricgillams May 25, 2018
eb29654
debug
ricgillams May 25, 2018
0100c6f
debug
ricgillams May 25, 2018
5ff0e91
debug
ricgillams May 25, 2018
4095142
debug
ricgillams May 25, 2018
fb855f7
debug
ricgillams May 25, 2018
e867f4a
debug
ricgillams May 25, 2018
242b3a7
debug
ricgillams May 25, 2018
82d1f65
debug
ricgillams May 25, 2018
e1f93b4
debug
ricgillams May 25, 2018
4947cd2
debug
ricgillams May 29, 2018
dbe9f69
debug
ricgillams May 29, 2018
b09c6db
debug
ricgillams May 29, 2018
0854828
debug
ricgillams May 29, 2018
29907e8
debug
ricgillams May 29, 2018
a6791bb
debug
ricgillams May 29, 2018
00014f1
debug
ricgillams May 29, 2018
756199b
debug
ricgillams May 29, 2018
1bfcb12
debug
ricgillams May 29, 2018
e4d3318
debug
ricgillams May 29, 2018
c0d8c7e
debug
ricgillams May 29, 2018
6d5e9d8
debug
ricgillams May 29, 2018
9414c25
debug
ricgillams May 29, 2018
e5a87d2
debug
ricgillams May 29, 2018
31c0b6c
debug
ricgillams May 29, 2018
19e14fe
debug
ricgillams May 29, 2018
e9c5a5b
debug
ricgillams May 29, 2018
b4e62d9
debug
ricgillams May 29, 2018
4569756
debug
ricgillams May 29, 2018
08f4c45
debug
ricgillams May 29, 2018
b44a450
debug
ricgillams May 29, 2018
a94d4a0
debug
ricgillams May 29, 2018
e316cc2
debug
ricgillams May 29, 2018
e3f3f02
debug
ricgillams May 29, 2018
c029462
debug
ricgillams May 29, 2018
3b37d07
debug
ricgillams May 29, 2018
71f0aad
debug
ricgillams May 29, 2018
638d9fc
debug
ricgillams May 29, 2018
31b5902
debug
ricgillams May 29, 2018
45b7091
debug
ricgillams May 29, 2018
e8c24c4
debug
ricgillams May 29, 2018
378c149
debug
ricgillams May 29, 2018
781207f
debug
ricgillams May 29, 2018
9c82e32
debug
ricgillams May 29, 2018
7ae6655
debug
ricgillams May 29, 2018
5d19b98
debug
ricgillams May 29, 2018
9017819
debug
ricgillams May 29, 2018
4f67769
debug
ricgillams May 29, 2018
b4b5517
debug
ricgillams May 29, 2018
5d81847
debug
ricgillams May 29, 2018
53cde4e
debug
ricgillams May 30, 2018
cf9d7f2
debug
ricgillams May 30, 2018
e301bda
debug
ricgillams May 30, 2018
8d8ee93
debug
ricgillams May 30, 2018
abbc4e4
debug
ricgillams May 31, 2018
9c700b0
debug
ricgillams May 31, 2018
9e49b2a
debug
ricgillams May 31, 2018
2dd6e4d
debug
ricgillams May 31, 2018
e12a840
debug
ricgillams May 31, 2018
33b7ea8
debug
ricgillams May 31, 2018
32c0508
debug
ricgillams May 31, 2018
529551e
debug
ricgillams May 31, 2018
68190ef
debug
ricgillams May 31, 2018
a60f326
debug
ricgillams May 31, 2018
f79b2f4
debug
ricgillams May 31, 2018
b8a3dd8
debug
ricgillams May 31, 2018
fc90267
debug
ricgillams May 31, 2018
60084e7
debug
ricgillams May 31, 2018
9e2f9f2
debug
ricgillams May 31, 2018
7064da0
debug
ricgillams May 31, 2018
aaa2934
debug
ricgillams May 31, 2018
82ec5d1
debug
ricgillams May 31, 2018
8bd6ee5
debug
ricgillams May 31, 2018
8874ec0
debug
ricgillams May 31, 2018
e91108d
debug
ricgillams May 31, 2018
8521cc1
debug
ricgillams May 31, 2018
8f44fb7
debug
ricgillams May 31, 2018
acc6196
debug
ricgillams May 31, 2018
2a1b8c5
debug
ricgillams May 31, 2018
7597e3e
debug
ricgillams May 31, 2018
0aa6f9a
debug
ricgillams May 31, 2018
20d9e84
debug
ricgillams May 31, 2018
8fdaaeb
debug
ricgillams May 31, 2018
532056b
debug
ricgillams May 31, 2018
02a39c3
debug
ricgillams May 31, 2018
9c532a4
debug
ricgillams Jun 1, 2018
b3ce67c
debug
ricgillams Jun 1, 2018
7b8a129
debug
ricgillams Jun 1, 2018
6bf0f52
debug
ricgillams Jun 1, 2018
3b9ad49
debug
ricgillams Jun 1, 2018
3ab75c0
debug
ricgillams Jun 1, 2018
25fd366
debug
ricgillams Jun 4, 2018
e222288
debug
ricgillams Jun 4, 2018
ab3067f
debug
ricgillams Jun 4, 2018
afba84c
debug
ricgillams Jun 4, 2018
96cda6b
debug
ricgillams Jun 4, 2018
826eb78
debug
ricgillams Jun 4, 2018
c905902
debug
ricgillams Jun 4, 2018
fa3b882
debug
ricgillams Jun 4, 2018
aee83ca
debug
ricgillams Jun 4, 2018
33304ef
debug
ricgillams Jun 4, 2018
1db51d2
debug
ricgillams Jun 4, 2018
073c009
debug
ricgillams Jun 4, 2018
38afec6
debug
ricgillams Jun 4, 2018
d7ecb64
debug
ricgillams Jun 4, 2018
9e08b71
debug
ricgillams Jun 4, 2018
c3a918f
debug
ricgillams Jun 5, 2018
e4f0909
debug
ricgillams Jun 5, 2018
c36bdd6
debug
ricgillams Jun 5, 2018
d44c0f7
debug
ricgillams Jun 5, 2018
b76fff3
debug
ricgillams Jun 5, 2018
2d8395d
debug
ricgillams Jun 5, 2018
770ca7c
debug
ricgillams Jun 5, 2018
04e7c03
debug
ricgillams Jun 5, 2018
6650d4f
debug
ricgillams Jun 5, 2018
0c7e63c
debug
ricgillams Jun 5, 2018
b66a136
debug
ricgillams Jun 5, 2018
9d16245
debug
ricgillams Jun 5, 2018
66a4cc4
debug
ricgillams Jun 5, 2018
0e2fd86
debug
ricgillams Jun 5, 2018
a6e42d2
debug
ricgillams Jun 5, 2018
89c33ab
debug
ricgillams Jun 5, 2018
dc47cdf
debug
ricgillams Jun 5, 2018
f30396b
debug
ricgillams Jun 5, 2018
fc4f835
debug
ricgillams Jun 5, 2018
44b4fae
debug
ricgillams Jun 5, 2018
b142c0e
debug
ricgillams Jun 5, 2018
0401c3e
debug
ricgillams Jun 5, 2018
cd6a7a6
debug
ricgillams Jun 5, 2018
b4c54b8
debug
ricgillams Jun 5, 2018
0283ef0
debug
ricgillams Jun 5, 2018
4cea1ea
debug
ricgillams Jun 5, 2018
27ff9a2
debug
ricgillams Jun 5, 2018
8937700
debug
ricgillams Jun 5, 2018
06e8cb8
debug
ricgillams Jun 5, 2018
ec9f442
debug
ricgillams Jun 5, 2018
30bbded
debug
ricgillams Jun 5, 2018
9a78510
debug
ricgillams Jun 5, 2018
deafbcc
debug
ricgillams Jun 5, 2018
3431407
debug
ricgillams Jun 5, 2018
f0034f7
debug
ricgillams Jun 5, 2018
8dae31b
debug
ricgillams Jun 5, 2018
5752abc
debug
ricgillams Jun 5, 2018
84ed132
debug
ricgillams Jun 5, 2018
b873e4f
debug
ricgillams Jun 5, 2018
ae9b510
debug
ricgillams Jun 5, 2018
1d70610
debug
ricgillams Jun 5, 2018
3fb7319
debug
ricgillams Jun 5, 2018
d70d7fa
debug
ricgillams Jun 5, 2018
c5d9139
debug
ricgillams Jun 5, 2018
707a81a
debug
ricgillams Jun 5, 2018
2f6b8c5
debug
ricgillams Jun 5, 2018
fb0e4d8
debug
ricgillams Jun 5, 2018
f2aa1aa
debug
ricgillams Jun 5, 2018
ceb4b8d
debug
ricgillams Jun 5, 2018
e38e59c
debug
ricgillams Jun 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion js/actions/actonTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ export const GOT_FULL_GRAPH = 'GOT_FULL_GRAPH';
export const SELECT_VECTOR = 'SELECT_VECTOR';
export const SET_MOL = 'SET_MOL';
export const SET_VECTOR_LIST = 'SET_VECTOR_LIST';
export const SET_ORIENTATION = 'SET_ORIENTATION'
export const SET_ORIENTATION = 'SET_ORIENTATION';
// State broadcast
export const NGL_ORIENTATION = 'NGL_ORIENTATION';
13 changes: 2 additions & 11 deletions js/actions/nglLoadActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Created by abradley on 03/03/2018.
*/
import {LOAD_OBJECT, LOAD_OBJECT_SUCCESS, LOAD_OBJECT_FAILURE, OBJECT_LOADING,
DELETE_OBJECT, DELETE_OBJECT_FAILURE, DELETE_OBJECT_SUCCESS,DELETE_OBJECT_TYPE,
SET_ORIENTATION} from './actonTypes'
DELETE_OBJECT, DELETE_OBJECT_FAILURE, DELETE_OBJECT_SUCCESS,
DELETE_OBJECT_TYPE} from './actonTypes'


export const loadObject = function (group) {
Expand All @@ -20,15 +20,6 @@ export const objectLoading = function (group){
type: OBJECT_LOADING,
group: group
};

}

export const setOrientation = function (orientation){
console.log("ACTIONS: " + orientation);
return {
type: SET_ORIENTATION,
orientation: orientation
};
}

export const loadObjectSuccess = function (group) {
Expand Down
27 changes: 25 additions & 2 deletions js/actions/nglRenderActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* Created by abradley on 03/03/2018.
*/

import {SET_COLOR, SET_STYLE, SET_SPIN, SET_WATER, SET_HYDROGEN } from './actonTypes'
import {SET_COLOR, SET_STYLE, SET_SPIN, SET_WATER, SET_HYDROGEN, REQUEST_ORIENTATION, RECEIVE_ORIENTATION,
SET_ORIENTATION} from './actonTypes'

export const setColor = function (color) {
console.log("ACTIONS: " + color);
Expand Down Expand Up @@ -91,4 +92,26 @@ export const setAssemblyOptions = function (structure) {
type: SET_ASSEMBLY_OPTIONS,
assemblyOptions: options
};
}
}

export const requestOrientation = function (){
console.log("ACTIONS: orientation requested");
return {
type: REQUEST_ORIENTATION
};
}

export const receiveOrientation = function (){
console.log("ACTIONS: orientation received");
return {
type: RECEIVE_ORIENTATION
};
}

export const setOrientation = function (orientation){
console.log("ACTIONS: " + orientation);
return {
type: SET_ORIENTATION,
orientation: orientation
};
}
1 change: 0 additions & 1 deletion js/actions/selectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const getFullGraph = function (item) {
}



export const gotFullGraph = function (result){
console.log("ACTIONS: "+ result)
return {
Expand Down
2 changes: 2 additions & 0 deletions js/components/compoundView.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class CompoundView extends GenericView {
this.loadFromServer(this.props.width,this.props.height);
this.checkInList();
}


render() {
const svg_image = <SVGInline svg={this.state.img_data}/>;
this.current_style = this.state.isToggleOn ? this.selected_style : this.not_selected_style;
Expand Down
10 changes: 7 additions & 3 deletions js/components/nglComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ export class NGLView extends React.Component {
}
}



generateSphere(data,selected=false,listType=listTypes.MOLGROUPS,view="summary_view"){
var sele = ""
var color = [0,0,1]
Expand Down Expand Up @@ -291,6 +289,12 @@ export class NGLView extends React.Component {
}
}


// setOrientation(){
// var orientation = this.stage.viewerControls.getOrientation();
// this.props.
// }

/**
* Function to deal with the logic of showing molecules
*/
Expand Down Expand Up @@ -343,7 +347,7 @@ function mapStateToProps(state) {
objectsToDelete: state.nglReducers.objectsToDelete,
objectsLoading: state.nglReducers.objectsLoading,
objectsInView: state.nglReducers.objectsInView,
orientation: state.nglReducers.orientation,
nglOrientation: state.nglReducers.nglOrientation,
objectsPicked: state.nglReducers.objectsPicked
}
}
Expand Down
156 changes: 156 additions & 0 deletions js/components/stateView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/**
* Created by rgillams on 22/05/2018.
*/
import React from 'react';
import { connect } from 'react-redux'
import { Button, Well, Col, Row } from 'react-bootstrap'
import fetch from 'cross-fetch'
import * as nglactions from '../actions/nglLoadActions'
import { Stage, Shape, concatStructures, Selection } from 'ngl';

class StateView extends React.Component{
constructor(props) {
super(props);
this.handleStateState = this.handleStateState.bind(this);
this.handleStateLoading = this.handleStateLoading.bind(this);
this.handlePostState = this.handlePostState.bind(this);
this.handleRenderState = this.handleRenderState.bind(this);
this.handleJson = this.handleJson.bind(this);
// this.handleStateOrientation = this.handleStateOrientation.bind(this);
this.handleGetOrientation = this.handleGetOrientation.bind(this);
}

handleGetOrientation() {
var orientation_requested = this.props.orientation_requested;
this.setState(prevState => ({orientation_requested: !prevState.orientation_requested}))
var orientation_acquired = JSON.stringify(this.props.orientation_acquired);
var orientationStates = {
requestOrientation: orientation_requested,
receiveOrientation: orientation_acquired
};
return alert(JSON.stringify(orientationStates))
}

handleStateState(){
var stateState = JSON.stringify(this.props.objects_in_view);
const uuidv4 = require('uuid/v4');
var TITLE = 'need to define title';
var formattedState = {
uuid: uuidv4(),
title: TITLE,
scene: stateState
};
return alert(JSON.stringify(formattedState))
}

/* handleStateOrientation(){
var curr_orient = this.props.set_orientation();
for (i = 0; i < curr_orient["elements"].length; i++) {
curr_orient["elements"][i] = ori["elements"][i];
}
this.stage.viewerControls.orient(curr_orient);
this.stage.setFocus(focus_var);
var stateOrientation = JSON.stringify(this.props.ngl_orientation);
var formattedOrientation = {
orientation: stateOrientation
};
return alert(JSON.stringify(curr_orient))
}
*/
handleStateLoading(){
var stateLoading = JSON.stringify(this.props.objects_to_load);
var TITLE = 'To Load';
var formattedState = {
title: TITLE,
scene: stateLoading
};
return alert(JSON.stringify(formattedState))
}

handlePostState(){
var stateState = JSON.stringify(this.props.objects_in_view);
const uuidv4 = require('uuid/v4');
var TITLE = 'need to define title';
var formattedState = {
uuid: uuidv4(),
title: TITLE,
scene: stateState
};
fetch("/api/viewscene/", {
method: "post",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(formattedState)
}).then(function(response) {
return response.json();
}).then(function(myJson) {
// window.location.protocol + window.location.hostname + "/api/viewscene/" + myJson.id.toString()
alert(myJson.id.toString())
});
}

handleJson(myJson){
var myDict = JSON.parse(myJson.scene)
for(var key in myDict){
this.props.load_object(myDict[key]);
}
};

handleRenderState(){
var pk = document.getElementById("state_selector").value;
fetch("/api/viewscene/"+pk)
.then(function(response) {
return response.json();
}).then(json => this.handleJson(json))
}
render(){
return <div>
<Well>
<Row>
<Col xs={6} md={6}>
<Button bsSize="large" bsStyle="success" onClick={this.handlePostState}>Save State</Button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<h2><b>Type state P-Key here:</b></h2>
<input id="state_selector" type="text" name="name" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<Button bsSize="large" bsStyle="success" onClick={this.handleRenderState}>Reload State</Button>
<Button bsSize="large" bsStyle="success" onClick={this.handleGetOrientation}>Orientation</Button>
<h3><b>Current State:</b></h3>
<h3>Last saved pk:</h3>
<h3>Target on? <b>{this.props.target_on}</b></h3>
<h3>Number of objects? <b>{Object.keys(this.props.objects_in_view).length}</b></h3>
<h3>Orientation? <b>{JSON.stringify(this.props.ngl_orientation)}</b></h3>
<h3>Stringified state: <b>{JSON.stringify(this.props.objects_in_view)}</b></h3>
</Col>
</Row>
</Well>
</div>
}
}
function mapStateToProps(state) {
return {
to_buy_list: state.selectionReducers.to_buy_list,
to_select: state.selectionReducers.to_select,
this_vector_list: state.selectionReducers.this_vector_list,
vector_list: state.selectionReducers.vector_list,
querying: state.selectionReducers.querying,
to_query: state.selectionReducers.to_query,
target_on: state.apiReducers.target_on,
orientation: state.nglReducers.spin,
color: state.nglReducers.color,
objects_in_view: state.nglReducers.objectsInView,
objects_to_load: state.nglReducers.objectsToLoad,
orientation_requested: state.nglReducers.orientationRequested,
orientation_acquired: state.nglReducers.orientationAcquired,
ngl_orientation: state.nglReducers.nglOrientation
}
}

const mapDispatchToProps = {
load_object: nglactions.loadObject,
set_orientation: nglactions.setOrientation
}

export default connect(mapStateToProps, mapDispatchToProps)(StateView);
2 changes: 0 additions & 2 deletions js/components/summaryView.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ function mapStateToProps(state) {
}
}



const mapDispatchToProps = {
appendToBuyList: selectionActions.appendToBuyList,
selectVector: selectionActions.selectVector,
Expand Down
2 changes: 1 addition & 1 deletion js/containers/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class App extends Component {
render() {
return (
<div id="outer-container">
<MyMenu right pageWrapId={ "page-wrap" } outerContainerId={ "outer-container" } /> START HERE
<MyMenu right pageWrapId={ "page-wrap" } outerContainerId={ "outer-container" } /> BEGIN HERE
<LoadingBar />
<Grid fluid id="page-wrap">
<Header/>
Expand Down
2 changes: 2 additions & 0 deletions js/containers/previewHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import MolGroupList from '../components/molGroupList';
import MoleculeList from '../components/moleculeList';
import MolGroupSlider from '../components/molGroupSlider'
import SummaryView from '../components/summaryView';
import StateView from '../components/stateView';


class Preview extends Component {
Expand All @@ -30,6 +31,7 @@ class Preview extends Component {
</Col>
<Col xs={5} md={5} >
<NGLView div_id="major_view" height="600px"/>
<StateView />
</Col>
<Col xs={4} md={4}>
<SummaryView />
Expand Down
18 changes: 15 additions & 3 deletions js/reducers/nglReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ const INITIALSTATE = {
spin: false,
water: true,
hydrogen: true,
orientationRequested: false,
orientationAcquired: false,
nglOrientation: {}
}


export default function nglReducers(state = INITIALSTATE, action) {
console.log('REDUCERS FIRED OFF. OLD STATE');
console.log(state);
Expand Down Expand Up @@ -130,9 +132,19 @@ export default function nglReducers(state = INITIALSTATE, action) {
hydrogen: action.hydrogen
});

case actions.SET_ORIENTATION:
case actions.REQUEST_ORIENTATION:
return Object.assign({}, state, {
orientationRequested : action.orientationRequested
});

case actions.RECEIVE_ORIENTATION:
return Object.assign({}, state, {
orientationAcquired : action.orientationAcquired
});

case actions.SET_NGL_ORIENTATION:
return Object.assign({}, state, {
orientation: action.orientation
nglOrientation: action.nglOrientation
});
// Cases like: @@redux/INIT
default:
Expand Down
7 changes: 2 additions & 5 deletions js/reducers/reducers.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/**
* Created by abradley on 07/03/2018.
*/
import { combineReducers } from 'redux'
import { combineReducers } from 'redux';
import apiReducers from './apiReducers';
import nglReducers from './nglReducers';
import selectionReducers from './selectionReducers';
import renderReducers from './renderReducers';
import { loadingBarReducer } from 'react-redux-loading-bar'
import { loadingBarReducer } from 'react-redux-loading-bar';
import {reducer as burgerMenu} from 'redux-burger-menu';




const rootReducer = combineReducers({
renderReducers,
apiReducers,
Expand Down
2 changes: 0 additions & 2 deletions js/reducers/selectionReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,3 @@ export default function selectionReducers(state = INITIALSTATE, action) {
return state;
}
}


3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"redux-burger-menu": "^0.2.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"style-loader": "^0.20.2"
"style-loader": "^0.20.2",
"uuid": "^3.2.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
Expand Down