js2flowchart
Version:
> Why? While I've been working on [Under-the-hood-ReactJS](https://github.com/Bogdan-Lyashenko/Under-the-hood-ReactJS) I spent enormous amount of time on creating schemes. Each change in code or flowchart affects all entire scheme instantly, forcing you t
29 lines • 1.02 kB
JavaScript
import { calculateWidth as calculateWidthBaseShape, calculateHeight as calculateHeightBaseHeight } from './BaseShape';
export var calculateDimensions = function calculateDimensions(state) {
return {
w: calculateWidth(state),
h: calculateHeight(state)
};
};
export var calculateWidth = function calculateWidth(state) {
return calculateHeight(state) + calculateWidthBaseShape(state);
};
export var calculateHeight = function calculateHeight(state) {
return 2 * state.theme.thinPartOffset + calculateHeightBaseHeight(state);
};
export var calculateFromPoint = function calculateFromPoint(_ref) {
var position = _ref.position,
dimensions = _ref.dimensions;
return {
x: position.x + dimensions.h / 2,
y: position.y + dimensions.h
};
};
export var calculateChildOffsetPoint = function calculateChildOffsetPoint(_ref2) {
var dimensions = _ref2.dimensions,
theme = _ref2.theme;
return {
x: dimensions.h / 2 + theme.childOffset,
y: dimensions.h + theme.childOffset / 2
};
};