From 6c2550e79226f04c93944c91e7c2e7447cd328c3 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 28 Aug 2018 15:32:46 -0400 Subject: [PATCH 1/3] narrowing sidebar from 120px to 100px and panel from 345px to 335px --- src/DefaultEditor.js | 4 ++-- src/styles/components/fields/_field.scss | 2 +- src/styles/variables/_layout.scss | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DefaultEditor.js b/src/DefaultEditor.js index 365bc6bcb..3f8a2c675 100644 --- a/src/DefaultEditor.js +++ b/src/DefaultEditor.js @@ -73,13 +73,13 @@ class DefaultEditor extends Component { {logo ? logo : null} - {this.hasTransforms() && } + {this.hasTransforms() && } {this.hasAxes() && } {this.hasColorbars() && } - + {this.hasSliders() && } diff --git a/src/styles/components/fields/_field.scss b/src/styles/components/fields/_field.scss index 664d38209..d4ae48a20 100644 --- a/src/styles/components/fields/_field.scss +++ b/src/styles/components/fields/_field.scss @@ -40,7 +40,7 @@ align-self: center; } &__title { - width: 30%; + width: 80px; //flex-shrink:0; padding-left: var(--spacing-half-unit); display: block; diff --git a/src/styles/variables/_layout.scss b/src/styles/variables/_layout.scss index 8d03afacf..6b979a210 100644 --- a/src/styles/variables/_layout.scss +++ b/src/styles/variables/_layout.scss @@ -1,5 +1,5 @@ /* * Layout */ -$layout-panel-width: 345px; -$layout-sidebar-width: 120px; +$layout-panel-width: 335px; +$layout-sidebar-width: 100px; From 9d816f9c623f7526d976807b55c371511ed2cd2d Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 28 Aug 2018 16:22:21 -0400 Subject: [PATCH 2/3] various width fixes --- src/components/fields/RectanglePositioner.js | 179 ++++++++++--------- src/components/widgets/SymbolSelector.js | 12 +- 2 files changed, 93 insertions(+), 98 deletions(-) diff --git a/src/components/fields/RectanglePositioner.js b/src/components/fields/RectanglePositioner.js index f092c2c63..d5d17960f 100644 --- a/src/components/fields/RectanglePositioner.js +++ b/src/components/fields/RectanglePositioner.js @@ -6,7 +6,7 @@ import ResizableRect from 'react-resizable-rotatable-draggable'; import RadioBlocks from '../widgets/RadioBlocks'; import DualNumeric from './DualNumeric'; -const maxWidth = 286; +const maxWidth = 276; const gridRes = 8; class UnconnectedRectanglePositioner extends Component { @@ -77,94 +77,97 @@ class UnconnectedRectanglePositioner extends Component { } return ( - - - this.setState({snap: snap})} - activeOption={this.state.snap} - options={[{label: _('On'), value: true}, {label: _('Off'), value: false}]} - /> - -
- {Array(gridRes * gridRes) - .fill(0) - .map((v, i) => ( -
- ))} - { - this.sendUpdate({ - fieldWidthPx, - fieldHeightPx, - width: style.width, - height: style.height, - x: style.left, - y: style.top, - }); - }} - onDrag={(deltaX, deltaY) => { - this.sendUpdate({ - fieldWidthPx, - fieldHeightPx, - width, - height, - x: left + deltaX, - y: top + deltaY, - }); +
+ + + this.setState({snap: snap})} + activeOption={this.state.snap} + options={[{label: _('On'), value: true}, {label: _('Off'), value: false}]} + /> + +
-
- {fullContainer.xaxis && fullContainer.xaxis.overlaying ? ( - '' - ) : ( - - )} - {fullContainer.yaxis && fullContainer.yaxis.overlaying ? ( - '' - ) : ( - - )} -
+ > + {Array(gridRes * gridRes) + .fill(0) + .map((v, i) => ( +
+ ))} + { + this.sendUpdate({ + fieldWidthPx, + fieldHeightPx, + width: style.width, + height: style.height, + x: style.left, + y: style.top, + }); + }} + onDrag={(deltaX, deltaY) => { + this.sendUpdate({ + fieldWidthPx, + fieldHeightPx, + width, + height, + x: left + deltaX, + y: top + deltaY, + }); + }} + /> +
+ {fullContainer.xaxis && fullContainer.xaxis.overlaying ? ( + '' + ) : ( + + )} + {fullContainer.yaxis && fullContainer.yaxis.overlaying ? ( + '' + ) : ( + + )} + +
); } } diff --git a/src/components/widgets/SymbolSelector.js b/src/components/widgets/SymbolSelector.js index 687e170bf..6cc947582 100644 --- a/src/components/widgets/SymbolSelector.js +++ b/src/components/widgets/SymbolSelector.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; -import ModalBox from '../containers/ModalBox'; import {CarretDownIcon} from 'plotly-icons'; export default class SymbolSelector extends Component { @@ -78,10 +77,7 @@ export default class SymbolSelector extends Component {
{ - this.props.onChange(value); - this.togglePanel(); - }} + onClick={() => this.props.onChange(value)} > @@ -107,11 +103,7 @@ export default class SymbolSelector extends Component {
- {isOpen ? ( - - {this.renderOptions()} - - ) : null} + {isOpen && this.renderOptions()}
); } From 2a1c2ddf0de9c8e7b49908c98788d039cc096507 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 28 Aug 2018 16:23:42 -0400 Subject: [PATCH 3/3] CSS --- src/components/fields/RectanglePositioner.js | 1 - src/styles/components/fields/_field.scss | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/fields/RectanglePositioner.js b/src/components/fields/RectanglePositioner.js index d5d17960f..c14478b34 100644 --- a/src/components/fields/RectanglePositioner.js +++ b/src/components/fields/RectanglePositioner.js @@ -92,7 +92,6 @@ class UnconnectedRectanglePositioner extends Component { style={{ width: fieldWidthPx + 1, height: fieldHeightPx + 1, - margin: '0 auto', }} > {Array(gridRes * gridRes) diff --git a/src/styles/components/fields/_field.scss b/src/styles/components/fields/_field.scss index d4ae48a20..3ca30b05b 100644 --- a/src/styles/components/fields/_field.scss +++ b/src/styles/components/fields/_field.scss @@ -89,7 +89,7 @@ border-left: 1px solid; } .rect-container { - margin: var(--spacing-eighth-unit) auto var(--spacing-quarter-unit) auto; + margin: 0 auto; position: relative; max-width: 294px; }