@realsee/dnalogel 2.0.0-alpha.34 → 2.0.0-alpha.35

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.
Files changed (115) hide show
  1. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  2. package/dist/PanoSpatialTagPlugin/index.js +57 -48
  3. package/dist/index.es.js +57 -48
  4. package/dist/index.js +57 -48
  5. package/dist/index.umd.js +57 -48
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
  10. package/docs/enums/CameraMovementEffect.html +2 -2
  11. package/docs/enums/DIRECTION.html +1 -1
  12. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  13. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  14. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  16. package/docs/enums/Rotation.html +2 -2
  17. package/docs/index.html +1 -1
  18. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  19. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  20. package/docs/interfaces/FloorplanBounding.html +4 -4
  21. package/docs/interfaces/FloorplanData.html +2 -2
  22. package/docs/interfaces/FloorplanEntrance.html +7 -7
  23. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  24. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  25. package/docs/interfaces/FloorplanFloorData.html +2 -2
  26. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  27. package/docs/interfaces/FloorplanObserver.html +2 -2
  28. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  29. package/docs/interfaces/FloorplanPosition.html +2 -2
  30. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  31. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  32. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  33. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  34. package/docs/interfaces/FloorplanServerData.html +2 -2
  35. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  36. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  37. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  38. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  39. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  40. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  41. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  42. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  43. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  44. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  45. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  46. package/docs/interfaces/LineJson.html +1 -1
  47. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  48. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  49. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  50. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  51. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  52. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  53. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  54. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  57. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  61. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  62. package/docs/interfaces/OpenParameter.html +2 -2
  63. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  64. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  65. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  66. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  67. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
  68. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  69. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  70. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  72. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  73. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  74. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  75. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  81. package/docs/interfaces/Point.html +1 -1
  82. package/docs/interfaces/PointJson.html +1 -1
  83. package/docs/interfaces/Room.html +1 -1
  84. package/docs/interfaces/RoomInfo.html +1 -1
  85. package/docs/interfaces/RoomLabel.html +7 -7
  86. package/docs/interfaces/RoomRules.html +1 -1
  87. package/docs/interfaces/Rooms.html +1 -1
  88. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
  89. package/docs/modules.html +20 -20
  90. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  91. package/libs/ModelSimulationPlugin/index.js +166 -0
  92. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  93. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  94. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  95. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  96. package/libs/PanoSpatialTagPlugin/Components/tag.js +2 -2
  97. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
  98. package/libs/PanoSpatialTagPlugin/Plugin.js +55 -46
  99. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  100. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  101. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  102. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  103. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  104. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  105. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  106. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  107. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  108. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  109. package/libs/shared-utils/five/useFivePlugin.d.ts +1 -0
  110. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  111. package/libs/shared-utils/useDebounce.d.ts +8 -0
  112. package/libs/shared-utils/useDebounce.js +22 -0
  113. package/libs/shared-utils/useThrottle.d.ts +8 -0
  114. package/libs/shared-utils/useThrottle.js +25 -0
  115. package/package.json +1 -1
@@ -0,0 +1,265 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ append_styles,
5
+ assign,
6
+ attr,
7
+ check_outros,
8
+ create_component,
9
+ destroy_component,
10
+ detach,
11
+ element,
12
+ empty,
13
+ get_spread_update,
14
+ group_outros,
15
+ init,
16
+ insert,
17
+ mount_component,
18
+ outro_and_destroy_block,
19
+ safe_not_equal,
20
+ transition_in,
21
+ transition_out,
22
+ update_keyed_each
23
+ } from "svelte/internal";
24
+
25
+ import RoomLabel from './RoomLabel';
26
+
27
+ function add_css(target) {
28
+ append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
29
+ }
30
+
31
+ function get_each_context(ctx, list, i) {
32
+ const child_ctx = ctx.slice();
33
+ child_ctx[4] = list[i];
34
+ return child_ctx;
35
+ }
36
+
37
+ // (8:0) {#if rooms}
38
+ function create_if_block(ctx) {
39
+ let div;
40
+ let each_blocks = [];
41
+ let each_1_lookup = new Map();
42
+ let current;
43
+ let each_value = /*rooms*/ ctx[1];
44
+ const get_key = ctx => /*room*/ ctx[4].id;
45
+
46
+ for (let i = 0; i < each_value.length; i += 1) {
47
+ let child_ctx = get_each_context(ctx, each_value, i);
48
+ let key = get_key(child_ctx);
49
+ each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
50
+ }
51
+
52
+ return {
53
+ c() {
54
+ div = element("div");
55
+
56
+ for (let i = 0; i < each_blocks.length; i += 1) {
57
+ each_blocks[i].c();
58
+ }
59
+
60
+ attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
61
+ },
62
+ m(target, anchor) {
63
+ insert(target, div, anchor);
64
+
65
+ for (let i = 0; i < each_blocks.length; i += 1) {
66
+ each_blocks[i].m(div, null);
67
+ }
68
+
69
+ current = true;
70
+ },
71
+ p(ctx, dirty) {
72
+ if (dirty & /*rooms, getLabelElement*/ 3) {
73
+ each_value = /*rooms*/ ctx[1];
74
+ group_outros();
75
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
76
+ check_outros();
77
+ }
78
+ },
79
+ i(local) {
80
+ if (current) return;
81
+
82
+ for (let i = 0; i < each_value.length; i += 1) {
83
+ transition_in(each_blocks[i]);
84
+ }
85
+
86
+ current = true;
87
+ },
88
+ o(local) {
89
+ for (let i = 0; i < each_blocks.length; i += 1) {
90
+ transition_out(each_blocks[i]);
91
+ }
92
+
93
+ current = false;
94
+ },
95
+ d(detaching) {
96
+ if (detaching) detach(div);
97
+
98
+ for (let i = 0; i < each_blocks.length; i += 1) {
99
+ each_blocks[i].d();
100
+ }
101
+ }
102
+ };
103
+ }
104
+
105
+ // (10:4) {#each rooms as room (room.id)}
106
+ function create_each_block(key_1, ctx) {
107
+ let first;
108
+ let roomlabel;
109
+ let current;
110
+
111
+ const roomlabel_spread_levels = [
112
+ {
113
+ room: /*room*/ ctx[4],
114
+ getLabelElement: /*getLabelElement*/ ctx[0]
115
+ }
116
+ ];
117
+
118
+ let roomlabel_props = {};
119
+
120
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
121
+ roomlabel_props = assign(roomlabel_props, roomlabel_spread_levels[i]);
122
+ }
123
+
124
+ roomlabel = new RoomLabel({ props: roomlabel_props });
125
+
126
+ return {
127
+ key: key_1,
128
+ first: null,
129
+ c() {
130
+ first = empty();
131
+ create_component(roomlabel.$$.fragment);
132
+ this.first = first;
133
+ },
134
+ m(target, anchor) {
135
+ insert(target, first, anchor);
136
+ mount_component(roomlabel, target, anchor);
137
+ current = true;
138
+ },
139
+ p(new_ctx, dirty) {
140
+ ctx = new_ctx;
141
+
142
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
143
+ ? get_spread_update(roomlabel_spread_levels, [
144
+ {
145
+ room: /*room*/ ctx[4],
146
+ getLabelElement: /*getLabelElement*/ ctx[0]
147
+ }
148
+ ])
149
+ : {};
150
+
151
+ roomlabel.$set(roomlabel_changes);
152
+ },
153
+ i(local) {
154
+ if (current) return;
155
+ transition_in(roomlabel.$$.fragment, local);
156
+ current = true;
157
+ },
158
+ o(local) {
159
+ transition_out(roomlabel.$$.fragment, local);
160
+ current = false;
161
+ },
162
+ d(detaching) {
163
+ if (detaching) detach(first);
164
+ destroy_component(roomlabel, detaching);
165
+ }
166
+ };
167
+ }
168
+
169
+ function create_fragment(ctx) {
170
+ let if_block_anchor;
171
+ let current;
172
+ let if_block = /*rooms*/ ctx[1] && create_if_block(ctx);
173
+
174
+ return {
175
+ c() {
176
+ if (if_block) if_block.c();
177
+ if_block_anchor = empty();
178
+ },
179
+ m(target, anchor) {
180
+ if (if_block) if_block.m(target, anchor);
181
+ insert(target, if_block_anchor, anchor);
182
+ current = true;
183
+ },
184
+ p(ctx, [dirty]) {
185
+ if (/*rooms*/ ctx[1]) {
186
+ if (if_block) {
187
+ if_block.p(ctx, dirty);
188
+
189
+ if (dirty & /*rooms*/ 2) {
190
+ transition_in(if_block, 1);
191
+ }
192
+ } else {
193
+ if_block = create_if_block(ctx);
194
+ if_block.c();
195
+ transition_in(if_block, 1);
196
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
197
+ }
198
+ } else if (if_block) {
199
+ group_outros();
200
+
201
+ transition_out(if_block, 1, 1, () => {
202
+ if_block = null;
203
+ });
204
+
205
+ check_outros();
206
+ }
207
+ },
208
+ i(local) {
209
+ if (current) return;
210
+ transition_in(if_block);
211
+ current = true;
212
+ },
213
+ o(local) {
214
+ transition_out(if_block);
215
+ current = false;
216
+ },
217
+ d(detaching) {
218
+ if (if_block) if_block.d(detaching);
219
+ if (detaching) detach(if_block_anchor);
220
+ }
221
+ };
222
+ }
223
+
224
+ function instance($$self, $$props, $$invalidate) {
225
+ let rooms;
226
+ let { floorIndex } = $$props;
227
+ let { floorplanData } = $$props;
228
+ let { getLabelElement } = $$props;
229
+
230
+ $$self.$$set = $$props => {
231
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
232
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
233
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
234
+ };
235
+
236
+ $$self.$$.update = () => {
237
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
238
+ $: $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
239
+ }
240
+ };
241
+
242
+ return [getLabelElement, rooms, floorIndex, floorplanData];
243
+ }
244
+
245
+ class Component extends SvelteComponent {
246
+ constructor(options) {
247
+ super();
248
+
249
+ init(
250
+ this,
251
+ options,
252
+ instance,
253
+ create_fragment,
254
+ safe_not_equal,
255
+ {
256
+ floorIndex: 2,
257
+ floorplanData: 3,
258
+ getLabelElement: 0
259
+ },
260
+ add_css
261
+ );
262
+ }
263
+ }
264
+
265
+ export default Component;
@@ -0,0 +1,301 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ append,
5
+ append_styles,
6
+ attr,
7
+ destroy_block,
8
+ detach,
9
+ element,
10
+ init,
11
+ insert,
12
+ noop,
13
+ safe_not_equal,
14
+ set_style,
15
+ space,
16
+ text,
17
+ toggle_class,
18
+ update_keyed_each
19
+ } from "svelte/internal";
20
+
21
+ import { notNil } from '../../../../shared-utils/isNil';
22
+
23
+ function add_css(target) {
24
+ append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom-1rr09in{bottom:10px}.floorplan-plugin__rule-text-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row-1rr09in{transform:translate(-50%, -50%)}");
25
+ }
26
+
27
+ function get_each_context(ctx, list, i) {
28
+ const child_ctx = ctx.slice();
29
+ child_ctx[24] = list[i];
30
+ child_ctx[26] = i;
31
+ return child_ctx;
32
+ }
33
+
34
+ function get_each_context_1(ctx, list, i) {
35
+ const child_ctx = ctx.slice();
36
+ child_ctx[27] = list[i];
37
+ child_ctx[29] = i;
38
+ return child_ctx;
39
+ }
40
+
41
+ // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
42
+ function create_each_block_1(key_1, ctx) {
43
+ let div;
44
+ let style_left = `${/*position*/ ctx[27]}px`;
45
+
46
+ return {
47
+ key: key_1,
48
+ first: null,
49
+ c() {
50
+ div = element("div");
51
+ attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
52
+ set_style(div, "left", style_left, false);
53
+ this.first = div;
54
+ },
55
+ m(target, anchor) {
56
+ insert(target, div, anchor);
57
+ },
58
+ p(new_ctx, dirty) {
59
+ ctx = new_ctx;
60
+ },
61
+ d(detaching) {
62
+ if (detaching) detach(div);
63
+ }
64
+ };
65
+ }
66
+
67
+ // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
68
+ function create_each_block(key_1, ctx) {
69
+ let div;
70
+ let span;
71
+ let t0_value = /*textItem*/ ctx[24].distance + "";
72
+ let t0;
73
+ let t1;
74
+ let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
75
+
76
+ return {
77
+ key: key_1,
78
+ first: null,
79
+ c() {
80
+ div = element("div");
81
+ span = element("span");
82
+ t0 = text(t0_value);
83
+ t1 = space();
84
+ attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
85
+ toggle_class(span, "is-row", /*isRow*/ ctx[5]);
86
+ attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
87
+ toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
88
+ toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
89
+ set_style(div, "left", style_left, false);
90
+ this.first = div;
91
+ },
92
+ m(target, anchor) {
93
+ insert(target, div, anchor);
94
+ append(div, span);
95
+ append(span, t0);
96
+ append(div, t1);
97
+ },
98
+ p(new_ctx, dirty) {
99
+ ctx = new_ctx;
100
+ },
101
+ d(detaching) {
102
+ if (detaching) detach(div);
103
+ }
104
+ };
105
+ }
106
+
107
+ function create_fragment(ctx) {
108
+ let div1;
109
+ let div0;
110
+ let t0;
111
+ let each_blocks_1 = [];
112
+ let each0_lookup = new Map();
113
+ let t1;
114
+ let each_blocks = [];
115
+ let each1_lookup = new Map();
116
+ let div1_class_value;
117
+ let each_value_1 = /*positionPxArray*/ ctx[6];
118
+ const get_key = ctx => /*positionIndex*/ ctx[29];
119
+
120
+ for (let i = 0; i < each_value_1.length; i += 1) {
121
+ let child_ctx = get_each_context_1(ctx, each_value_1, i);
122
+ let key = get_key(child_ctx);
123
+ each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
124
+ }
125
+
126
+ let each_value = /*textArray*/ ctx[10];
127
+ const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
128
+
129
+ for (let i = 0; i < each_value.length; i += 1) {
130
+ let child_ctx = get_each_context(ctx, each_value, i);
131
+ let key = get_key_1(child_ctx);
132
+ each1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
133
+ }
134
+
135
+ return {
136
+ c() {
137
+ div1 = element("div");
138
+ div0 = element("div");
139
+ t0 = space();
140
+
141
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
142
+ each_blocks_1[i].c();
143
+ }
144
+
145
+ t1 = space();
146
+
147
+ for (let i = 0; i < each_blocks.length; i += 1) {
148
+ each_blocks[i].c();
149
+ }
150
+
151
+ attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
152
+ attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
153
+ set_style(div1, "width", /*width*/ ctx[9], false);
154
+ set_style(div1, "transform", /*transform*/ ctx[7], false);
155
+ set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
156
+ },
157
+ m(target, anchor) {
158
+ insert(target, div1, anchor);
159
+ append(div1, div0);
160
+ append(div1, t0);
161
+
162
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
163
+ each_blocks_1[i].m(div1, null);
164
+ }
165
+
166
+ append(div1, t1);
167
+
168
+ for (let i = 0; i < each_blocks.length; i += 1) {
169
+ each_blocks[i].m(div1, null);
170
+ }
171
+ },
172
+ p(ctx, [dirty]) {
173
+ if (dirty & /*positionPxArray*/ 64) {
174
+ each_value_1 = /*positionPxArray*/ ctx[6];
175
+ each_blocks_1 = update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, destroy_block, create_each_block_1, t1, get_each_context_1);
176
+ }
177
+
178
+ if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
179
+ each_value = /*textArray*/ ctx[10];
180
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, destroy_block, create_each_block, null, get_each_context);
181
+ }
182
+
183
+ if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
184
+ attr(div1, "class", div1_class_value);
185
+ }
186
+ },
187
+ i: noop,
188
+ o: noop,
189
+ d(detaching) {
190
+ if (detaching) detach(div1);
191
+
192
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
193
+ each_blocks_1[i].d();
194
+ }
195
+
196
+ for (let i = 0; i < each_blocks.length; i += 1) {
197
+ each_blocks[i].d();
198
+ }
199
+ }
200
+ };
201
+ }
202
+
203
+ const padding = 1000;
204
+
205
+ function instance($$self, $$props, $$invalidate) {
206
+ let { pxmm } = $$props;
207
+ let { type } = $$props;
208
+ let { data } = $$props;
209
+ let { bounding } = $$props;
210
+ const isTop = type === 'top';
211
+ const isBottom = type === 'bottom';
212
+ const isLeft = type === 'left';
213
+ const isRight = type === 'right';
214
+ const isRow = isTop || isBottom;
215
+
216
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
217
+ const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
218
+ if (index === 0) return true;
219
+ return x !== arr[index - 1];
220
+ });
221
+
222
+ const minPosition = positionArray[0];
223
+ const maxPosition = positionArray.slice(-1)[0];
224
+ const length = maxPosition - minPosition;
225
+ const minBounding = isRow ? bounding.min.x : bounding.min.y;
226
+ const lengthPx = length * pxmm;
227
+ const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
228
+
229
+ // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
230
+ const translateMain = (minPosition - minBounding) * pxmm;
231
+
232
+ // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
233
+ const translateSecond = 27 - padding * pxmm;
234
+
235
+ const translate = (() => {
236
+ if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
237
+ if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
238
+ if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
239
+ if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
240
+ })();
241
+
242
+ const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
243
+ const transform = `${translate} ${rotate}`;
244
+ const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
245
+ const width = lengthPx + 'px';
246
+
247
+ // 把点位的户型图坐标转成距离起始位置的像素值
248
+ const textArray = positionArray.map((position, index, array) => {
249
+ if (index === 0) return null;
250
+ const distance = position - array[index - 1];
251
+ const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
252
+ return { distance, positionPx };
253
+ }).filter(notNil).filter(item => item.distance / length > 0.12);
254
+
255
+ $$self.$$set = $$props => {
256
+ if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
257
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
258
+ if ('data' in $$props) $$invalidate(12, data = $$props.data);
259
+ if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
260
+ };
261
+
262
+ return [
263
+ type,
264
+ isTop,
265
+ isBottom,
266
+ isLeft,
267
+ isRight,
268
+ isRow,
269
+ positionPxArray,
270
+ transform,
271
+ transformOrigin,
272
+ width,
273
+ textArray,
274
+ pxmm,
275
+ data,
276
+ bounding
277
+ ];
278
+ }
279
+
280
+ class Component extends SvelteComponent {
281
+ constructor(options) {
282
+ super();
283
+
284
+ init(
285
+ this,
286
+ options,
287
+ instance,
288
+ create_fragment,
289
+ safe_not_equal,
290
+ {
291
+ pxmm: 11,
292
+ type: 0,
293
+ data: 12,
294
+ bounding: 13
295
+ },
296
+ add_css
297
+ );
298
+ }
299
+ }
300
+
301
+ export default Component;