diff --git a/src/MemoryRanked/MemoryRanked.js b/src/MemoryRanked/MemoryRanked.js index 94e80de5acc299117cfca859cac182bbfb3dee29..f724953589796f4b1f01b5f15430a29658704d0c 100644 --- a/src/MemoryRanked/MemoryRanked.js +++ b/src/MemoryRanked/MemoryRanked.js @@ -150,16 +150,16 @@ class MemoryRanked extends Component { const config = this.props.node.getConfig() if (config && 'displayMode' in config) { - if (config.displayMode === "readme") { - return <div className="about"> - <h1>Display the sequences of the interactions learnt by the agent</h1> - <p>Each time the agent performs a <b>sequence of interactions</b> in the environment, it records the corresponding <b>valence</b> and stores it in the memory. Each record is called an <b>occurence</b> of the sequence.</p> - </div>; - } else if (config.displayMode === "settings") { - return <div> - <p>config panel</p> - </div>; - } + if (config.displayMode === "readme") { + return <div className="about"> + <h1>Display the sequences of the interactions learnt by the agent</h1> + <p>Each time the agent performs a <b>sequence of interactions</b> in the environment, it records the corresponding <b>valence</b> and stores it in the memory. Each record is called an <b>occurence</b> of the sequence.</p> + </div>; + } else if (config.displayMode === "settings") { + return <div> + <p>config panel</p> + </div>; + } } const viewbox = "0 0 " + (width + this.margin.left + this.margin.right) @@ -191,40 +191,40 @@ class MemoryRanked extends Component { x2={this.xLayout.upper(2)} y2={yValue}/> })} </svg>); - } + } - /** - * Create the react Components declared in declaration and place them at the required x and y coordinates. - * - * *Note*: it passes an additional `width` attribute on to the elements so that they know how much horizontal - * space is available for them. - * @param {Object} declaration object defining what elements will be appended to the SVG. - * Expected attributes: - * - component: React component (function or class) to be added - * - x: index of the element, on the horizontal axis - * - all additional attributes are passed to the React Component - * @param {Number} i unique value used by React to track the Components it generates - */ - makeSVGComponent(declaration, i) { - // Coordinates used for hte translation - const x = this.xLayout.lower(declaration.x); - const y = this.margin.top + this.yOffset; + /** + * Create the react Components declared in declaration and place them at the required x and y coordinates. + * + * *Note*: it passes an additional `width` attribute on to the elements so that they know how much horizontal + * space is available for them. + * @param {Object} declaration object defining what elements will be appended to the SVG. + * Expected attributes: + * - component: React component (function or class) to be added + * - x: index of the element, on the horizontal axis + * - all additional attributes are passed to the React Component + * @param {Number} i unique value used by React to track the Components it generates + */ + makeSVGComponent(declaration, i) { + // Coordinates used for hte translation + const x = this.xLayout.lower(declaration.x); + const y = this.margin.top + this.yOffset; - // Take the extra properties and pass them to the Component - let props = Object.assign({}, declaration); - delete props.x; delete props.y; delete props.component; - props.width = this.xLayout.width(declaration.x); - - // Instanciate the component - const component = React.createElement(declaration.component, props); - - return ( - <g key={"SVG"+i} transform={"translate(" + x + "," + y + ")"}> - {/* <rect x="0" y="0" width={valenceLocation.width} height={valenceLocation.height} fill="none" stroke="steelblue"/> */} - {component} - </g> - ); - } - } + // Take the extra properties and pass them to the Component + let props = Object.assign({}, declaration); + delete props.x; delete props.y; delete props.component; + props.width = this.xLayout.width(declaration.x); + + // Instanciate the component + const component = React.createElement(declaration.component, props); + + return ( + <g key={"SVG"+i} transform={"translate(" + x + "," + y + ")"}> + {/* <rect x="0" y="0" width={valenceLocation.width} height={valenceLocation.height} fill="none" stroke="steelblue"/> */} + {component} + </g> + ); + } +} - export default sizeMe({monitorHeight: true})(MemoryRanked); \ No newline at end of file +export default sizeMe({monitorHeight: true})(MemoryRanked); \ No newline at end of file