@realsee/dnalogel 2.0.0-alpha.18 → 2.0.0-alpha.20
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/CHANGELOG.md +10 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
- package/dist/CameraMovementPlugin/index.js +15 -40
- package/dist/CameraMovementPlugin/typing.d.ts +1 -1
- package/dist/ModelChassisCompassPlugin/index.js +3 -28
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
- package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/index.js +3 -28
- package/dist/PanoCompassPlugin/index.js +53 -86
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/index.js +2 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/dist/PanoRulerPlugin/index.d.ts +1 -1
- package/dist/PanoRulerPlugin/index.js +3 -28
- package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
- package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1253 -1284
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +61 -183
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +1243 -1235
- package/dist/floorplan/utils/formatPosition.d.ts +1 -1
- package/dist/index.es.js +1431 -1435
- package/dist/index.js +1430 -1434
- package/dist/index.umd.js +1430 -1434
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/dist/shared-utils/three/getNormal.d.ts +1 -1
- package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
- package/docs/modules.html +12 -12
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
- package/libs/CameraMovementPlugin/index.js +15 -24
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +3 -12
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
- package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
- package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.js +3 -12
- package/libs/ModelTVVideoPlugin/typings.js +1 -0
- package/libs/PanoCompassPlugin/index.js +49 -64
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +1 -1
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +2 -0
- package/libs/PanoMeasurePlugin/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
- package/libs/PanoRulerPlugin/index.d.ts +1 -1
- package/libs/PanoRulerPlugin/index.js +3 -12
- package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
- package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
- package/libs/floorplan/utils/formatData.js +28 -43
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +2 -2
- package/libs/shared-utils/five/changeMode.js +12 -23
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.js +9 -20
- package/libs/shared-utils/three/loadTexture.js +6 -17
- package/libs/shared-utils/to.js +10 -21
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/* generated by Svelte v3.47.0 */
|
|
2
2
|
import {
|
|
3
3
|
SvelteComponent,
|
|
4
|
-
add_render_callback,
|
|
5
|
-
add_resize_listener,
|
|
6
4
|
append,
|
|
7
5
|
append_styles,
|
|
8
6
|
assign,
|
|
9
7
|
attr,
|
|
10
|
-
binding_callbacks,
|
|
11
8
|
check_outros,
|
|
12
9
|
create_component,
|
|
13
10
|
destroy_component,
|
|
@@ -18,7 +15,6 @@ import {
|
|
|
18
15
|
group_outros,
|
|
19
16
|
init,
|
|
20
17
|
insert,
|
|
21
|
-
listen,
|
|
22
18
|
mount_component,
|
|
23
19
|
outro_and_destroy_block,
|
|
24
20
|
safe_not_equal,
|
|
@@ -29,19 +25,18 @@ import {
|
|
|
29
25
|
} from "svelte/internal";
|
|
30
26
|
|
|
31
27
|
import Room from './Room';
|
|
32
|
-
import { Vector2 } from 'three';
|
|
33
28
|
|
|
34
29
|
function add_css(target) {
|
|
35
|
-
append_styles(target, "svelte-
|
|
30
|
+
append_styles(target, "svelte-1tk06jk", ".floorplan-plugin__room-highlight.svelte-1tk06jk{position:absolute;width:100%;height:100%}svg.svelte-1tk06jk{width:100%;height:100%;overflow:visible}");
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
function get_each_context(ctx, list, i) {
|
|
39
34
|
const child_ctx = ctx.slice();
|
|
40
|
-
child_ctx[
|
|
35
|
+
child_ctx[4] = list[i];
|
|
41
36
|
return child_ctx;
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
// (
|
|
39
|
+
// (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
|
|
45
40
|
function create_each_block(key_1, ctx) {
|
|
46
41
|
let first;
|
|
47
42
|
let room;
|
|
@@ -49,9 +44,8 @@ function create_each_block(key_1, ctx) {
|
|
|
49
44
|
|
|
50
45
|
const room_spread_levels = [
|
|
51
46
|
{
|
|
52
|
-
room: /*room*/ ctx[
|
|
53
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
54
|
-
pxmm: /*pxmm*/ ctx[0]
|
|
47
|
+
room: /*room*/ ctx[4],
|
|
48
|
+
floorplanData: /*floorplanData*/ ctx[1]
|
|
55
49
|
}
|
|
56
50
|
];
|
|
57
51
|
|
|
@@ -79,12 +73,11 @@ function create_each_block(key_1, ctx) {
|
|
|
79
73
|
p(new_ctx, dirty) {
|
|
80
74
|
ctx = new_ctx;
|
|
81
75
|
|
|
82
|
-
const room_changes = (dirty & /*floorplanData, floorIndex
|
|
76
|
+
const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
|
|
83
77
|
? get_spread_update(room_spread_levels, [
|
|
84
78
|
{
|
|
85
|
-
room: /*room*/ ctx[
|
|
86
|
-
floorplanData: /*floorplanData*/ ctx[
|
|
87
|
-
pxmm: /*pxmm*/ ctx[0]
|
|
79
|
+
room: /*room*/ ctx[4],
|
|
80
|
+
floorplanData: /*floorplanData*/ ctx[1]
|
|
88
81
|
}
|
|
89
82
|
])
|
|
90
83
|
: {};
|
|
@@ -112,12 +105,10 @@ function create_fragment(ctx) {
|
|
|
112
105
|
let svg;
|
|
113
106
|
let each_blocks = [];
|
|
114
107
|
let each_1_lookup = new Map();
|
|
115
|
-
let
|
|
108
|
+
let svg_viewBox_value;
|
|
116
109
|
let current;
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
|
|
120
|
-
const get_key = ctx => /*room*/ ctx[12].id;
|
|
110
|
+
let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
111
|
+
const get_key = ctx => /*room*/ ctx[4].id;
|
|
121
112
|
|
|
122
113
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
123
114
|
let child_ctx = get_each_context(ctx, each_value, i);
|
|
@@ -134,9 +125,11 @@ function create_fragment(ctx) {
|
|
|
134
125
|
each_blocks[i].c();
|
|
135
126
|
}
|
|
136
127
|
|
|
137
|
-
attr(svg, "
|
|
138
|
-
attr(
|
|
139
|
-
|
|
128
|
+
attr(svg, "width", "100%");
|
|
129
|
+
attr(svg, "height", "100%");
|
|
130
|
+
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
|
|
131
|
+
attr(svg, "class", "svelte-1tk06jk");
|
|
132
|
+
attr(div, "class", "floorplan-plugin__room-highlight svelte-1tk06jk");
|
|
140
133
|
},
|
|
141
134
|
m(target, anchor) {
|
|
142
135
|
insert(target, div, anchor);
|
|
@@ -146,18 +139,11 @@ function create_fragment(ctx) {
|
|
|
146
139
|
each_blocks[i].m(svg, null);
|
|
147
140
|
}
|
|
148
141
|
|
|
149
|
-
/*div_binding*/ ctx[9](div);
|
|
150
|
-
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
|
|
151
142
|
current = true;
|
|
152
|
-
|
|
153
|
-
if (!mounted) {
|
|
154
|
-
dispose = listen(div, "click", /*handleClick*/ ctx[6]);
|
|
155
|
-
mounted = true;
|
|
156
|
-
}
|
|
157
143
|
},
|
|
158
144
|
p(ctx, [dirty]) {
|
|
159
|
-
if (dirty & /*floorplanData, floorIndex
|
|
160
|
-
each_value = /*floorplanData*/ ctx[
|
|
145
|
+
if (dirty & /*floorplanData, floorIndex*/ 3) {
|
|
146
|
+
each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
|
|
161
147
|
group_outros();
|
|
162
148
|
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, outro_and_destroy_block, create_each_block, null, get_each_context);
|
|
163
149
|
check_outros();
|
|
@@ -185,106 +171,28 @@ function create_fragment(ctx) {
|
|
|
185
171
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
186
172
|
each_blocks[i].d();
|
|
187
173
|
}
|
|
188
|
-
|
|
189
|
-
/*div_binding*/ ctx[9](null);
|
|
190
|
-
div_resize_listener();
|
|
191
|
-
mounted = false;
|
|
192
|
-
dispose();
|
|
193
174
|
}
|
|
194
175
|
};
|
|
195
176
|
}
|
|
196
177
|
|
|
197
178
|
function instance($$self, $$props, $$invalidate) {
|
|
198
|
-
let { five } = $$props;
|
|
199
|
-
let { pxmm } = $$props;
|
|
200
179
|
let { floorIndex } = $$props;
|
|
201
180
|
let { floorplanData } = $$props;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
let clientHeight;
|
|
205
|
-
let highlightContainerDom;
|
|
206
|
-
const { observers: floorplan_observers } = floorplanData;
|
|
207
|
-
|
|
208
|
-
const handleClick = function (e) {
|
|
209
|
-
if ((onRoomHeightClick === null || onRoomHeightClick === void 0
|
|
210
|
-
? void 0
|
|
211
|
-
: onRoomHeightClick(e)) === false) return;
|
|
212
|
-
|
|
213
|
-
// 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
|
|
214
|
-
const boundingClientRect = highlightContainerDom.getBoundingClientRect();
|
|
215
|
-
|
|
216
|
-
const mouseClientVector = new Vector2(e.clientX, e.clientY);
|
|
217
|
-
const domTopLeftVector = new Vector2(boundingClientRect.left, boundingClientRect.top);
|
|
218
|
-
const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
|
|
219
|
-
|
|
220
|
-
// px 转换为 百分比
|
|
221
|
-
const mouseOffsetRelativeVector = new Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
|
|
222
|
-
|
|
223
|
-
const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
|
|
224
|
-
const position1 = new Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
|
|
225
|
-
const position2 = new Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
|
|
226
|
-
return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
|
|
227
|
-
})[0];
|
|
228
|
-
|
|
229
|
-
five.moveToPano(closestPoint.index);
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
function div_binding($$value) {
|
|
233
|
-
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
234
|
-
highlightContainerDom = $$value;
|
|
235
|
-
$$invalidate(5, highlightContainerDom);
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function div_elementresize_handler() {
|
|
240
|
-
clientWidth = this.clientWidth;
|
|
241
|
-
clientHeight = this.clientHeight;
|
|
242
|
-
$$invalidate(3, clientWidth);
|
|
243
|
-
$$invalidate(4, clientHeight);
|
|
244
|
-
}
|
|
181
|
+
const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
|
|
182
|
+
const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
|
|
245
183
|
|
|
246
184
|
$$self.$$set = $$props => {
|
|
247
|
-
if ('
|
|
248
|
-
if ('
|
|
249
|
-
if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
|
|
250
|
-
if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
|
|
251
|
-
if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
|
|
185
|
+
if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
|
|
186
|
+
if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
|
|
252
187
|
};
|
|
253
188
|
|
|
254
|
-
return [
|
|
255
|
-
pxmm,
|
|
256
|
-
floorIndex,
|
|
257
|
-
floorplanData,
|
|
258
|
-
clientWidth,
|
|
259
|
-
clientHeight,
|
|
260
|
-
highlightContainerDom,
|
|
261
|
-
handleClick,
|
|
262
|
-
five,
|
|
263
|
-
onRoomHeightClick,
|
|
264
|
-
div_binding,
|
|
265
|
-
div_elementresize_handler
|
|
266
|
-
];
|
|
189
|
+
return [floorIndex, floorplanData, boundingWidth, boundingHeight];
|
|
267
190
|
}
|
|
268
191
|
|
|
269
192
|
class Component extends SvelteComponent {
|
|
270
193
|
constructor(options) {
|
|
271
194
|
super();
|
|
272
|
-
|
|
273
|
-
init(
|
|
274
|
-
this,
|
|
275
|
-
options,
|
|
276
|
-
instance,
|
|
277
|
-
create_fragment,
|
|
278
|
-
safe_not_equal,
|
|
279
|
-
{
|
|
280
|
-
five: 7,
|
|
281
|
-
pxmm: 0,
|
|
282
|
-
floorIndex: 1,
|
|
283
|
-
floorplanData: 2,
|
|
284
|
-
onRoomHeightClick: 8
|
|
285
|
-
},
|
|
286
|
-
add_css
|
|
287
|
-
);
|
|
195
|
+
init(this, options, instance, create_fragment, safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css);
|
|
288
196
|
}
|
|
289
197
|
}
|
|
290
198
|
|
package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js
RENAMED
|
File without changes
|
package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js
RENAMED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import RoomLabel from './RoomLabel';
|
|
26
26
|
|
|
27
27
|
function add_css(target) {
|
|
28
|
-
append_styles(target, "svelte-
|
|
28
|
+
append_styles(target, "svelte-447cof", ".floorplan-plugin__room-labels.svelte-447cof{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function get_each_context(ctx, list, i) {
|
|
@@ -57,7 +57,7 @@ function create_if_block(ctx) {
|
|
|
57
57
|
each_blocks[i].c();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
attr(div, "class", "floorplan-plugin__room-labels svelte-
|
|
60
|
+
attr(div, "class", "floorplan-plugin__room-labels svelte-447cof");
|
|
61
61
|
},
|
|
62
62
|
m(target, anchor) {
|
|
63
63
|
insert(target, div, anchor);
|
|
@@ -30,15 +30,15 @@ function add_css(target) {
|
|
|
30
30
|
|
|
31
31
|
function get_each_context(ctx, list, i) {
|
|
32
32
|
const child_ctx = ctx.slice();
|
|
33
|
-
child_ctx[
|
|
33
|
+
child_ctx[5] = list[i];
|
|
34
34
|
return child_ctx;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// (
|
|
37
|
+
// (19:6) {:else}
|
|
38
38
|
function create_else_block(ctx) {
|
|
39
39
|
let roommaterial_1;
|
|
40
40
|
let current;
|
|
41
|
-
roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[
|
|
41
|
+
roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
44
|
c() {
|
|
@@ -50,7 +50,7 @@ function create_else_block(ctx) {
|
|
|
50
50
|
},
|
|
51
51
|
p(ctx, dirty) {
|
|
52
52
|
const roommaterial_1_changes = {};
|
|
53
|
-
if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[
|
|
53
|
+
if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
|
|
54
54
|
roommaterial_1.$set(roommaterial_1_changes);
|
|
55
55
|
},
|
|
56
56
|
i(local) {
|
|
@@ -68,11 +68,11 @@ function create_else_block(ctx) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// (
|
|
71
|
+
// (17:37)
|
|
72
72
|
function create_if_block_1(ctx) {
|
|
73
73
|
let roommaterial_2;
|
|
74
74
|
let current;
|
|
75
|
-
roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[
|
|
75
|
+
roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
|
|
76
76
|
|
|
77
77
|
return {
|
|
78
78
|
c() {
|
|
@@ -84,7 +84,7 @@ function create_if_block_1(ctx) {
|
|
|
84
84
|
},
|
|
85
85
|
p(ctx, dirty) {
|
|
86
86
|
const roommaterial_2_changes = {};
|
|
87
|
-
if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[
|
|
87
|
+
if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
|
|
88
88
|
roommaterial_2.$set(roommaterial_2_changes);
|
|
89
89
|
},
|
|
90
90
|
i(local) {
|
|
@@ -102,11 +102,11 @@ function create_if_block_1(ctx) {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// (
|
|
105
|
+
// (15:6) {#if room.floorType === 1}
|
|
106
106
|
function create_if_block(ctx) {
|
|
107
107
|
let roommaterial_0;
|
|
108
108
|
let current;
|
|
109
|
-
roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[
|
|
109
|
+
roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
|
|
110
110
|
|
|
111
111
|
return {
|
|
112
112
|
c() {
|
|
@@ -118,7 +118,7 @@ function create_if_block(ctx) {
|
|
|
118
118
|
},
|
|
119
119
|
p(ctx, dirty) {
|
|
120
120
|
const roommaterial_0_changes = {};
|
|
121
|
-
if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[
|
|
121
|
+
if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
|
|
122
122
|
roommaterial_0.$set(roommaterial_0_changes);
|
|
123
123
|
},
|
|
124
124
|
i(local) {
|
|
@@ -136,18 +136,19 @@ function create_if_block(ctx) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
// (
|
|
139
|
+
// (13:2) {#each rooms as room}
|
|
140
140
|
function create_each_block(ctx) {
|
|
141
141
|
let svg;
|
|
142
142
|
let current_block_type_index;
|
|
143
143
|
let if_block;
|
|
144
|
+
let svg_viewBox_value;
|
|
144
145
|
let current;
|
|
145
146
|
const if_block_creators = [create_if_block, create_if_block_1, create_else_block];
|
|
146
147
|
const if_blocks = [];
|
|
147
148
|
|
|
148
149
|
function select_block_type(ctx, dirty) {
|
|
149
|
-
if (/*room*/ ctx[
|
|
150
|
-
if (/*room*/ ctx[
|
|
150
|
+
if (/*room*/ ctx[5].floorType === 1) return 0;
|
|
151
|
+
if (/*room*/ ctx[5].floorType === 0) return 1;
|
|
151
152
|
return 2;
|
|
152
153
|
}
|
|
153
154
|
|
|
@@ -158,6 +159,9 @@ function create_each_block(ctx) {
|
|
|
158
159
|
c() {
|
|
159
160
|
svg = svg_element("svg");
|
|
160
161
|
if_block.c();
|
|
162
|
+
attr(svg, "width", "100%");
|
|
163
|
+
attr(svg, "height", "100%");
|
|
164
|
+
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
|
|
161
165
|
attr(svg, "class", "svelte-1b0icjc");
|
|
162
166
|
},
|
|
163
167
|
m(target, anchor) {
|
|
@@ -242,7 +246,7 @@ function create_fragment(ctx) {
|
|
|
242
246
|
current = true;
|
|
243
247
|
},
|
|
244
248
|
p(ctx, [dirty]) {
|
|
245
|
-
if (dirty & /*rooms*/
|
|
249
|
+
if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
|
|
246
250
|
each_value = /*rooms*/ ctx[0];
|
|
247
251
|
let i;
|
|
248
252
|
|
|
@@ -297,30 +301,30 @@ function create_fragment(ctx) {
|
|
|
297
301
|
function instance($$self, $$props, $$invalidate) {
|
|
298
302
|
let rooms;
|
|
299
303
|
let { floorIndex } = $$props;
|
|
300
|
-
let { pxmm } = $$props;
|
|
301
304
|
let { floorplanData } = $$props;
|
|
305
|
+
const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
|
|
306
|
+
const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
|
|
302
307
|
|
|
303
308
|
$$self.$$set = $$props => {
|
|
304
|
-
if ('floorIndex' in $$props) $$invalidate(
|
|
305
|
-
if ('
|
|
306
|
-
if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
|
|
309
|
+
if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
|
|
310
|
+
if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
|
|
307
311
|
};
|
|
308
312
|
|
|
309
313
|
$$self.$$.update = () => {
|
|
310
|
-
if ($$self.$$.dirty & /*floorplanData, floorIndex
|
|
314
|
+
if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
|
|
311
315
|
$: $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
|
|
312
|
-
path: room.path.map(p => formatFloorplanPoint(p,
|
|
316
|
+
path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
|
|
313
317
|
})));
|
|
314
318
|
}
|
|
315
319
|
};
|
|
316
320
|
|
|
317
|
-
return [rooms,
|
|
321
|
+
return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
|
|
318
322
|
}
|
|
319
323
|
|
|
320
324
|
class Component extends SvelteComponent {
|
|
321
325
|
constructor(options) {
|
|
322
326
|
super();
|
|
323
|
-
init(this, options, instance, create_fragment, safe_not_equal, { floorIndex:
|
|
327
|
+
init(this, options, instance, create_fragment, safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css);
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/* generated by Svelte v3.47.0 */
|
|
2
|
+
import {
|
|
3
|
+
SvelteComponent,
|
|
4
|
+
append,
|
|
5
|
+
append_styles,
|
|
6
|
+
attr,
|
|
7
|
+
destroy_block,
|
|
8
|
+
destroy_each,
|
|
9
|
+
detach,
|
|
10
|
+
element,
|
|
11
|
+
init,
|
|
12
|
+
insert,
|
|
13
|
+
noop,
|
|
14
|
+
safe_not_equal,
|
|
15
|
+
set_style,
|
|
16
|
+
space,
|
|
17
|
+
text,
|
|
18
|
+
toggle_class,
|
|
19
|
+
update_keyed_each
|
|
20
|
+
} from "svelte/internal";
|
|
21
|
+
|
|
22
|
+
function add_css(target) {
|
|
23
|
+
append_styles(target, "svelte-1l1xujz", ".floorplan-plugin__rule-labels.svelte-1l1xujz.svelte-1l1xujz{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1l1xujz.svelte-1l1xujz{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1l1xujz.svelte-1l1xujz{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1l1xujz.svelte-1l1xujz{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1l1xujz.svelte-1l1xujz{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1l1xujz.svelte-1l1xujz{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1l1xujz.svelte-1l1xujz{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1l1xujz .floorplan-plugin__rule-scale-wrapper.svelte-1l1xujz{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1l1xujz.svelte-1l1xujz{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1l1xujz .floorplan-plugin__rule-scale.svelte-1l1xujz{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1l1xujz.svelte-1l1xujz{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1l1xujz .floorplan-plugin__rule-text-wrapper.svelte-1l1xujz{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1l1xujz .floorplan-plugin__rule-text-wrapper.svelte-1l1xujz{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1l1xujz .floorplan-plugin__rule-text-wrapper.svelte-1l1xujz{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1l1xujz .floorplan-plugin__rule-text-wrapper.svelte-1l1xujz{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1l1xujz.svelte-1l1xujz{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1l1xujz .floorplan-plugin__rule-text-item.svelte-1l1xujz{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1l1xujz.svelte-1l1xujz{width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function get_each_context(ctx, list, i) {
|
|
27
|
+
const child_ctx = ctx.slice();
|
|
28
|
+
child_ctx[10] = list[i];
|
|
29
|
+
child_ctx[12] = i;
|
|
30
|
+
return child_ctx;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function get_each_context_1(ctx, list, i) {
|
|
34
|
+
const child_ctx = ctx.slice();
|
|
35
|
+
child_ctx[13] = list[i];
|
|
36
|
+
return child_ctx;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// (53:4) {#each rulerLabels as rulerLabel}
|
|
40
|
+
function create_each_block_1(ctx) {
|
|
41
|
+
let div;
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
c() {
|
|
45
|
+
div = element("div");
|
|
46
|
+
attr(div, "class", "floorplan-plugin__rule-scale svelte-1l1xujz");
|
|
47
|
+
set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
|
|
48
|
+
set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
|
|
49
|
+
},
|
|
50
|
+
m(target, anchor) {
|
|
51
|
+
insert(target, div, anchor);
|
|
52
|
+
},
|
|
53
|
+
p: noop,
|
|
54
|
+
d(detaching) {
|
|
55
|
+
if (detaching) detach(div);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
|
|
61
|
+
function create_each_block(key_1, ctx) {
|
|
62
|
+
let div1;
|
|
63
|
+
let div0;
|
|
64
|
+
let t0_value = /*textItem*/ ctx[10].distance + "";
|
|
65
|
+
let t0;
|
|
66
|
+
let t1;
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
key: key_1,
|
|
70
|
+
first: null,
|
|
71
|
+
c() {
|
|
72
|
+
div1 = element("div");
|
|
73
|
+
div0 = element("div");
|
|
74
|
+
t0 = text(t0_value);
|
|
75
|
+
t1 = space();
|
|
76
|
+
attr(div0, "class", "floorplan-plugin__rule-text svelte-1l1xujz");
|
|
77
|
+
toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
|
|
78
|
+
attr(div1, "class", "floorplan-plugin__rule-text-item svelte-1l1xujz");
|
|
79
|
+
set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
|
|
80
|
+
set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
|
|
81
|
+
this.first = div1;
|
|
82
|
+
},
|
|
83
|
+
m(target, anchor) {
|
|
84
|
+
insert(target, div1, anchor);
|
|
85
|
+
append(div1, div0);
|
|
86
|
+
append(div0, t0);
|
|
87
|
+
append(div1, t1);
|
|
88
|
+
},
|
|
89
|
+
p(new_ctx, dirty) {
|
|
90
|
+
ctx = new_ctx;
|
|
91
|
+
},
|
|
92
|
+
d(detaching) {
|
|
93
|
+
if (detaching) detach(div1);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function create_fragment(ctx) {
|
|
99
|
+
let div3;
|
|
100
|
+
let div0;
|
|
101
|
+
let t0;
|
|
102
|
+
let div1;
|
|
103
|
+
let t1;
|
|
104
|
+
let div2;
|
|
105
|
+
let each_blocks = [];
|
|
106
|
+
let each1_lookup = new Map();
|
|
107
|
+
let div3_class_value;
|
|
108
|
+
let each_value_1 = /*rulerLabels*/ ctx[2];
|
|
109
|
+
let each_blocks_1 = [];
|
|
110
|
+
|
|
111
|
+
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
112
|
+
each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
let each_value = /*rulerTexts*/ ctx[3];
|
|
116
|
+
const get_key = ctx => /*textItemIndex*/ ctx[12];
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
119
|
+
let child_ctx = get_each_context(ctx, each_value, i);
|
|
120
|
+
let key = get_key(child_ctx);
|
|
121
|
+
each1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
c() {
|
|
126
|
+
div3 = element("div");
|
|
127
|
+
div0 = element("div");
|
|
128
|
+
t0 = space();
|
|
129
|
+
div1 = element("div");
|
|
130
|
+
|
|
131
|
+
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
132
|
+
each_blocks_1[i].c();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
t1 = space();
|
|
136
|
+
div2 = element("div");
|
|
137
|
+
|
|
138
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
139
|
+
each_blocks[i].c();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
attr(div0, "class", "floorplan-plugin__rule-line svelte-1l1xujz");
|
|
143
|
+
attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-1l1xujz");
|
|
144
|
+
toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
|
|
145
|
+
attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-1l1xujz");
|
|
146
|
+
attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-1l1xujz");
|
|
147
|
+
toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
|
|
148
|
+
set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
|
|
149
|
+
set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
|
|
150
|
+
},
|
|
151
|
+
m(target, anchor) {
|
|
152
|
+
insert(target, div3, anchor);
|
|
153
|
+
append(div3, div0);
|
|
154
|
+
append(div3, t0);
|
|
155
|
+
append(div3, div1);
|
|
156
|
+
|
|
157
|
+
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
158
|
+
each_blocks_1[i].m(div1, null);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
append(div3, t1);
|
|
162
|
+
append(div3, div2);
|
|
163
|
+
|
|
164
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
165
|
+
each_blocks[i].m(div2, null);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
p(ctx, [dirty]) {
|
|
169
|
+
if (dirty & /*rulerLabels*/ 4) {
|
|
170
|
+
each_value_1 = /*rulerLabels*/ ctx[2];
|
|
171
|
+
let i;
|
|
172
|
+
|
|
173
|
+
for (i = 0; i < each_value_1.length; i += 1) {
|
|
174
|
+
const child_ctx = get_each_context_1(ctx, each_value_1, i);
|
|
175
|
+
|
|
176
|
+
if (each_blocks_1[i]) {
|
|
177
|
+
each_blocks_1[i].p(child_ctx, dirty);
|
|
178
|
+
} else {
|
|
179
|
+
each_blocks_1[i] = create_each_block_1(child_ctx);
|
|
180
|
+
each_blocks_1[i].c();
|
|
181
|
+
each_blocks_1[i].m(div1, null);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
for (; i < each_blocks_1.length; i += 1) {
|
|
186
|
+
each_blocks_1[i].d(1);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
each_blocks_1.length = each_value_1.length;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (dirty & /*rulerTexts, isRow*/ 10) {
|
|
193
|
+
each_value = /*rulerTexts*/ ctx[3];
|
|
194
|
+
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, destroy_block, create_each_block, null, get_each_context);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-1l1xujz")) {
|
|
198
|
+
attr(div3, "class", div3_class_value);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (dirty & /*type, isRow*/ 3) {
|
|
202
|
+
toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
i: noop,
|
|
206
|
+
o: noop,
|
|
207
|
+
d(detaching) {
|
|
208
|
+
if (detaching) detach(div3);
|
|
209
|
+
destroy_each(each_blocks_1, detaching);
|
|
210
|
+
|
|
211
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
212
|
+
each_blocks[i].d();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const padding = 1000;
|
|
219
|
+
const exteriorWallOffset = 180;
|
|
220
|
+
|
|
221
|
+
function instance($$self, $$props, $$invalidate) {
|
|
222
|
+
let { type } = $$props;
|
|
223
|
+
let { data } = $$props;
|
|
224
|
+
let { bounding } = $$props;
|
|
225
|
+
const isRow = type === 'top' || type === 'bottom';
|
|
226
|
+
const contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2;
|
|
227
|
+
const contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2;
|
|
228
|
+
|
|
229
|
+
// 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
|
|
230
|
+
const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
|
|
231
|
+
// 筛除重复数据
|
|
232
|
+
if (index === 0) return true;
|
|
233
|
+
|
|
234
|
+
return x !== arr[index - 1];
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const rulerLabels = rulerPoints.map(num => {
|
|
238
|
+
const left = isRow
|
|
239
|
+
? (num - bounding.min.x - padding + exteriorWallOffset) / contentWidth
|
|
240
|
+
: 0;
|
|
241
|
+
|
|
242
|
+
const bottom = !isRow
|
|
243
|
+
? (num - bounding.min.y - padding + exteriorWallOffset) / contentHeight
|
|
244
|
+
: 0;
|
|
245
|
+
|
|
246
|
+
return { left, bottom };
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
rulerLabels.unshift({ left: 0, bottom: 0 });
|
|
250
|
+
rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
|
|
251
|
+
const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
|
|
252
|
+
|
|
253
|
+
const rulerTexts = rulerPoints.map((num, index, arr) => {
|
|
254
|
+
const distance = index === 0 ? 0 : num - arr[index - 1];
|
|
255
|
+
const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
|
|
256
|
+
|
|
257
|
+
const left = isRow
|
|
258
|
+
? (positionNum - bounding.min.x - padding + exteriorWallOffset) / contentWidth
|
|
259
|
+
: 0;
|
|
260
|
+
|
|
261
|
+
const bottom = !isRow
|
|
262
|
+
? (positionNum - bounding.min.y - padding + exteriorWallOffset) / contentHeight
|
|
263
|
+
: 0;
|
|
264
|
+
|
|
265
|
+
return { left, bottom, distance };
|
|
266
|
+
}).filter(({ distance }) => distance / length > 0.1);
|
|
267
|
+
|
|
268
|
+
$$self.$$set = $$props => {
|
|
269
|
+
if ('type' in $$props) $$invalidate(0, type = $$props.type);
|
|
270
|
+
if ('data' in $$props) $$invalidate(4, data = $$props.data);
|
|
271
|
+
if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
return [type, isRow, rulerLabels, rulerTexts, data, bounding];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
class Component extends SvelteComponent {
|
|
278
|
+
constructor(options) {
|
|
279
|
+
super();
|
|
280
|
+
init(this, options, instance, create_fragment, safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export default Component;
|