Loading js-apps/meep-frontend/src/js/containers/cfg/cfg-network-element-container.js +7 −7 Original line number Diff line number Diff line Loading @@ -924,7 +924,8 @@ const getParentTypes = type => { }; const buttonStyles = { marginRight: 5 marginRight: 5, width: 100 }; const ElementCfgButtons = ({ Loading Loading @@ -973,7 +974,6 @@ const ElementCfgButtons = ({ > CLONE </Button> </> ); }; Loading Loading @@ -1105,13 +1105,13 @@ export class CfgNetworkElementContainer extends Component { return ( <div className="cfg-network-element-div" style={styles.outer}> <Grid> <GridCell span={7}> <GridCell span={12}> <div style={styles.block}> <Typography use="headline6">Element Configuration</Typography> </div> </GridCell> <GridCell span={5}> <GridInner align={'right'}> <GridCell span={12}> <GridInner align={'left'}> <GridCell span={12}> <ElementCfgButtons configuredElement={element} Loading js-apps/meep-frontend/src/js/containers/idc-vis.js +33 −1 Original line number Diff line number Diff line Loading @@ -162,6 +162,10 @@ class IDCVis extends Component { var groups = vis.options.groups; //vis.network.on("configChange", function() { // console.log(network.getOptionsFromConfigurator()); //}); // Scenario createBoxGroup(groups, 'scenario', '#ffffff'); groups.scenario.borderWidth = 4; Loading Loading @@ -349,6 +353,34 @@ class IDCVis extends Component { vis.showConfig = !vis.showConfig; } vis.options.configure.enabled = vis.showConfig; var subOptions; switch(vis.options.configure.filter) { case 'physics': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.physics = subOptions.physics; break; case 'manipulation': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.manipulation = subOptions.manipulation; break; case 'interaction': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.interaction = subOptions.interaction; break; case 'nodes': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.nodes = subOptions.nodes; break; case 'edges': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.edges = subOptions.edges; break; case 'layout': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.layout = subOptions.layout; break; default: } vis.options.configure.filter = filterStr; vis.network.setOptions(vis.options); } Loading @@ -362,7 +394,7 @@ class IDCVis extends Component { } render() { this.updateConfigVisibility(); //this.updateConfigVisibility(); return ( <> <div Loading js-apps/meep-frontend/src/js/containers/meep-container.js +22 −5 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ import { connect } from 'react-redux'; import React, { Component } from 'react'; import axios from 'axios'; import moment from 'moment'; import { updateObject } from '../util/object-util'; import { updateObject, deepCopy } from '../util/object-util'; // Import JS dependencies import * as meepCtrlRestApiClient from '../../../../../js-packages/meep-ctrl-engine-client/src/index.js'; Loading Loading @@ -323,8 +323,12 @@ class MeepContainer extends Component { }, 2000); } // Change & process scenario changeScenario(pageType, scenario) { changeScenario(pageType, scenario, false); } // Change & process scenario changeScenario(pageType, scenario, reInitVisView) { // Change scenario state if (pageType === TYPE_CFG) { this.props.cfgChangeScenario(scenario); Loading @@ -345,7 +349,16 @@ class MeepContainer extends Component { const vis = this.props.cfgVis; if (vis && vis.network && vis.network.setData) { //save the canvas position and scale level in vis var view; if (!reInitVisView) { view = deepCopy(vis.network.canvas.body.view); } vis.network.setData(updatedVisData); if (view) { //restore the canvas position and scale in vis vis.network.canvas.body.view = view; } } } else { this.props.execChangeVisData(updatedVisData); Loading @@ -354,7 +367,11 @@ class MeepContainer extends Component { const vis = this.props.execVis; if (vis && vis.network && vis.network.setData) { _.defer(() => { //save the canvas position and scale level in vis const view = deepCopy(vis.network.canvas.body.view); vis.network.setData(this.props.execVisData); //restore the canvas position and scale in vis vis.network.canvas.body.view = view; }); } } Loading @@ -363,18 +380,18 @@ class MeepContainer extends Component { // Create, store & process new scenario createScenario(pageType, name) { var scenario = createNewScenario(name); this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Set & process scenario setScenario(pageType, scenario) { this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Delete & process scenario deleteScenario(pageType) { var scenario = createNewScenario(NO_SCENARIO_NAME); this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Refresh Active scenario Loading Loading
js-apps/meep-frontend/src/js/containers/cfg/cfg-network-element-container.js +7 −7 Original line number Diff line number Diff line Loading @@ -924,7 +924,8 @@ const getParentTypes = type => { }; const buttonStyles = { marginRight: 5 marginRight: 5, width: 100 }; const ElementCfgButtons = ({ Loading Loading @@ -973,7 +974,6 @@ const ElementCfgButtons = ({ > CLONE </Button> </> ); }; Loading Loading @@ -1105,13 +1105,13 @@ export class CfgNetworkElementContainer extends Component { return ( <div className="cfg-network-element-div" style={styles.outer}> <Grid> <GridCell span={7}> <GridCell span={12}> <div style={styles.block}> <Typography use="headline6">Element Configuration</Typography> </div> </GridCell> <GridCell span={5}> <GridInner align={'right'}> <GridCell span={12}> <GridInner align={'left'}> <GridCell span={12}> <ElementCfgButtons configuredElement={element} Loading
js-apps/meep-frontend/src/js/containers/idc-vis.js +33 −1 Original line number Diff line number Diff line Loading @@ -162,6 +162,10 @@ class IDCVis extends Component { var groups = vis.options.groups; //vis.network.on("configChange", function() { // console.log(network.getOptionsFromConfigurator()); //}); // Scenario createBoxGroup(groups, 'scenario', '#ffffff'); groups.scenario.borderWidth = 4; Loading Loading @@ -349,6 +353,34 @@ class IDCVis extends Component { vis.showConfig = !vis.showConfig; } vis.options.configure.enabled = vis.showConfig; var subOptions; switch(vis.options.configure.filter) { case 'physics': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.physics = subOptions.physics; break; case 'manipulation': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.manipulation = subOptions.manipulation; break; case 'interaction': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.interaction = subOptions.interaction; break; case 'nodes': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.nodes = subOptions.nodes; break; case 'edges': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.edges = subOptions.edges; break; case 'layout': subOptions = vis.network.getOptionsFromConfigurator(); vis.options.layout = subOptions.layout; break; default: } vis.options.configure.filter = filterStr; vis.network.setOptions(vis.options); } Loading @@ -362,7 +394,7 @@ class IDCVis extends Component { } render() { this.updateConfigVisibility(); //this.updateConfigVisibility(); return ( <> <div Loading
js-apps/meep-frontend/src/js/containers/meep-container.js +22 −5 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ import { connect } from 'react-redux'; import React, { Component } from 'react'; import axios from 'axios'; import moment from 'moment'; import { updateObject } from '../util/object-util'; import { updateObject, deepCopy } from '../util/object-util'; // Import JS dependencies import * as meepCtrlRestApiClient from '../../../../../js-packages/meep-ctrl-engine-client/src/index.js'; Loading Loading @@ -323,8 +323,12 @@ class MeepContainer extends Component { }, 2000); } // Change & process scenario changeScenario(pageType, scenario) { changeScenario(pageType, scenario, false); } // Change & process scenario changeScenario(pageType, scenario, reInitVisView) { // Change scenario state if (pageType === TYPE_CFG) { this.props.cfgChangeScenario(scenario); Loading @@ -345,7 +349,16 @@ class MeepContainer extends Component { const vis = this.props.cfgVis; if (vis && vis.network && vis.network.setData) { //save the canvas position and scale level in vis var view; if (!reInitVisView) { view = deepCopy(vis.network.canvas.body.view); } vis.network.setData(updatedVisData); if (view) { //restore the canvas position and scale in vis vis.network.canvas.body.view = view; } } } else { this.props.execChangeVisData(updatedVisData); Loading @@ -354,7 +367,11 @@ class MeepContainer extends Component { const vis = this.props.execVis; if (vis && vis.network && vis.network.setData) { _.defer(() => { //save the canvas position and scale level in vis const view = deepCopy(vis.network.canvas.body.view); vis.network.setData(this.props.execVisData); //restore the canvas position and scale in vis vis.network.canvas.body.view = view; }); } } Loading @@ -363,18 +380,18 @@ class MeepContainer extends Component { // Create, store & process new scenario createScenario(pageType, name) { var scenario = createNewScenario(name); this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Set & process scenario setScenario(pageType, scenario) { this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Delete & process scenario deleteScenario(pageType) { var scenario = createNewScenario(NO_SCENARIO_NAME); this.changeScenario(pageType, scenario); this.changeScenario(pageType, scenario, true); } // Refresh Active scenario Loading