import {action, observable, computed, makeObservable} from 'mobx'; export class storeShapeSettings { constructor() { makeObservable(this, { fillColor: observable, borderColorView: observable, setFillColor: action, getFillColor: action, setBorderColor: action, initBorderColorView: action }); } getStyleGroups () { const styles = [ { title: 'Text', thumb: 'shape-01.svg', type: 'textRect' }, { title: 'Line', thumb: 'shape-02.svg', type: 'line' }, { title: 'Line with arrow', thumb: 'shape-03.svg', type: 'lineWithArrow' }, { title: 'Line with two arrows', thumb: 'shape-04.svg', type: 'lineWithTwoArrows' }, { title: 'Rect', thumb: 'shape-05.svg', type: 'rect' }, { title: 'Hexagon', thumb: 'shape-06.svg', type: 'hexagon' }, { title: 'Round rect', thumb: 'shape-07.svg', type: 'roundRect' }, { title: 'Ellipse', thumb: 'shape-08.svg', type: 'ellipse' }, { title: 'Triangle', thumb: 'shape-09.svg', type: 'triangle' }, { title: 'Triangle', thumb: 'shape-10.svg', type: 'rtTriangle' }, { title: 'Trapezoid', thumb: 'shape-11.svg', type: 'trapezoid' }, { title: 'Diamond', thumb: 'shape-12.svg', type: 'diamond' }, { title: 'Right arrow', thumb: 'shape-13.svg', type: 'rightArrow' }, { title: 'Left-right arrow', thumb: 'shape-14.svg', type: 'leftRightArrow' }, { title: 'Left arrow callout', thumb: 'shape-15.svg', type: 'leftArrow' }, { title: 'Right arrow callout', thumb: 'shape-16.svg', type: 'bentUpArrow' }, { title: 'Flow chart off page connector', thumb: 'shape-17.svg', type: 'flowChartOffpageConnector' }, { title: 'Heart', thumb: 'shape-18.svg', type: 'heart' }, { title: 'Math minus', thumb: 'shape-19.svg', type: 'mathMinus' }, { title: 'Math plus', thumb: 'shape-20.svg', type: 'mathPlus' }, { title: 'Parallelogram', thumb: 'shape-21.svg', type: 'parallelogram' }, { title: 'Wedge rect callout', thumb: 'shape-22.svg', type: 'wedgeRectCallout' }, { title: 'Wedge ellipse callout', thumb: 'shape-23.svg', type: 'wedgeEllipseCallout' }, { title: 'Cloud callout', thumb: 'shape-24.svg', type: 'cloudCallout' } ]; const groups = []; let i = 0; for (let row=0; row _sizes.length - 1) return _sizes[_sizes.length - 1]; return _sizes[index]; }, indexSizeByValue: function (value) { let index = 0; _sizes.forEach((size, idx) => { if (Math.abs(size - value) < 0.25) { index = idx; } }); return index; }, sizeByValue: function (value) { return _sizes[this.indexSizeByValue(value)]; } } } }