@operato/scene-visualizer 1.2.40 → 1.2.45
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 +18 -0
- package/dist/gltf-object.js +1 -1
- package/dist/gltf-object.js.map +1 -1
- package/dist/rack-table-cell.js +9 -9
- package/dist/rack-table-cell.js.map +1 -1
- package/dist/rack-table.js +9 -9
- package/dist/rack-table.js.map +1 -1
- package/dist/stock.js +8 -8
- package/dist/stock.js.map +1 -1
- package/dist/templates/sprite.js +1 -1
- package/dist/templates/sprite.js.map +1 -1
- package/dist/three-container.js +1 -1
- package/dist/three-container.js.map +1 -1
- package/dist/three-controls.js +2 -2
- package/dist/three-controls.js.map +1 -1
- package/dist/three-space.js +1 -1
- package/dist/three-space.js.map +1 -1
- package/icons/light.png +0 -0
- package/icons/sprite.png +0 -0
- package/package.json +2 -2
- package/src/gltf-object.ts +1 -1
- package/src/rack-table-cell.ts +9 -9
- package/src/rack-table.ts +12 -12
- package/src/stock.ts +8 -8
- package/src/templates/sprite.ts +1 -1
- package/src/three-container.ts +1 -1
- package/src/three-controls.ts +2 -2
- package/src/three-space.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-visualizer",
|
|
3
3
|
"description": "visualizer component for operato-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.45",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"license": "MIT",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"prettier --write"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "131e93569c5da183050eb855d67b72580414d370"
|
|
66
66
|
}
|
package/src/gltf-object.ts
CHANGED
package/src/rack-table-cell.ts
CHANGED
|
@@ -125,7 +125,7 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
get colspan() {
|
|
128
|
-
return this.
|
|
128
|
+
return this.getState('colspan')
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
get border() {
|
|
@@ -133,7 +133,7 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
get isEmpty() {
|
|
136
|
-
return this.
|
|
136
|
+
return this.getState('isEmpty')
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
_drawBorder(context: CanvasRenderingContext2D, x: number, y: number, to_x: number, to_y: number, style: any) {
|
|
@@ -203,11 +203,11 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
203
203
|
locPattern = locPattern.substring(0, locPattern.indexOf('{u}') + 3)
|
|
204
204
|
|
|
205
205
|
var locationString = ''
|
|
206
|
-
if (this.
|
|
206
|
+
if (this.getState('section') && this.getState('unit'))
|
|
207
207
|
locationString = locPattern
|
|
208
208
|
.replace('{z}', zone)
|
|
209
|
-
.replace('{s}', this.
|
|
210
|
-
.replace('{u}', this.
|
|
209
|
+
.replace('{s}', this.getState('section'))
|
|
210
|
+
.replace('{u}', this.getState('unit'))
|
|
211
211
|
|
|
212
212
|
return locationString || ''
|
|
213
213
|
}
|
|
@@ -316,7 +316,7 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
316
316
|
for (let i = rowCells.length - 1; i > 0; i--) {
|
|
317
317
|
var cell = rowCells[i]
|
|
318
318
|
|
|
319
|
-
var unit = cell.
|
|
319
|
+
var unit = cell.getState('unit')
|
|
320
320
|
|
|
321
321
|
if (unit) return Number(unit)
|
|
322
322
|
}
|
|
@@ -330,7 +330,7 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
330
330
|
for (let i = 0; i < rowCells.length; i++) {
|
|
331
331
|
var cell = rowCells[i]
|
|
332
332
|
|
|
333
|
-
var unit = cell.
|
|
333
|
+
var unit = cell.getState('unit')
|
|
334
334
|
|
|
335
335
|
if (unit) return Number(unit)
|
|
336
336
|
}
|
|
@@ -340,13 +340,13 @@ export class RackTableCell extends RectPath(Component) {
|
|
|
340
340
|
|
|
341
341
|
get notEmptyRowCells() {
|
|
342
342
|
return this.rowCells.filter((c: Component) => {
|
|
343
|
-
return !c.
|
|
343
|
+
return !c.getState('isEmpty')
|
|
344
344
|
})
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
get emptyRowCells() {
|
|
348
348
|
return this.rowCells.filter((c: Component) => {
|
|
349
|
-
return c.
|
|
349
|
+
return c.getState('isEmpty')
|
|
350
350
|
})
|
|
351
351
|
}
|
|
352
352
|
|
package/src/rack-table.ts
CHANGED
|
@@ -161,7 +161,7 @@ function setCellBorder(cell: RackTableCell, style: any, where: SIDE_KEY) {
|
|
|
161
161
|
return
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
cell.set('border', Object.assign({}, cell.
|
|
164
|
+
cell.set('border', Object.assign({}, cell.getState('border') || {}, buildBorderStyle(style, where)))
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
function isLeftMost(total: number, columns: number, indices: number[], i: number) {
|
|
@@ -425,8 +425,8 @@ export class RackTable extends ContainerAbstract {
|
|
|
425
425
|
this.add(newbies)
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
var widths = this.
|
|
429
|
-
var heights = this.
|
|
428
|
+
var widths = this.getState('widths')
|
|
429
|
+
var heights = this.getState('heights')
|
|
430
430
|
|
|
431
431
|
if (!widths || widths.length < this.columns) this.set('widths', this.widths)
|
|
432
432
|
if (!heights || heights.length < this.rows) this.set('heights', this.heights)
|
|
@@ -438,7 +438,7 @@ export class RackTable extends ContainerAbstract {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
get widths(): number[] {
|
|
441
|
-
var widths = this.
|
|
441
|
+
var widths = this.getState('widths')
|
|
442
442
|
|
|
443
443
|
if (!widths) return array(1, this.columns)
|
|
444
444
|
|
|
@@ -449,7 +449,7 @@ export class RackTable extends ContainerAbstract {
|
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
get heights(): number[] {
|
|
452
|
-
var heights = this.
|
|
452
|
+
var heights = this.getState('heights')
|
|
453
453
|
|
|
454
454
|
if (!heights) return array(1, this.rows)
|
|
455
455
|
|
|
@@ -506,13 +506,13 @@ export class RackTable extends ContainerAbstract {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
get rows() {
|
|
509
|
-
return this.
|
|
509
|
+
return this.getState('rows')
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
setCellsStyle(cells: RackTableCell[], style: any, where: string) {
|
|
513
513
|
var components = this.components
|
|
514
514
|
var total = components.length
|
|
515
|
-
var columns = this.
|
|
515
|
+
var columns = this.getState('columns')
|
|
516
516
|
|
|
517
517
|
// 병합된 셀도 포함시킨다.
|
|
518
518
|
var _cells = [] as RackTableCell[]
|
|
@@ -1174,7 +1174,7 @@ export class RackTable extends ContainerAbstract {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
1176
|
get columns() {
|
|
1177
|
-
return this.
|
|
1177
|
+
return this.getState('columns')
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
1180
|
get lefts() {
|
|
@@ -1262,10 +1262,10 @@ export class RackTable extends ContainerAbstract {
|
|
|
1262
1262
|
onchange(after: Properties, before: Properties) {
|
|
1263
1263
|
if ('rows' in after || 'columns' in after) {
|
|
1264
1264
|
this.buildCells(
|
|
1265
|
-
this.
|
|
1266
|
-
this.
|
|
1267
|
-
before.hasOwnProperty('rows') ? before.rows : this.
|
|
1268
|
-
before.hasOwnProperty('columns') ? before.columns : this.
|
|
1265
|
+
this.getState('rows'),
|
|
1266
|
+
this.getState('columns'),
|
|
1267
|
+
before.hasOwnProperty('rows') ? before.rows : this.getState('rows'),
|
|
1268
|
+
before.hasOwnProperty('columns') ? before.columns : this.getState('columns')
|
|
1269
1269
|
)
|
|
1270
1270
|
}
|
|
1271
1271
|
|
package/src/stock.ts
CHANGED
|
@@ -35,10 +35,10 @@ export class Stock extends RealObject<THREE.Mesh> {
|
|
|
35
35
|
getMaterial(index: number) {
|
|
36
36
|
var visualizer = this.visualizer
|
|
37
37
|
|
|
38
|
-
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.
|
|
38
|
+
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.getState('status')))
|
|
39
39
|
return this.userDefineDefaultMaterial
|
|
40
40
|
|
|
41
|
-
var stockStatus = visualizer.legendTarget.
|
|
41
|
+
var stockStatus = visualizer.legendTarget.getState('status')
|
|
42
42
|
var range = stockStatus.ranges[index]
|
|
43
43
|
if (!(range && range.color)) {
|
|
44
44
|
this.stockMaterials[index] = this.userDefineDefaultMaterial
|
|
@@ -80,10 +80,10 @@ export class Stock extends RealObject<THREE.Mesh> {
|
|
|
80
80
|
var visualizer = this.visualizer
|
|
81
81
|
|
|
82
82
|
if (!visualizer!._default_material) {
|
|
83
|
-
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.
|
|
83
|
+
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.getState('status')))
|
|
84
84
|
return Stock.defaultMaterial
|
|
85
85
|
|
|
86
|
-
var stockStatus = visualizer!.legendTarget.
|
|
86
|
+
var stockStatus = visualizer!.legendTarget.getState('status')
|
|
87
87
|
var defaultColor = stockStatus.defaultColor
|
|
88
88
|
|
|
89
89
|
if (!defaultColor) return Stock.defaultMaterial
|
|
@@ -107,8 +107,8 @@ export class Stock extends RealObject<THREE.Mesh> {
|
|
|
107
107
|
|
|
108
108
|
var defaultColor = STOCK_COLOR
|
|
109
109
|
if (!visualizer!._empty_material) {
|
|
110
|
-
if (visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.
|
|
111
|
-
var stockStatus = visualizer!.legendTarget.
|
|
110
|
+
if (visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.getState('status')) {
|
|
111
|
+
var stockStatus = visualizer!.legendTarget.getState('status')
|
|
112
112
|
defaultColor = stockStatus.defaultColor || STOCK_COLOR
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -160,9 +160,9 @@ export class Stock extends RealObject<THREE.Mesh> {
|
|
|
160
160
|
}
|
|
161
161
|
var visualizer = this.visualizer
|
|
162
162
|
|
|
163
|
-
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.
|
|
163
|
+
if (!(visualizer && visualizer && visualizer!.legendTarget && visualizer!.legendTarget.getState('status'))) return
|
|
164
164
|
|
|
165
|
-
var stockStatus = visualizer!.legendTarget.
|
|
165
|
+
var stockStatus = visualizer!.legendTarget.getState('status') as {
|
|
166
166
|
field: string
|
|
167
167
|
ranges: { min: number; max: number }[]
|
|
168
168
|
}
|
package/src/templates/sprite.ts
CHANGED
package/src/three-container.ts
CHANGED
|
@@ -624,7 +624,7 @@ export class ThreeContainer extends Container implements ThreeDimensionalContain
|
|
|
624
624
|
|
|
625
625
|
ondblclick(e: MouseEvent) {
|
|
626
626
|
if (this._controls) {
|
|
627
|
-
this.setState('zoom', this.
|
|
627
|
+
this.setState('zoom', this.getState('zoom'))
|
|
628
628
|
this._controls.reset()
|
|
629
629
|
e.stopPropagation()
|
|
630
630
|
}
|
package/src/three-controls.ts
CHANGED
|
@@ -540,10 +540,10 @@ var ThreeControls = function (this: any, object: THREE.Camera, component: Compon
|
|
|
540
540
|
var element = scope.component
|
|
541
541
|
|
|
542
542
|
// rotating across whole screen goes 360 degrees around
|
|
543
|
-
rotateLeft(((2 * Math.PI * rotateDelta.x) / element.
|
|
543
|
+
rotateLeft(((2 * Math.PI * rotateDelta.x) / element.getState('width')) * scope.rotateSpeed)
|
|
544
544
|
|
|
545
545
|
// rotating up and down along whole screen attempts to go 360, but limited to 180
|
|
546
|
-
rotateUp(((2 * Math.PI * rotateDelta.y) / element.
|
|
546
|
+
rotateUp(((2 * Math.PI * rotateDelta.y) / element.getState('height')) * scope.rotateSpeed)
|
|
547
547
|
|
|
548
548
|
rotateStart.copy(rotateEnd)
|
|
549
549
|
|
package/src/three-space.ts
CHANGED
|
@@ -633,7 +633,7 @@ export class ThreeSpace extends Container implements ThreeDimensionalContainer {
|
|
|
633
633
|
|
|
634
634
|
ondblclick(e: MouseEvent) {
|
|
635
635
|
if (this._controls) {
|
|
636
|
-
this.setState('zoom', this.
|
|
636
|
+
this.setState('zoom', this.getState('zoom'))
|
|
637
637
|
this._controls.reset()
|
|
638
638
|
e.stopPropagation()
|
|
639
639
|
}
|