@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19

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 (180) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
@@ -1,301 +0,0 @@
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.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-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.svelte-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;