@hatiolab/things-scene 8.0.0-alpha.3 → 8.0.0-alpha.5

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/db.sqlite CHANGED
Binary file
@@ -23,13 +23,17 @@
23
23
  border: 1px solid #000;
24
24
  border-radius: 4px;
25
25
  width: 100%;
26
+ max-width: 100%;
27
+ max-height: 200px;
26
28
  box-sizing: border-box;
27
29
  }
28
30
 
29
31
  table {
32
+ flex: 1;
30
33
  width: 100%;
31
34
  border-collapse: collapse;
32
35
  margin-top: 20px;
36
+ overflow: auto;
33
37
  }
34
38
 
35
39
  th,
@@ -53,17 +57,12 @@
53
57
  <!-- sceneResidents 데이터를 보여줄 테이블 -->
54
58
  <h2>Scene Residents Data</h2>
55
59
  <table id="residentsTable">
56
- <thead>
57
- <tr>
58
- <th>Type</th>
59
- <th>Up</th>
60
- <th>Down</th>
61
- <th>Difference (Up - Down)</th>
62
- </tr>
63
- </thead>
64
- <tbody>
65
- <!-- 데이터가 동적으로 추가됩니다 -->
66
- </tbody>
60
+ <tr>
61
+ <th>Type</th>
62
+ <th>Up</th>
63
+ <th>Down</th>
64
+ <th>Difference (Up - Down)</th>
65
+ </tr>
67
66
  </table>
68
67
  </body>
69
68
  </html>
@@ -1,5 +1,5 @@
1
1
  chrome.devtools.panels.create('Scene', 'icons/icon48.png', 'devtools.html', function (panel) {
2
- var residentChart1, residentChart2, residentChart3
2
+ var residentChart1, residentChart2, residentChart3, residentsTable
3
3
  var listenerRegistered = false
4
4
  var chartsInitialized = false
5
5
 
@@ -22,12 +22,11 @@ chrome.devtools.panels.create('Scene', 'icons/icon48.png', 'devtools.html', func
22
22
 
23
23
  // sceneResidents 테이블 업데이트 함수
24
24
  const updateResidentsTable = sceneResidents => {
25
- console.log('updateResidentesTable', sceneResidents)
26
25
  if (typeof sceneResidents !== 'object') {
27
26
  return
28
27
  }
29
28
 
30
- const table = document.getElementById('residentsTable')
29
+ const table = residentsTable
31
30
  table.innerHTML = '' // 기존 테이블 내용을 지움
32
31
 
33
32
  // 테이블 헤더 생성
@@ -37,12 +36,12 @@ chrome.devtools.panels.create('Scene', 'icons/icon48.png', 'devtools.html', func
37
36
 
38
37
  // sceneResidents 데이터로 테이블 행 생성
39
38
  for (const [type, residents] of Object.entries(sceneResidents)) {
40
- residents.forEach(({ up, down }) => {
41
- const row = document.createElement('tr')
42
- const difference = up - down
43
- row.innerHTML = `<td>${type}</td><td>${up}</td><td>${down}</td><td>${difference}</td>`
44
- table.appendChild(row)
45
- })
39
+ const { up, down } = residents
40
+ const row = document.createElement('tr')
41
+ const difference = up - down
42
+ row.innerHTML = `<td>${type}</td><td>${up}</td><td>${down}</td><td>${difference}</td>`
43
+
44
+ table.appendChild(row)
46
45
  }
47
46
  }
48
47
 
@@ -64,6 +63,7 @@ chrome.devtools.panels.create('Scene', 'icons/icon48.png', 'devtools.html', func
64
63
  ]
65
64
  },
66
65
  options: {
66
+ responsive: true,
67
67
  animation: false, // 애니메이션 비활성화
68
68
  scales: {
69
69
  x: {
@@ -103,6 +103,8 @@ chrome.devtools.panels.create('Scene', 'icons/icon48.png', 'devtools.html', func
103
103
  residentChart2 = createChart(ctx2, 'Scene Residents Count')
104
104
  residentChart3 = createChart(ctx3, 'ReferenceMap Residents Count')
105
105
 
106
+ residentsTable = window.document.getElementById('residentsTable')
107
+
106
108
  chartsInitialized = true
107
109
  }
108
110
 
@@ -1,7 +1,7 @@
1
1
  function logComponentResidents() {
2
2
  const componentResidentsCount = window.scene.Component?.residentsCount || 0
3
+ const sceneResidents = window.scene.Component?.residents || {}
3
4
  const sceneResidentsCount = window.scene.Scene?.residentsCount || 0
4
- const sceneResidents = window.scene.Scene?.residents || {}
5
5
  const referenceMapResidentsCount = window.scene.ReferenceMap?.residentsCount || 0
6
6
  const timestamp = new Date().toISOString()
7
7
 
@@ -24,13 +24,16 @@
24
24
  border: 1px solid #000;
25
25
  border-radius: 4px;
26
26
  width: 100%;
27
+ max-height: 200px;
27
28
  box-sizing: border-box;
28
29
  }
29
30
 
30
31
  table {
32
+ flex: 1;
31
33
  width: 100%;
32
34
  border-collapse: collapse;
33
35
  margin-top: 20px;
36
+ overflow: auto;
34
37
  }
35
38
 
36
39
  th,
@@ -54,17 +57,12 @@
54
57
  <!-- sceneResidents 데이터를 보여줄 테이블 -->
55
58
  <h2>Scene Residents Data</h2>
56
59
  <table id="residentsTable">
57
- <thead>
58
- <tr>
59
- <th>Type</th>
60
- <th>Up</th>
61
- <th>Down</th>
62
- <th>Difference (Up - Down)</th>
63
- </tr>
64
- </thead>
65
- <tbody>
66
- <!-- 데이터가 동적으로 추가됩니다 -->
67
- </tbody>
60
+ <tr>
61
+ <th>Type</th>
62
+ <th>Up</th>
63
+ <th>Down</th>
64
+ <th>Difference (Up - Down)</th>
65
+ </tr>
68
66
  </table>
69
67
  </body>
70
68
  </html>
@@ -1,5 +1,5 @@
1
1
  document.addEventListener('DOMContentLoaded', () => {
2
- let residentChart1, residentChart2, residentChart3
2
+ let residentChart1, residentChart2, residentChart3, residentsTable
3
3
  let chartsInitialized = false
4
4
  let listenerRegistered = false
5
5
 
@@ -29,6 +29,7 @@ document.addEventListener('DOMContentLoaded', () => {
29
29
  ]
30
30
  },
31
31
  options: {
32
+ responsive: true,
32
33
  animation: false, // 애니메이션 비활성화
33
34
  scales: {
34
35
  x: {
@@ -70,6 +71,8 @@ document.addEventListener('DOMContentLoaded', () => {
70
71
  residentChart2 = createChart(ctx2, 'Scene Residents Count')
71
72
  residentChart3 = createChart(ctx3, 'ReferenceMap Residents Count')
72
73
 
74
+ residentsTable = window.document.getElementById('residentsTable')
75
+
73
76
  chartsInitialized = true // 차트가 초기화되었음을 표시
74
77
  }
75
78
 
@@ -92,7 +95,11 @@ document.addEventListener('DOMContentLoaded', () => {
92
95
 
93
96
  // sceneResidents 테이블 업데이트 함수
94
97
  const updateResidentsTable = sceneResidents => {
95
- const table = document.getElementById('residentsTable')
98
+ if (typeof sceneResidents !== 'object') {
99
+ return
100
+ }
101
+
102
+ const table = residentsTable
96
103
  table.innerHTML = '' // 기존 테이블 내용을 지움
97
104
 
98
105
  // 테이블 헤더 생성
@@ -102,12 +109,12 @@ document.addEventListener('DOMContentLoaded', () => {
102
109
 
103
110
  // sceneResidents 데이터로 테이블 행 생성
104
111
  for (const [type, residents] of Object.entries(sceneResidents)) {
105
- residents.forEach(({ up, down }) => {
106
- const row = document.createElement('tr')
107
- const difference = up - down
108
- row.innerHTML = `<td>${type}</td><td>${up}</td><td>${down}</td><td>${difference}</td>`
109
- table.appendChild(row)
110
- })
112
+ const { up, down } = residents
113
+ const row = document.createElement('tr')
114
+ const difference = up - down
115
+ row.innerHTML = `<td>${type}</td><td>${up}</td><td>${down}</td><td>${difference}</td>`
116
+
117
+ table.appendChild(row)
111
118
  }
112
119
  }
113
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatiolab/things-scene",
3
- "version": "8.0.0-alpha.3",
3
+ "version": "8.0.0-alpha.5",
4
4
  "description": "2D graphic library",
5
5
  "main": "src/index.js",
6
6
  "module": "things-scene.mjs",