@hatiolab/things-scene 9.0.0-beta.35 → 9.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +4 -3
- package/db.sqlite +0 -0
- package/dist/animation/animate.js +63 -0
- package/dist/animation/animate.js.map +1 -0
- package/dist/animation/animations/animation.js +122 -0
- package/dist/animation/animations/animation.js.map +1 -0
- package/dist/animation/animations/fade.js +28 -0
- package/dist/animation/animations/fade.js.map +1 -0
- package/dist/animation/animations/heartbeat.js +28 -0
- package/dist/animation/animations/heartbeat.js.map +1 -0
- package/dist/animation/animations/moving.js +24 -0
- package/dist/animation/animations/moving.js.map +1 -0
- package/dist/animation/animations/outline.js +47 -0
- package/dist/animation/animations/outline.js.map +1 -0
- package/dist/animation/animations/rotation.js +22 -0
- package/dist/animation/animations/rotation.js.map +1 -0
- package/dist/animation/animations/vibration.js +31 -0
- package/dist/animation/animations/vibration.js.map +1 -0
- package/dist/animation/compile.js +31 -0
- package/dist/animation/compile.js.map +1 -0
- package/dist/animation/delta.js +51 -0
- package/dist/animation/delta.js.map +1 -0
- package/dist/animation/index.js +14 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/command/command-change.js +33 -0
- package/dist/command/command-change.js.map +1 -0
- package/dist/command/command-migrate.js +103 -0
- package/dist/command/command-migrate.js.map +1 -0
- package/dist/command/command.js +18 -0
- package/dist/command/command.js.map +1 -0
- package/dist/command/snapshot-commander.js +84 -0
- package/dist/command/snapshot-commander.js.map +1 -0
- package/dist/components/anchor/anchor.js +105 -0
- package/dist/components/anchor/anchor.js.map +1 -0
- package/dist/components/anchor/ellipse-anchors.js +53 -0
- package/dist/components/anchor/ellipse-anchors.js.map +1 -0
- package/dist/components/anchor/rect-anchors.js +53 -0
- package/dist/components/anchor/rect-anchors.js.map +1 -0
- package/dist/components/audio.js +154 -0
- package/dist/components/audio.js.map +1 -0
- package/dist/components/cloud.js +44 -0
- package/dist/components/cloud.js.map +1 -0
- package/dist/components/component.js +1086 -0
- package/dist/components/component.js.map +1 -0
- package/dist/components/container-abstract.js +387 -0
- package/dist/components/container-abstract.js.map +1 -0
- package/dist/components/container.js +331 -0
- package/dist/components/container.js.map +1 -0
- package/dist/components/data/data-mapping.js +82 -0
- package/dist/components/data/data-mapping.js.map +1 -0
- package/dist/components/data/data.js +166 -0
- package/dist/components/data/data.js.map +1 -0
- package/dist/components/data/evaluator.js +103 -0
- package/dist/components/data/evaluator.js.map +1 -0
- package/dist/components/donut.js +104 -0
- package/dist/components/donut.js.map +1 -0
- package/dist/components/drawer/draw-image-pendable.js +20 -0
- package/dist/components/drawer/draw-image-pendable.js.map +1 -0
- package/dist/components/drawer/effect.js +19 -0
- package/dist/components/drawer/effect.js.map +1 -0
- package/dist/components/drawer/fill.js +228 -0
- package/dist/components/drawer/fill.js.map +1 -0
- package/dist/components/drawer/format.js +115 -0
- package/dist/components/drawer/format.js.map +1 -0
- package/dist/components/drawer/line.js +191 -0
- package/dist/components/drawer/line.js.map +1 -0
- package/dist/components/drawer/stroke.js +62 -0
- package/dist/components/drawer/stroke.js.map +1 -0
- package/dist/components/drawer/text-wrapper.js +51 -0
- package/dist/components/drawer/text-wrapper.js.map +1 -0
- package/dist/components/drawer/text.js +269 -0
- package/dist/components/drawer/text.js.map +1 -0
- package/dist/components/ellipse.js +110 -0
- package/dist/components/ellipse.js.map +1 -0
- package/dist/components/file/ondropfile.js +19 -0
- package/dist/components/file/ondropfile.js.map +1 -0
- package/dist/components/fit/fit.js +137 -0
- package/dist/components/fit/fit.js.map +1 -0
- package/dist/components/geometry/transcoord.js +339 -0
- package/dist/components/geometry/transcoord.js.map +1 -0
- package/dist/components/geometry/union.js +35 -0
- package/dist/components/geometry/union.js.map +1 -0
- package/dist/components/gif-view.js +128 -0
- package/dist/components/gif-view.js.map +1 -0
- package/dist/components/global-ref.js +154 -0
- package/dist/components/global-ref.js.map +1 -0
- package/dist/components/group.js +171 -0
- package/dist/components/group.js.map +1 -0
- package/dist/components/html/elements.js +24 -0
- package/dist/components/html/elements.js.map +1 -0
- package/dist/components/html/fill.js +126 -0
- package/dist/components/html/fill.js.map +1 -0
- package/dist/components/html/reposition.js +119 -0
- package/dist/components/html/reposition.js.map +1 -0
- package/dist/components/html/shadow.js +24 -0
- package/dist/components/html/shadow.js.map +1 -0
- package/dist/components/html-overlay-container.js +27 -0
- package/dist/components/html-overlay-container.js.map +1 -0
- package/dist/components/html-overlay-element.js +22 -0
- package/dist/components/html-overlay-element.js.map +1 -0
- package/dist/components/image-view.js +193 -0
- package/dist/components/image-view.js.map +1 -0
- package/dist/components/index.js +231 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/info-window.js +416 -0
- package/dist/components/info-window.js.map +1 -0
- package/dist/components/line.js +374 -0
- package/dist/components/line.js.map +1 -0
- package/dist/components/local-ref.js +114 -0
- package/dist/components/local-ref.js.map +1 -0
- package/dist/components/mixins/connectable.js +128 -0
- package/dist/components/mixins/connectable.js.map +1 -0
- package/dist/components/mixins/data-source.js +34 -0
- package/dist/components/mixins/data-source.js.map +1 -0
- package/dist/components/mixins/html-element.js +107 -0
- package/dist/components/mixins/html-element.js.map +1 -0
- package/dist/components/mixins/move-handle.js +73 -0
- package/dist/components/mixins/move-handle.js.map +1 -0
- package/dist/components/mixins/rect-path.js +113 -0
- package/dist/components/mixins/rect-path.js.map +1 -0
- package/dist/components/mixins/value-holder.js +81 -0
- package/dist/components/mixins/value-holder.js.map +1 -0
- package/dist/components/mutater/bounds.js +68 -0
- package/dist/components/mutater/bounds.js.map +1 -0
- package/dist/components/mutater/path.js +73 -0
- package/dist/components/mutater/path.js.map +1 -0
- package/dist/components/ortholine.js +763 -0
- package/dist/components/ortholine.js.map +1 -0
- package/dist/components/outline/ellipse-outline.js +23 -0
- package/dist/components/outline/ellipse-outline.js.map +1 -0
- package/dist/components/outline/path-outline.js +48 -0
- package/dist/components/outline/path-outline.js.map +1 -0
- package/dist/components/path.js +49 -0
- package/dist/components/path.js.map +1 -0
- package/dist/components/polygon.js +91 -0
- package/dist/components/polygon.js.map +1 -0
- package/dist/components/polyline.js +114 -0
- package/dist/components/polyline.js.map +1 -0
- package/dist/components/popup.js +160 -0
- package/dist/components/popup.js.map +1 -0
- package/dist/components/rect.js +72 -0
- package/dist/components/rect.js.map +1 -0
- package/dist/components/retention/retention-manager.js +81 -0
- package/dist/components/retention/retention-manager.js.map +1 -0
- package/dist/components/root-container.js +519 -0
- package/dist/components/root-container.js.map +1 -0
- package/dist/components/ruler.js +103 -0
- package/dist/components/ruler.js.map +1 -0
- package/dist/components/shape.js +97 -0
- package/dist/components/shape.js.map +1 -0
- package/dist/components/star.js +103 -0
- package/dist/components/star.js.map +1 -0
- package/dist/components/text/substitutor.js +92 -0
- package/dist/components/text/substitutor.js.map +1 -0
- package/dist/components/text.js +21 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/triangle.js +92 -0
- package/dist/components/triangle.js.map +1 -0
- package/dist/const.js +71 -0
- package/dist/const.js.map +1 -0
- package/dist/core/collection.js +28 -0
- package/dist/core/collection.js.map +1 -0
- package/dist/core/debug.js +12 -0
- package/dist/core/debug.js.map +1 -0
- package/dist/core/deep-equals.js +112 -0
- package/dist/core/deep-equals.js.map +1 -0
- package/dist/core/dom-to-image.js +617 -0
- package/dist/core/dom-to-image.js.map +1 -0
- package/dist/core/event.js +205 -0
- package/dist/core/event.js.map +1 -0
- package/dist/core/index.js +21 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/list.js +87 -0
- package/dist/core/list.js.map +1 -0
- package/dist/core/logger.js +29 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/memoize.js +40 -0
- package/dist/core/memoize.js.map +1 -0
- package/dist/core/mixin.js +26 -0
- package/dist/core/mixin.js.map +1 -0
- package/dist/core/obj-accessor.js +26 -0
- package/dist/core/obj-accessor.js.map +1 -0
- package/dist/core/reference-map.js +147 -0
- package/dist/core/reference-map.js.map +1 -0
- package/dist/core/round-rect.js +62 -0
- package/dist/core/round-rect.js.map +1 -0
- package/dist/core/safe-round.js +10 -0
- package/dist/core/safe-round.js.map +1 -0
- package/dist/core/script-loader.js +148 -0
- package/dist/core/script-loader.js.map +1 -0
- package/dist/core/snapshot-taker.js +59 -0
- package/dist/core/snapshot-taker.js.map +1 -0
- package/dist/core/stack.js +18 -0
- package/dist/core/stack.js.map +1 -0
- package/dist/core/timecapsule.js +88 -0
- package/dist/core/timecapsule.js.map +1 -0
- package/dist/core/utils.js +309 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/decorator/anchors-decorator.js +53 -0
- package/dist/decorator/anchors-decorator.js.map +1 -0
- package/dist/decorator/bouncing-arrow-decorator.js +52 -0
- package/dist/decorator/bouncing-arrow-decorator.js.map +1 -0
- package/dist/decorator/data-spread-decorator.js +69 -0
- package/dist/decorator/data-spread-decorator.js.map +1 -0
- package/dist/decorator/decotag-decorator.js +33 -0
- package/dist/decorator/decotag-decorator.js.map +1 -0
- package/dist/decorator/index.js +31 -0
- package/dist/decorator/index.js.map +1 -0
- package/dist/decorator/link-decorator.js +66 -0
- package/dist/decorator/link-decorator.js.map +1 -0
- package/dist/effect/gradation.js +37 -0
- package/dist/effect/gradation.js.map +1 -0
- package/dist/effect/index.js +23 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/effect/shadow.js +33 -0
- package/dist/effect/shadow.js.map +1 -0
- package/dist/effect/turn.js +25 -0
- package/dist/effect/turn.js.map +1 -0
- package/dist/event/event-engine.js +76 -0
- package/dist/event/event-engine.js.map +1 -0
- package/dist/event/event-pump.js +92 -0
- package/dist/event/event-pump.js.map +1 -0
- package/dist/event/event-tracker.js +97 -0
- package/dist/event/event-tracker.js.map +1 -0
- package/dist/event/index.js +21 -0
- package/dist/event/index.js.map +1 -0
- package/dist/event/ua-event-handler.js +453 -0
- package/dist/event/ua-event-handler.js.map +1 -0
- package/dist/event-map/animator-handler.js +225 -0
- package/dist/event-map/animator-handler.js.map +1 -0
- package/dist/event-map/animators/animated-icon.js +265 -0
- package/dist/event-map/animators/animated-icon.js.map +1 -0
- package/dist/event-map/animators/border-highlighting.js +476 -0
- package/dist/event-map/animators/border-highlighting.js.map +1 -0
- package/dist/event-map/animators/bouncing-arrow.js +226 -0
- package/dist/event-map/animators/bouncing-arrow.js.map +1 -0
- package/dist/event-map/event-map.js +36 -0
- package/dist/event-map/event-map.js.map +1 -0
- package/dist/event-map/index.js +20 -0
- package/dist/event-map/index.js.map +1 -0
- package/dist/event-map/move-handler.js +233 -0
- package/dist/event-map/move-handler.js.map +1 -0
- package/dist/event-map/paste-handler.js +176 -0
- package/dist/event-map/paste-handler.js.map +1 -0
- package/dist/event-map/shift-handler.js +55 -0
- package/dist/event-map/shift-handler.js.map +1 -0
- package/dist/event-map/text-editor-lite.js +276 -0
- package/dist/event-map/text-editor-lite.js.map +1 -0
- package/dist/event-map/zoom-handler.js +49 -0
- package/dist/event-map/zoom-handler.js.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/layer/action/emphasize.js +42 -0
- package/dist/layer/action/emphasize.js.map +1 -0
- package/dist/layer/action/popup.js +461 -0
- package/dist/layer/action/popup.js.map +1 -0
- package/dist/layer/action/pressed.js +31 -0
- package/dist/layer/action/pressed.js.map +1 -0
- package/dist/layer/add-layer.js +180 -0
- package/dist/layer/add-layer.js.map +1 -0
- package/dist/layer/decotag-layer.js +121 -0
- package/dist/layer/decotag-layer.js.map +1 -0
- package/dist/layer/guide-layer.js +292 -0
- package/dist/layer/guide-layer.js.map +1 -0
- package/dist/layer/index.js +70 -0
- package/dist/layer/index.js.map +1 -0
- package/dist/layer/layer.js +230 -0
- package/dist/layer/layer.js.map +1 -0
- package/dist/layer/minimap-layer.js +84 -0
- package/dist/layer/minimap-layer.js.map +1 -0
- package/dist/layer/model-layer.js +465 -0
- package/dist/layer/model-layer.js.map +1 -0
- package/dist/layer/modeler/anchor-handler.js +193 -0
- package/dist/layer/modeler/anchor-handler.js.map +1 -0
- package/dist/layer/modeler/control-handler.js +95 -0
- package/dist/layer/modeler/control-handler.js.map +1 -0
- package/dist/layer/modeler/focus-outline.js +41 -0
- package/dist/layer/modeler/focus-outline.js.map +1 -0
- package/dist/layer/modeler/group-outline.js +30 -0
- package/dist/layer/modeler/group-outline.js.map +1 -0
- package/dist/layer/modeler/index.js +56 -0
- package/dist/layer/modeler/index.js.map +1 -0
- package/dist/layer/modeler/path-handler.js +300 -0
- package/dist/layer/modeler/path-handler.js.map +1 -0
- package/dist/layer/modeler/resizer.js +333 -0
- package/dist/layer/modeler/resizer.js.map +1 -0
- package/dist/layer/modeler/rotator.js +134 -0
- package/dist/layer/modeler/rotator.js.map +1 -0
- package/dist/layer/modeling-layer.js +491 -0
- package/dist/layer/modeling-layer.js.map +1 -0
- package/dist/layer/reaction-layer.js +111 -0
- package/dist/layer/reaction-layer.js.map +1 -0
- package/dist/layer/scroll-layer.js +191 -0
- package/dist/layer/scroll-layer.js.map +1 -0
- package/dist/layer/selection/selected-finder.js +96 -0
- package/dist/layer/selection/selected-finder.js.map +1 -0
- package/dist/layer/selection-layer.js +373 -0
- package/dist/layer/selection-layer.js.map +1 -0
- package/dist/layer/shift-layer.js +83 -0
- package/dist/layer/shift-layer.js.map +1 -0
- package/dist/layout/absolute.js +30 -0
- package/dist/layout/absolute.js.map +1 -0
- package/dist/layout/card.js +52 -0
- package/dist/layout/card.js.map +1 -0
- package/dist/layout/html-absolute.js +32 -0
- package/dist/layout/html-absolute.js.map +1 -0
- package/dist/layout/index.js +56 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/layout.js +36 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/layout/linear-horizontal.js +56 -0
- package/dist/layout/linear-horizontal.js.map +1 -0
- package/dist/layout/linear-vertical.js +56 -0
- package/dist/layout/linear-vertical.js.map +1 -0
- package/dist/layout/table.js +106 -0
- package/dist/layout/table.js.map +1 -0
- package/dist/license/license.js +170 -0
- package/dist/license/license.js.map +1 -0
- package/dist/model/compile.js +40 -0
- package/dist/model/compile.js.map +1 -0
- package/dist/model/duplicate.js +19 -0
- package/dist/model/duplicate.js.map +1 -0
- package/dist/model/index.js +34 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/selector.js +104 -0
- package/dist/model/selector.js.map +1 -0
- package/dist/style/compile.js +14 -0
- package/dist/style/compile.js.map +1 -0
- package/dist/style/index.js +14 -0
- package/dist/style/index.js.map +1 -0
- package/dist/things-scene/api/add-start.js +18 -0
- package/dist/things-scene/api/add-start.js.map +1 -0
- package/dist/things-scene/api/add.js +71 -0
- package/dist/things-scene/api/add.js.map +1 -0
- package/dist/things-scene/api/align.js +116 -0
- package/dist/things-scene/api/align.js.map +1 -0
- package/dist/things-scene/api/center-to.js +50 -0
- package/dist/things-scene/api/center-to.js.map +1 -0
- package/dist/things-scene/api/change.js +27 -0
- package/dist/things-scene/api/change.js.map +1 -0
- package/dist/things-scene/api/clipboard.js +45 -0
- package/dist/things-scene/api/clipboard.js.map +1 -0
- package/dist/things-scene/api/distribute.js +57 -0
- package/dist/things-scene/api/distribute.js.map +1 -0
- package/dist/things-scene/api/duplicate.js +47 -0
- package/dist/things-scene/api/duplicate.js.map +1 -0
- package/dist/things-scene/api/fullscreen.js +26 -0
- package/dist/things-scene/api/fullscreen.js.map +1 -0
- package/dist/things-scene/api/group.js +91 -0
- package/dist/things-scene/api/group.js.map +1 -0
- package/dist/things-scene/api/ids.js +28 -0
- package/dist/things-scene/api/ids.js.map +1 -0
- package/dist/things-scene/api/index.js +192 -0
- package/dist/things-scene/api/index.js.map +1 -0
- package/dist/things-scene/api/listener.js +69 -0
- package/dist/things-scene/api/listener.js.map +1 -0
- package/dist/things-scene/api/paste-start.js +27 -0
- package/dist/things-scene/api/paste-start.js.map +1 -0
- package/dist/things-scene/api/place.js +98 -0
- package/dist/things-scene/api/place.js.map +1 -0
- package/dist/things-scene/api/remove.js +57 -0
- package/dist/things-scene/api/remove.js.map +1 -0
- package/dist/things-scene/api/symmetry.js +47 -0
- package/dist/things-scene/api/symmetry.js.map +1 -0
- package/dist/things-scene/api/to-data-url.js +76 -0
- package/dist/things-scene/api/to-data-url.js.map +1 -0
- package/dist/things-scene/api/zorder.js +68 -0
- package/dist/things-scene/api/zorder.js.map +1 -0
- package/dist/things-scene/application-context.js +168 -0
- package/dist/things-scene/application-context.js.map +1 -0
- package/dist/things-scene/config.js +18 -0
- package/dist/things-scene/config.js.map +1 -0
- package/dist/things-scene/create.js +67 -0
- package/dist/things-scene/create.js.map +1 -0
- package/dist/things-scene/fps.js +26 -0
- package/dist/things-scene/fps.js.map +1 -0
- package/dist/things-scene/index.js +152 -0
- package/dist/things-scene/index.js.map +1 -0
- package/dist/things-scene/polyfill.js +111 -0
- package/dist/things-scene/polyfill.js.map +1 -0
- package/dist/things-scene/scene.js +442 -0
- package/dist/things-scene/scene.js.map +1 -0
- package/dist/things-scene/version.js +12 -0
- package/dist/things-scene/version.js.map +1 -0
- package/package.json +8 -6
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _component = _interopRequireDefault(require("./component.js"));
|
|
8
|
+
var _line = _interopRequireWildcard(require("./line.js"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/*
|
|
13
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const FROM = 0;
|
|
17
|
+
const TO = 1;
|
|
18
|
+
const NATURE = {
|
|
19
|
+
mutable: false,
|
|
20
|
+
resizable: false,
|
|
21
|
+
rotatable: false,
|
|
22
|
+
properties: [{
|
|
23
|
+
type: 'number',
|
|
24
|
+
label: 'round',
|
|
25
|
+
name: 'round',
|
|
26
|
+
property: {
|
|
27
|
+
min: 0,
|
|
28
|
+
max: 100,
|
|
29
|
+
step: 1
|
|
30
|
+
}
|
|
31
|
+
}],
|
|
32
|
+
help: 'scene/component/ortholine'
|
|
33
|
+
};
|
|
34
|
+
class OrthoLine extends _line.default {
|
|
35
|
+
get pathExtendable() {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
get drawPath() {
|
|
39
|
+
const fromPosition = this.path[0];
|
|
40
|
+
const toPosition = this.path[1];
|
|
41
|
+
const {
|
|
42
|
+
component: fromComponent,
|
|
43
|
+
direction: fromDirection,
|
|
44
|
+
boundaryPosition: fromBoundaryPosition = fromPosition
|
|
45
|
+
} = this.fromEnd || {};
|
|
46
|
+
const {
|
|
47
|
+
component: toComponent,
|
|
48
|
+
direction: toDirection,
|
|
49
|
+
boundaryPosition: toBoundaryPosition = toPosition
|
|
50
|
+
} = this.toEnd || {};
|
|
51
|
+
var boundaryPositions = [fromBoundaryPosition, toBoundaryPosition];
|
|
52
|
+
var path = [];
|
|
53
|
+
if (fromBoundaryPosition) {
|
|
54
|
+
path.push(fromBoundaryPosition);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* 두 컴포넌트의 확장된 바운드를 구한다. */
|
|
58
|
+
var fromOriginBounds = fromComponent?.bounds;
|
|
59
|
+
if (fromOriginBounds) {
|
|
60
|
+
var transcoorded = fromComponent.transcoordS2T(fromOriginBounds.left, fromOriginBounds.top);
|
|
61
|
+
transcoorded = this.transcoordT2P(transcoorded.x, transcoorded.y);
|
|
62
|
+
fromOriginBounds = {
|
|
63
|
+
...fromOriginBounds,
|
|
64
|
+
left: transcoorded.x,
|
|
65
|
+
top: transcoorded.y
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
var fromBounds = fromOriginBounds ? {
|
|
69
|
+
left: fromOriginBounds.left - 20,
|
|
70
|
+
top: fromOriginBounds.top - 20,
|
|
71
|
+
width: fromOriginBounds.width + 40,
|
|
72
|
+
height: fromOriginBounds.height + 40
|
|
73
|
+
} : {
|
|
74
|
+
left: fromBoundaryPosition.x,
|
|
75
|
+
top: fromBoundaryPosition.y,
|
|
76
|
+
width: 0,
|
|
77
|
+
height: 0
|
|
78
|
+
};
|
|
79
|
+
fromOriginBounds = fromOriginBounds || fromBounds;
|
|
80
|
+
var toOriginBounds = toComponent?.bounds;
|
|
81
|
+
if (toOriginBounds) {
|
|
82
|
+
var transcoorded = toComponent.transcoordS2T(toOriginBounds.left, toOriginBounds.top);
|
|
83
|
+
transcoorded = this.transcoordT2P(transcoorded.x, transcoorded.y);
|
|
84
|
+
toOriginBounds = {
|
|
85
|
+
...toOriginBounds,
|
|
86
|
+
left: transcoorded.x,
|
|
87
|
+
top: transcoorded.y
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
var toBounds = toOriginBounds ? {
|
|
91
|
+
left: toOriginBounds.left - 20,
|
|
92
|
+
top: toOriginBounds.top - 20,
|
|
93
|
+
width: toOriginBounds.width + 40,
|
|
94
|
+
height: toOriginBounds.height + 40
|
|
95
|
+
} : {
|
|
96
|
+
left: toBoundaryPosition.x,
|
|
97
|
+
top: toBoundaryPosition.y,
|
|
98
|
+
width: 0,
|
|
99
|
+
height: 0
|
|
100
|
+
};
|
|
101
|
+
toOriginBounds = toOriginBounds || toBounds;
|
|
102
|
+
var fromToBounds = [fromBounds, toBounds];
|
|
103
|
+
const leftMost = fromBounds.left > toBounds.left ? toBounds.left : fromBounds.left;
|
|
104
|
+
const topMost = fromBounds.top > toBounds.top ? toBounds.top : fromBounds.top;
|
|
105
|
+
var unionBounds = {
|
|
106
|
+
left: leftMost,
|
|
107
|
+
top: topMost,
|
|
108
|
+
width: fromBounds.left + fromBounds.width > toBounds.left + toBounds.width ? fromBounds.left + fromBounds.width - leftMost : toBounds.left + toBounds.width - leftMost,
|
|
109
|
+
height: fromBounds.top + fromBounds.height > toBounds.top + toBounds.height ? fromBounds.top + fromBounds.height - topMost : toBounds.top + toBounds.height - topMost
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/* 두 컴포넌트 바운드의 센터를 찾는다. */
|
|
113
|
+
var centerX,
|
|
114
|
+
centerY,
|
|
115
|
+
centerWidth = 0,
|
|
116
|
+
centerHeight = 0;
|
|
117
|
+
var upperComponent, leftComponent, rightComponent, lowerComponent;
|
|
118
|
+
var upperComponentDirection, lowerComponentDirection;
|
|
119
|
+
var leftComponentDirection, rightComponentDirection;
|
|
120
|
+
if (fromOriginBounds.left + fromOriginBounds.width < toOriginBounds.left) {
|
|
121
|
+
leftComponent = FROM;
|
|
122
|
+
rightComponent = TO;
|
|
123
|
+
leftComponentDirection = fromDirection;
|
|
124
|
+
rightComponentDirection = toDirection;
|
|
125
|
+
centerX = (fromOriginBounds.left + fromOriginBounds.width + toOriginBounds.left) / 2;
|
|
126
|
+
centerWidth = toOriginBounds.left - centerX;
|
|
127
|
+
} else if (toOriginBounds.left + toOriginBounds.width < fromOriginBounds.left) {
|
|
128
|
+
leftComponent = TO;
|
|
129
|
+
rightComponent = FROM;
|
|
130
|
+
leftComponentDirection = toDirection;
|
|
131
|
+
rightComponentDirection = fromDirection;
|
|
132
|
+
centerX = (fromOriginBounds.left + toOriginBounds.width + toOriginBounds.left) / 2;
|
|
133
|
+
centerWidth = fromOriginBounds.left - centerX;
|
|
134
|
+
}
|
|
135
|
+
if (fromOriginBounds.top + fromOriginBounds.height < toOriginBounds.top) {
|
|
136
|
+
upperComponent = FROM;
|
|
137
|
+
lowerComponent = TO;
|
|
138
|
+
upperComponentDirection = fromDirection;
|
|
139
|
+
lowerComponentDirection = toDirection;
|
|
140
|
+
centerY = (fromOriginBounds.top + fromOriginBounds.height + toOriginBounds.top) / 2;
|
|
141
|
+
centerHeight = toOriginBounds.top - centerY;
|
|
142
|
+
} else if (toOriginBounds.top + toOriginBounds.height < fromOriginBounds.top) {
|
|
143
|
+
upperComponent = TO;
|
|
144
|
+
lowerComponent = FROM;
|
|
145
|
+
upperComponentDirection = toDirection;
|
|
146
|
+
lowerComponentDirection = fromDirection;
|
|
147
|
+
centerY = (fromOriginBounds.top + toOriginBounds.height + toOriginBounds.top) / 2;
|
|
148
|
+
centerHeight = fromOriginBounds.top - centerY;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* 각 LinkEnd의 방향별 패스 구하기 */
|
|
152
|
+
var lpath = [];
|
|
153
|
+
if (centerX && centerWidth > centerHeight) {
|
|
154
|
+
switch (rightComponentDirection) {
|
|
155
|
+
case _line.WEST:
|
|
156
|
+
switch (leftComponentDirection) {
|
|
157
|
+
case _line.EAST:
|
|
158
|
+
lpath.push({
|
|
159
|
+
x: centerX,
|
|
160
|
+
y: boundaryPositions[leftComponent].y
|
|
161
|
+
});
|
|
162
|
+
lpath.push({
|
|
163
|
+
x: centerX,
|
|
164
|
+
y: boundaryPositions[rightComponent].y
|
|
165
|
+
});
|
|
166
|
+
break;
|
|
167
|
+
case _line.WEST:
|
|
168
|
+
var leftComponentCenterY = fromToBounds[leftComponent].top + fromToBounds[leftComponent].height / 2;
|
|
169
|
+
var leftY = leftComponentCenterY > boundaryPositions[rightComponent].y ? Math.min(fromToBounds[leftComponent].top, boundaryPositions[rightComponent].y) : Math.max(fromToBounds[leftComponent].top + fromToBounds[leftComponent].height, boundaryPositions[rightComponent].y);
|
|
170
|
+
lpath.push({
|
|
171
|
+
x: boundaryPositions[leftComponent].x,
|
|
172
|
+
y: leftY
|
|
173
|
+
});
|
|
174
|
+
lpath.push({
|
|
175
|
+
x: centerX,
|
|
176
|
+
y: leftY
|
|
177
|
+
});
|
|
178
|
+
lpath.push({
|
|
179
|
+
x: centerX,
|
|
180
|
+
y: boundaryPositions[rightComponent].y
|
|
181
|
+
});
|
|
182
|
+
break;
|
|
183
|
+
case _line.NORTH:
|
|
184
|
+
case _line.SOUTH:
|
|
185
|
+
var leftY = leftComponentDirection === _line.SOUTH ? Math.max(boundaryPositions[leftComponent].y, boundaryPositions[rightComponent].y) : Math.min(boundaryPositions[leftComponent].y, boundaryPositions[rightComponent].y);
|
|
186
|
+
lpath.push({
|
|
187
|
+
x: boundaryPositions[leftComponent].x,
|
|
188
|
+
y: leftY
|
|
189
|
+
});
|
|
190
|
+
lpath.push({
|
|
191
|
+
x: centerX,
|
|
192
|
+
y: leftY
|
|
193
|
+
});
|
|
194
|
+
lpath.push({
|
|
195
|
+
x: centerX,
|
|
196
|
+
y: boundaryPositions[rightComponent].y
|
|
197
|
+
});
|
|
198
|
+
break;
|
|
199
|
+
default:
|
|
200
|
+
return this.path;
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
case _line.EAST:
|
|
204
|
+
switch (leftComponentDirection) {
|
|
205
|
+
case _line.EAST:
|
|
206
|
+
var leftY = boundaryPositions[leftComponent].y < boundaryPositions[rightComponent].y ? Math.min(fromToBounds[rightComponent].top, boundaryPositions[leftComponent].y) : Math.max(fromToBounds[rightComponent].top + fromToBounds[rightComponent].height, boundaryPositions[leftComponent].y);
|
|
207
|
+
var rightY = leftY;
|
|
208
|
+
break;
|
|
209
|
+
case _line.WEST:
|
|
210
|
+
var leftY = centerY !== undefined ? centerY : boundaryPositions[leftComponent].y < boundaryPositions[rightComponent].y ? unionBounds.top - centerWidth * 0.5 : unionBounds.top + unionBounds.height + centerWidth * 0.5;
|
|
211
|
+
var rightY = leftY;
|
|
212
|
+
break;
|
|
213
|
+
case _line.SOUTH:
|
|
214
|
+
var leftY = centerY !== undefined ? Math.max(centerY, boundaryPositions[leftComponent].y) : unionBounds.top + unionBounds.height;
|
|
215
|
+
var rightY = leftY;
|
|
216
|
+
break;
|
|
217
|
+
case _line.NORTH:
|
|
218
|
+
var leftY = centerY ? Math.min(centerY, fromToBounds[leftComponent].top) : unionBounds.top;
|
|
219
|
+
var rightY = leftY;
|
|
220
|
+
break;
|
|
221
|
+
default:
|
|
222
|
+
return this.path;
|
|
223
|
+
}
|
|
224
|
+
lpath.push({
|
|
225
|
+
x: boundaryPositions[leftComponent].x,
|
|
226
|
+
y: leftY
|
|
227
|
+
});
|
|
228
|
+
lpath.push({
|
|
229
|
+
x: centerX,
|
|
230
|
+
y: leftY
|
|
231
|
+
});
|
|
232
|
+
lpath.push({
|
|
233
|
+
x: centerX,
|
|
234
|
+
y: rightY
|
|
235
|
+
});
|
|
236
|
+
lpath.push({
|
|
237
|
+
x: boundaryPositions[rightComponent].x,
|
|
238
|
+
y: rightY
|
|
239
|
+
});
|
|
240
|
+
break;
|
|
241
|
+
case _line.SOUTH:
|
|
242
|
+
switch (leftComponentDirection) {
|
|
243
|
+
case _line.EAST:
|
|
244
|
+
var leftY = boundaryPositions[leftComponent].y;
|
|
245
|
+
var rightY = boundaryPositions[leftComponent].y > boundaryPositions[rightComponent].y ? boundaryPositions[leftComponent].y : fromToBounds[rightComponent].top + fromToBounds[rightComponent].height;
|
|
246
|
+
break;
|
|
247
|
+
case _line.WEST:
|
|
248
|
+
var leftY = centerY ? Math.max(centerY, fromToBounds[rightComponent].top + fromToBounds[rightComponent].height) : unionBounds.top + unionBounds.height;
|
|
249
|
+
var rightY = leftY;
|
|
250
|
+
break;
|
|
251
|
+
case _line.SOUTH:
|
|
252
|
+
var leftY = unionBounds.top + unionBounds.height;
|
|
253
|
+
var rightY = leftY;
|
|
254
|
+
break;
|
|
255
|
+
case _line.NORTH:
|
|
256
|
+
var leftY = centerY ? Math.min(centerY, fromToBounds[leftComponent].top) : fromToBounds[leftComponent].top;
|
|
257
|
+
var rightY = centerY ? Math.max(centerY, fromToBounds[rightComponent].top + fromToBounds[rightComponent].height) : fromToBounds[rightComponent].top + fromToBounds[rightComponent].height;
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
return this.path;
|
|
261
|
+
}
|
|
262
|
+
lpath.push({
|
|
263
|
+
x: boundaryPositions[leftComponent].x,
|
|
264
|
+
y: leftY
|
|
265
|
+
});
|
|
266
|
+
lpath.push({
|
|
267
|
+
x: centerX,
|
|
268
|
+
y: leftY
|
|
269
|
+
});
|
|
270
|
+
lpath.push({
|
|
271
|
+
x: centerX,
|
|
272
|
+
y: rightY
|
|
273
|
+
});
|
|
274
|
+
lpath.push({
|
|
275
|
+
x: boundaryPositions[rightComponent].x,
|
|
276
|
+
y: rightY
|
|
277
|
+
});
|
|
278
|
+
break;
|
|
279
|
+
case _line.NORTH:
|
|
280
|
+
switch (leftComponentDirection) {
|
|
281
|
+
case _line.EAST:
|
|
282
|
+
var leftY = boundaryPositions[leftComponent].y;
|
|
283
|
+
var rightY = boundaryPositions[leftComponent].y < boundaryPositions[rightComponent].y ? boundaryPositions[leftComponent].y : fromToBounds[rightComponent].top;
|
|
284
|
+
break;
|
|
285
|
+
case _line.WEST:
|
|
286
|
+
var leftY = centerY ? Math.min(centerY, fromToBounds[rightComponent].top) : unionBounds.top;
|
|
287
|
+
var rightY = leftY;
|
|
288
|
+
break;
|
|
289
|
+
case _line.SOUTH:
|
|
290
|
+
var leftY = centerY !== undefined ? Math.max(centerY, boundaryPositions[leftComponent].y) : boundaryPositions[leftComponent].y;
|
|
291
|
+
var rightY = centerY !== undefined ? Math.min(centerY, boundaryPositions[rightComponent].y) : boundaryPositions[rightComponent].y;
|
|
292
|
+
break;
|
|
293
|
+
case _line.NORTH:
|
|
294
|
+
var leftY = unionBounds.top;
|
|
295
|
+
var rightY = leftY;
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
return this.path;
|
|
299
|
+
}
|
|
300
|
+
lpath.push({
|
|
301
|
+
x: boundaryPositions[leftComponent].x,
|
|
302
|
+
y: leftY
|
|
303
|
+
});
|
|
304
|
+
lpath.push({
|
|
305
|
+
x: centerX,
|
|
306
|
+
y: leftY
|
|
307
|
+
});
|
|
308
|
+
lpath.push({
|
|
309
|
+
x: centerX,
|
|
310
|
+
y: rightY
|
|
311
|
+
});
|
|
312
|
+
lpath.push({
|
|
313
|
+
x: boundaryPositions[rightComponent].x,
|
|
314
|
+
y: rightY
|
|
315
|
+
});
|
|
316
|
+
break;
|
|
317
|
+
default:
|
|
318
|
+
return this.path;
|
|
319
|
+
}
|
|
320
|
+
path.push(...(leftComponent === FROM ? lpath : lpath.reverse()));
|
|
321
|
+
} else if (centerY) {
|
|
322
|
+
switch (lowerComponentDirection) {
|
|
323
|
+
case _line.NORTH:
|
|
324
|
+
switch (upperComponentDirection) {
|
|
325
|
+
case _line.SOUTH:
|
|
326
|
+
lpath.push({
|
|
327
|
+
x: boundaryPositions[upperComponent].x,
|
|
328
|
+
y: centerY
|
|
329
|
+
});
|
|
330
|
+
lpath.push({
|
|
331
|
+
x: boundaryPositions[lowerComponent].x,
|
|
332
|
+
y: centerY
|
|
333
|
+
});
|
|
334
|
+
break;
|
|
335
|
+
case _line.NORTH:
|
|
336
|
+
var upperComponentCenterX = fromToBounds[upperComponent].left + fromToBounds[upperComponent].width / 2;
|
|
337
|
+
var upperX = upperComponentCenterX > boundaryPositions[lowerComponent].x ? Math.min(fromToBounds[upperComponent].left, boundaryPositions[lowerComponent].x) : Math.max(fromToBounds[upperComponent].left + fromToBounds[upperComponent].width, boundaryPositions[lowerComponent].x);
|
|
338
|
+
lpath.push({
|
|
339
|
+
x: upperX,
|
|
340
|
+
y: boundaryPositions[upperComponent].y
|
|
341
|
+
});
|
|
342
|
+
lpath.push({
|
|
343
|
+
x: upperX,
|
|
344
|
+
y: centerY
|
|
345
|
+
});
|
|
346
|
+
lpath.push({
|
|
347
|
+
x: boundaryPositions[lowerComponent].x,
|
|
348
|
+
y: centerY
|
|
349
|
+
});
|
|
350
|
+
break;
|
|
351
|
+
case _line.WEST:
|
|
352
|
+
var upperX = Math.min(boundaryPositions[upperComponent].x, boundaryPositions[lowerComponent].x);
|
|
353
|
+
lpath.push({
|
|
354
|
+
x: upperX,
|
|
355
|
+
y: boundaryPositions[upperComponent].y
|
|
356
|
+
});
|
|
357
|
+
lpath.push({
|
|
358
|
+
x: upperX,
|
|
359
|
+
y: centerY
|
|
360
|
+
});
|
|
361
|
+
lpath.push({
|
|
362
|
+
x: boundaryPositions[lowerComponent].x,
|
|
363
|
+
y: centerY
|
|
364
|
+
});
|
|
365
|
+
break;
|
|
366
|
+
case _line.EAST:
|
|
367
|
+
var upperX = Math.max(boundaryPositions[upperComponent].x, boundaryPositions[lowerComponent].x);
|
|
368
|
+
lpath.push({
|
|
369
|
+
x: upperX,
|
|
370
|
+
y: boundaryPositions[upperComponent].y
|
|
371
|
+
});
|
|
372
|
+
lpath.push({
|
|
373
|
+
x: upperX,
|
|
374
|
+
y: centerY
|
|
375
|
+
});
|
|
376
|
+
lpath.push({
|
|
377
|
+
x: boundaryPositions[lowerComponent].x,
|
|
378
|
+
y: centerY
|
|
379
|
+
});
|
|
380
|
+
break;
|
|
381
|
+
default:
|
|
382
|
+
return this.path;
|
|
383
|
+
}
|
|
384
|
+
break;
|
|
385
|
+
case _line.SOUTH:
|
|
386
|
+
switch (upperComponentDirection) {
|
|
387
|
+
case _line.WEST:
|
|
388
|
+
var upperX = unionBounds.left;
|
|
389
|
+
var lowerX = upperX;
|
|
390
|
+
break;
|
|
391
|
+
case _line.EAST:
|
|
392
|
+
var upperX = centerX !== undefined ? Math.max(centerX, boundaryPositions[upperComponent].x) : unionBounds.left + unionBounds.width;
|
|
393
|
+
var lowerX = upperX;
|
|
394
|
+
break;
|
|
395
|
+
case _line.NORTH:
|
|
396
|
+
var upperX = centerX !== undefined ? centerX : boundaryPositions[upperComponent].x < boundaryPositions[lowerComponent].x ? unionBounds.left - centerHeight * 0.5 : unionBounds.left + unionBounds.width + centerHeight * 0.5;
|
|
397
|
+
var lowerX = upperX;
|
|
398
|
+
break;
|
|
399
|
+
case _line.SOUTH:
|
|
400
|
+
var upperX = boundaryPositions[upperComponent].x;
|
|
401
|
+
var lowerX = boundaryPositions[upperComponent].x < boundaryPositions[lowerComponent].x ? Math.min(fromToBounds[lowerComponent].left, boundaryPositions[upperComponent].x) : Math.max(fromToBounds[lowerComponent].left + fromToBounds[lowerComponent].width, boundaryPositions[upperComponent].x);
|
|
402
|
+
break;
|
|
403
|
+
default:
|
|
404
|
+
return this.path;
|
|
405
|
+
}
|
|
406
|
+
lpath.push({
|
|
407
|
+
x: upperX,
|
|
408
|
+
y: boundaryPositions[upperComponent].y
|
|
409
|
+
});
|
|
410
|
+
lpath.push({
|
|
411
|
+
x: upperX,
|
|
412
|
+
y: centerY
|
|
413
|
+
});
|
|
414
|
+
lpath.push({
|
|
415
|
+
x: lowerX,
|
|
416
|
+
y: centerY
|
|
417
|
+
});
|
|
418
|
+
lpath.push({
|
|
419
|
+
x: lowerX,
|
|
420
|
+
y: boundaryPositions[lowerComponent].y
|
|
421
|
+
});
|
|
422
|
+
break;
|
|
423
|
+
case _line.EAST:
|
|
424
|
+
switch (upperComponentDirection) {
|
|
425
|
+
case _line.WEST:
|
|
426
|
+
var upperX = centerX !== undefined ? Math.min(centerX, boundaryPositions[upperComponent].x) : boundaryPositions[upperComponent].x;
|
|
427
|
+
var lowerX = centerX !== undefined ? Math.max(centerX, boundaryPositions[lowerComponent].x) : boundaryPositions[lowerComponent].x;
|
|
428
|
+
break;
|
|
429
|
+
case _line.EAST:
|
|
430
|
+
var upperX = unionBounds.left + unionBounds.width;
|
|
431
|
+
var lowerX = upperX;
|
|
432
|
+
break;
|
|
433
|
+
case _line.NORTH:
|
|
434
|
+
var upperX = centerX !== undefined ? Math.max(centerX, boundaryPositions[lowerComponent].x) : unionBounds.left + unionBounds.width;
|
|
435
|
+
var lowerX = upperX;
|
|
436
|
+
break;
|
|
437
|
+
case _line.SOUTH:
|
|
438
|
+
var upperX = boundaryPositions[upperComponent].x;
|
|
439
|
+
var lowerX = Math.max(fromToBounds[lowerComponent].left + fromToBounds[lowerComponent].width, boundaryPositions[upperComponent].x);
|
|
440
|
+
break;
|
|
441
|
+
default:
|
|
442
|
+
return this.path;
|
|
443
|
+
}
|
|
444
|
+
lpath.push({
|
|
445
|
+
x: upperX,
|
|
446
|
+
y: boundaryPositions[upperComponent].y
|
|
447
|
+
});
|
|
448
|
+
lpath.push({
|
|
449
|
+
x: upperX,
|
|
450
|
+
y: centerY
|
|
451
|
+
});
|
|
452
|
+
lpath.push({
|
|
453
|
+
x: lowerX,
|
|
454
|
+
y: centerY
|
|
455
|
+
});
|
|
456
|
+
lpath.push({
|
|
457
|
+
x: lowerX,
|
|
458
|
+
y: boundaryPositions[lowerComponent].y
|
|
459
|
+
});
|
|
460
|
+
break;
|
|
461
|
+
case _line.WEST:
|
|
462
|
+
switch (upperComponentDirection) {
|
|
463
|
+
case _line.WEST:
|
|
464
|
+
var upperX = unionBounds.left;
|
|
465
|
+
var lowerX = upperX;
|
|
466
|
+
break;
|
|
467
|
+
case _line.EAST:
|
|
468
|
+
var upperX = centerX !== undefined ? Math.max(centerX, boundaryPositions[upperComponent].x) : boundaryPositions[upperComponent].x;
|
|
469
|
+
var lowerX = centerX !== undefined ? Math.min(centerX, boundaryPositions[lowerComponent].x) : boundaryPositions[lowerComponent].x;
|
|
470
|
+
break;
|
|
471
|
+
case _line.NORTH:
|
|
472
|
+
var upperX = unionBounds.left;
|
|
473
|
+
var lowerX = upperX;
|
|
474
|
+
break;
|
|
475
|
+
case _line.SOUTH:
|
|
476
|
+
var upperX = boundaryPositions[upperComponent].x < boundaryPositions[lowerComponent].x ? Math.min(fromToBounds[lowerComponent].left, boundaryPositions[upperComponent].x) : boundaryPositions[upperComponent].x;
|
|
477
|
+
var lowerX = Math.min(upperX, boundaryPositions[lowerComponent].x);
|
|
478
|
+
break;
|
|
479
|
+
default:
|
|
480
|
+
return this.path;
|
|
481
|
+
}
|
|
482
|
+
lpath.push({
|
|
483
|
+
x: upperX,
|
|
484
|
+
y: boundaryPositions[upperComponent].y
|
|
485
|
+
});
|
|
486
|
+
lpath.push({
|
|
487
|
+
x: upperX,
|
|
488
|
+
y: centerY
|
|
489
|
+
});
|
|
490
|
+
lpath.push({
|
|
491
|
+
x: lowerX,
|
|
492
|
+
y: centerY
|
|
493
|
+
});
|
|
494
|
+
lpath.push({
|
|
495
|
+
x: lowerX,
|
|
496
|
+
y: boundaryPositions[lowerComponent].y
|
|
497
|
+
});
|
|
498
|
+
break;
|
|
499
|
+
default:
|
|
500
|
+
return this.path;
|
|
501
|
+
}
|
|
502
|
+
path.push(...(upperComponent === FROM ? lpath : lpath.reverse()));
|
|
503
|
+
} else {
|
|
504
|
+
switch (fromDirection) {
|
|
505
|
+
case _line.NORTH:
|
|
506
|
+
switch (toDirection) {
|
|
507
|
+
case _line.NORTH:
|
|
508
|
+
var y = unionBounds.top;
|
|
509
|
+
path.push({
|
|
510
|
+
x: boundaryPositions[FROM].x,
|
|
511
|
+
y
|
|
512
|
+
});
|
|
513
|
+
path.push({
|
|
514
|
+
x: boundaryPositions[TO].x,
|
|
515
|
+
y
|
|
516
|
+
});
|
|
517
|
+
break;
|
|
518
|
+
case _line.SOUTH:
|
|
519
|
+
var x = unionBounds.left + unionBounds.width;
|
|
520
|
+
path.push({
|
|
521
|
+
x,
|
|
522
|
+
y: boundaryPositions[FROM].y
|
|
523
|
+
});
|
|
524
|
+
path.push({
|
|
525
|
+
x,
|
|
526
|
+
y: unionBounds.top + unionBounds.height
|
|
527
|
+
});
|
|
528
|
+
path.push({
|
|
529
|
+
x: boundaryPositions[TO].x,
|
|
530
|
+
y: unionBounds.top + unionBounds.height
|
|
531
|
+
});
|
|
532
|
+
break;
|
|
533
|
+
case _line.EAST:
|
|
534
|
+
var x = boundaryPositions[TO].y < boundaryPositions[FROM].y && boundaryPositions[TO].x < boundaryPositions[FROM].x ? boundaryPositions[FROM].x : unionBounds.left + unionBounds.width;
|
|
535
|
+
path.push({
|
|
536
|
+
x,
|
|
537
|
+
y: boundaryPositions[FROM].y
|
|
538
|
+
});
|
|
539
|
+
path.push({
|
|
540
|
+
x,
|
|
541
|
+
y: boundaryPositions[TO].y
|
|
542
|
+
});
|
|
543
|
+
break;
|
|
544
|
+
case _line.WEST:
|
|
545
|
+
var x = unionBounds.left;
|
|
546
|
+
path.push({
|
|
547
|
+
x,
|
|
548
|
+
y: boundaryPositions[FROM].y
|
|
549
|
+
});
|
|
550
|
+
path.push({
|
|
551
|
+
x,
|
|
552
|
+
y: boundaryPositions[TO].y
|
|
553
|
+
});
|
|
554
|
+
break;
|
|
555
|
+
default:
|
|
556
|
+
return this.path;
|
|
557
|
+
}
|
|
558
|
+
break;
|
|
559
|
+
case _line.SOUTH:
|
|
560
|
+
switch (toDirection) {
|
|
561
|
+
case _line.NORTH:
|
|
562
|
+
var x = unionBounds.left + unionBounds.width;
|
|
563
|
+
path.push({
|
|
564
|
+
x,
|
|
565
|
+
y: boundaryPositions[FROM].y
|
|
566
|
+
});
|
|
567
|
+
path.push({
|
|
568
|
+
x,
|
|
569
|
+
y: unionBounds.top
|
|
570
|
+
});
|
|
571
|
+
path.push({
|
|
572
|
+
x: boundaryPositions[TO].x,
|
|
573
|
+
y: unionBounds.top
|
|
574
|
+
});
|
|
575
|
+
break;
|
|
576
|
+
case _line.SOUTH:
|
|
577
|
+
var y = unionBounds.top + unionBounds.height;
|
|
578
|
+
path.push({
|
|
579
|
+
x: boundaryPositions[FROM].x,
|
|
580
|
+
y
|
|
581
|
+
});
|
|
582
|
+
path.push({
|
|
583
|
+
x: boundaryPositions[TO].x,
|
|
584
|
+
y
|
|
585
|
+
});
|
|
586
|
+
break;
|
|
587
|
+
case _line.EAST:
|
|
588
|
+
var y = unionBounds.top + unionBounds.height;
|
|
589
|
+
path.push({
|
|
590
|
+
x: boundaryPositions[FROM].x,
|
|
591
|
+
y
|
|
592
|
+
});
|
|
593
|
+
path.push({
|
|
594
|
+
x: boundaryPositions[TO].x,
|
|
595
|
+
y
|
|
596
|
+
});
|
|
597
|
+
break;
|
|
598
|
+
case _line.WEST:
|
|
599
|
+
var y = unionBounds.top + unionBounds.height;
|
|
600
|
+
path.push({
|
|
601
|
+
x: boundaryPositions[FROM].x,
|
|
602
|
+
y
|
|
603
|
+
});
|
|
604
|
+
path.push({
|
|
605
|
+
x: boundaryPositions[TO].x,
|
|
606
|
+
y
|
|
607
|
+
});
|
|
608
|
+
break;
|
|
609
|
+
default:
|
|
610
|
+
return this.path;
|
|
611
|
+
}
|
|
612
|
+
break;
|
|
613
|
+
case _line.WEST:
|
|
614
|
+
switch (toDirection) {
|
|
615
|
+
case _line.NORTH:
|
|
616
|
+
var x = boundaryPositions[FROM].x > boundaryPositions[TO].x && boundaryPositions[FROM].y < boundaryPositions[TO].y ? boundaryPositions[TO].x : unionBounds.left;
|
|
617
|
+
var y = boundaryPositions[FROM].x > boundaryPositions[TO].x && boundaryPositions[FROM].y < boundaryPositions[TO].y ? boundaryPositions[TO].y : Math.min(unionBounds.top, boundaryPositions[FROM].y);
|
|
618
|
+
path.push({
|
|
619
|
+
x,
|
|
620
|
+
y: boundaryPositions[FROM].y
|
|
621
|
+
});
|
|
622
|
+
path.push({
|
|
623
|
+
x,
|
|
624
|
+
y
|
|
625
|
+
});
|
|
626
|
+
path.push({
|
|
627
|
+
x: boundaryPositions[TO].x,
|
|
628
|
+
y
|
|
629
|
+
});
|
|
630
|
+
break;
|
|
631
|
+
case _line.SOUTH:
|
|
632
|
+
var x = unionBounds.left;
|
|
633
|
+
var y = Math.max(unionBounds.top + unionBounds.height, boundaryPositions[FROM].y);
|
|
634
|
+
path.push({
|
|
635
|
+
x,
|
|
636
|
+
y: boundaryPositions[FROM].y
|
|
637
|
+
});
|
|
638
|
+
path.push({
|
|
639
|
+
x,
|
|
640
|
+
y
|
|
641
|
+
});
|
|
642
|
+
path.push({
|
|
643
|
+
x: boundaryPositions[TO].x,
|
|
644
|
+
y
|
|
645
|
+
});
|
|
646
|
+
break;
|
|
647
|
+
case _line.EAST:
|
|
648
|
+
var x = unionBounds.left + unionBounds.width;
|
|
649
|
+
path.push({
|
|
650
|
+
x: boundaryPositions[FROM].x,
|
|
651
|
+
y: unionBounds.top
|
|
652
|
+
});
|
|
653
|
+
path.push({
|
|
654
|
+
x,
|
|
655
|
+
y: unionBounds.top
|
|
656
|
+
});
|
|
657
|
+
path.push({
|
|
658
|
+
x,
|
|
659
|
+
y: boundaryPositions[TO].y
|
|
660
|
+
});
|
|
661
|
+
break;
|
|
662
|
+
case _line.WEST:
|
|
663
|
+
var x = unionBounds.left;
|
|
664
|
+
path.push({
|
|
665
|
+
x,
|
|
666
|
+
y: boundaryPositions[FROM].y
|
|
667
|
+
});
|
|
668
|
+
path.push({
|
|
669
|
+
x,
|
|
670
|
+
y: boundaryPositions[TO].y
|
|
671
|
+
});
|
|
672
|
+
break;
|
|
673
|
+
default:
|
|
674
|
+
return this.path;
|
|
675
|
+
}
|
|
676
|
+
break;
|
|
677
|
+
case _line.EAST:
|
|
678
|
+
switch (toDirection) {
|
|
679
|
+
case _line.NORTH:
|
|
680
|
+
var y = boundaryPositions[FROM].y < boundaryPositions[TO].y && boundaryPositions[FROM].x < boundaryPositions[TO].x ? boundaryPositions[FROM].y : unionBounds.top;
|
|
681
|
+
path.push({
|
|
682
|
+
x: boundaryPositions[FROM].x,
|
|
683
|
+
y
|
|
684
|
+
});
|
|
685
|
+
path.push({
|
|
686
|
+
x: boundaryPositions[TO].x,
|
|
687
|
+
y
|
|
688
|
+
});
|
|
689
|
+
break;
|
|
690
|
+
case _line.SOUTH:
|
|
691
|
+
var y = boundaryPositions[FROM].y > boundaryPositions[TO].y && boundaryPositions[FROM].x < boundaryPositions[TO].x ? boundaryPositions[FROM].y : unionBounds.top + unionBounds.height;
|
|
692
|
+
path.push({
|
|
693
|
+
x: boundaryPositions[FROM].x,
|
|
694
|
+
y
|
|
695
|
+
});
|
|
696
|
+
path.push({
|
|
697
|
+
x: boundaryPositions[TO].x,
|
|
698
|
+
y
|
|
699
|
+
});
|
|
700
|
+
break;
|
|
701
|
+
case _line.EAST:
|
|
702
|
+
var y = unionBounds.top + unionBounds.height;
|
|
703
|
+
path.push({
|
|
704
|
+
x: boundaryPositions[FROM].x,
|
|
705
|
+
y
|
|
706
|
+
});
|
|
707
|
+
path.push({
|
|
708
|
+
x: boundaryPositions[TO].x,
|
|
709
|
+
y
|
|
710
|
+
});
|
|
711
|
+
break;
|
|
712
|
+
case _line.WEST:
|
|
713
|
+
var y = unionBounds.top + unionBounds.height;
|
|
714
|
+
path.push({
|
|
715
|
+
x: boundaryPositions[FROM].x,
|
|
716
|
+
y
|
|
717
|
+
});
|
|
718
|
+
path.push({
|
|
719
|
+
x: boundaryPositions[TO].x,
|
|
720
|
+
y
|
|
721
|
+
});
|
|
722
|
+
break;
|
|
723
|
+
default:
|
|
724
|
+
return this.path;
|
|
725
|
+
}
|
|
726
|
+
break;
|
|
727
|
+
default:
|
|
728
|
+
return this.path;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
if (toBoundaryPosition) {
|
|
732
|
+
path.push(toBoundaryPosition);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/* following 2 filters not to be merged */
|
|
736
|
+
return [fromPosition, ...path, toPosition].filter((p, idx, path) => {
|
|
737
|
+
if (idx === 0) {
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
const prev = path[idx - 1];
|
|
741
|
+
if (p.x === prev.x && p.y === prev.y) {
|
|
742
|
+
return false;
|
|
743
|
+
}
|
|
744
|
+
return true;
|
|
745
|
+
}).filter((p, idx, path) => {
|
|
746
|
+
if (idx === 0 || idx >= path.length - 1) {
|
|
747
|
+
return true;
|
|
748
|
+
}
|
|
749
|
+
const prev = path[idx - 1];
|
|
750
|
+
const next = path[idx + 1];
|
|
751
|
+
if (p.x === prev.x && p.x === next.x || p.y === prev.y && p.y === next.y) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
return true;
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
get nature() {
|
|
758
|
+
return NATURE;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
exports.default = OrthoLine;
|
|
762
|
+
_component.default.register('ortholine', OrthoLine);
|
|
763
|
+
//# sourceMappingURL=ortholine.js.map
|