@geode/opengeodeweb-front 10.3.0 → 10.3.1

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 (178) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/app/assets/geode_objects.js +1 -3
  3. package/app/components/Carousel.vue +7 -4
  4. package/app/components/CrsSelector.vue +5 -6
  5. package/app/components/DragAndDrop.vue +18 -8
  6. package/app/components/ExtensionSelector.vue +9 -17
  7. package/app/components/FeedBack/ErrorBanner.vue +1 -1
  8. package/app/components/FeedBack/Snackers.vue +4 -1
  9. package/app/components/FileSelector.vue +21 -10
  10. package/app/components/FileUploader.vue +15 -32
  11. package/app/components/HybridRenderingView.vue +5 -3
  12. package/app/components/Inspector/InspectionButton.vue +2 -2
  13. package/app/components/Inspector/ResultPanel.vue +4 -4
  14. package/app/components/Launcher.vue +1 -1
  15. package/app/components/Loading.vue +6 -6
  16. package/app/components/MissingFilesSelector.vue +23 -29
  17. package/app/components/ObjectSelector.vue +11 -10
  18. package/app/components/OptionCard.vue +1 -1
  19. package/app/components/PackagesVersions.vue +5 -3
  20. package/app/components/Recaptcha.vue +6 -4
  21. package/app/components/RemoteRenderingView.vue +4 -3
  22. package/app/components/Screenshot.vue +4 -4
  23. package/app/components/Step.vue +7 -7
  24. package/app/components/VeaseViewToolbar.vue +3 -3
  25. package/app/components/Viewer/BreadCrumb.vue +2 -4
  26. package/app/components/Viewer/ContextMenu.vue +77 -45
  27. package/app/components/Viewer/ContextMenuItem.vue +42 -33
  28. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +3 -3
  29. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +5 -5
  30. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -6
  31. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +5 -5
  32. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -5
  33. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -7
  34. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
  35. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -3
  36. package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
  37. package/app/components/Viewer/Grid/2D/CellsOptions.vue +3 -3
  38. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +3 -3
  39. package/app/components/Viewer/Grid/2D/PointsOptions.vue +3 -3
  40. package/app/components/Viewer/Grid/3D/CellsOptions.vue +3 -3
  41. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +3 -3
  42. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +3 -3
  43. package/app/components/Viewer/Grid/3D/PointsOptions.vue +3 -3
  44. package/app/components/Viewer/HybridSolid/EdgesOptions.vue +3 -3
  45. package/app/components/Viewer/HybridSolid/PointsOptions.vue +3 -3
  46. package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +3 -3
  47. package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +3 -3
  48. package/app/components/Viewer/Options/CellAttributeSelector.vue +23 -20
  49. package/app/components/Viewer/Options/ColorMapList.vue +75 -50
  50. package/app/components/Viewer/Options/ColorMapPicker.vue +38 -32
  51. package/app/components/Viewer/Options/ColorPicker.vue +3 -3
  52. package/app/components/Viewer/Options/ColoringTypeSelector.vue +29 -21
  53. package/app/components/Viewer/Options/EdgeAttributeSelector.vue +7 -7
  54. package/app/components/Viewer/Options/PolygonAttributeSelector.vue +7 -7
  55. package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +7 -7
  56. package/app/components/Viewer/Options/TextureItem.vue +5 -5
  57. package/app/components/Viewer/Options/TexturesSelector.vue +5 -5
  58. package/app/components/Viewer/Options/VertexAttributeSelector.vue +7 -7
  59. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +5 -5
  60. package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +3 -3
  61. package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +3 -3
  62. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +6 -6
  63. package/app/components/Viewer/Solid/EdgesOptions.vue +3 -3
  64. package/app/components/Viewer/Solid/PointsOptions.vue +3 -3
  65. package/app/components/Viewer/Solid/PolygonsOptions.vue +3 -3
  66. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +6 -6
  67. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +3 -3
  68. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +3 -3
  69. package/app/components/Viewer/Tree/ObjectTree.vue +7 -9
  70. package/app/components/Viewer/TreeComponent.vue +9 -13
  71. package/app/components/Viewer/TreeObject.vue +8 -9
  72. package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +3 -3
  73. package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +3 -3
  74. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +3 -3
  75. package/app/components/Wrapper.vue +1 -2
  76. package/app/components/ZScaling.vue +1 -1
  77. package/app/composables/project_manager.js +6 -6
  78. package/app/plugins/auto_store_register.js +1 -1
  79. package/app/stores/app.js +45 -41
  80. package/app/stores/data.js +52 -51
  81. package/app/stores/data_style.js +12 -11
  82. package/app/stores/feedback.js +5 -1
  83. package/app/stores/geode.js +16 -13
  84. package/app/stores/hybrid_viewer.js +72 -44
  85. package/app/stores/infra.js +18 -16
  86. package/app/stores/lambda.js +1 -9
  87. package/app/stores/menu.js +13 -13
  88. package/app/stores/treeview.js +15 -13
  89. package/app/stores/viewer.js +39 -33
  90. package/app/utils/app_mode.js +4 -3
  91. package/app/utils/default_styles.js +55 -47
  92. package/app/utils/file_import_workflow.js +4 -17
  93. package/app/utils/local.js +195 -184
  94. package/app/utils/upload_file.js +1 -2
  95. package/eslint.config.js +2 -2
  96. package/internal/database/database.js +17 -32
  97. package/internal/database/extended_database.js +25 -0
  98. package/internal/stores/data_style/mesh/cells/cell.js +3 -3
  99. package/internal/stores/data_style/mesh/cells/color.js +1 -1
  100. package/internal/stores/data_style/mesh/cells/index.js +7 -7
  101. package/internal/stores/data_style/mesh/cells/textures.js +1 -1
  102. package/internal/stores/data_style/mesh/cells/vertex.js +3 -3
  103. package/internal/stores/data_style/mesh/cells/visibility.js +1 -1
  104. package/internal/stores/data_style/mesh/edges/color.js +1 -1
  105. package/internal/stores/data_style/mesh/edges/edge.js +22 -22
  106. package/internal/stores/data_style/mesh/edges/index.js +7 -7
  107. package/internal/stores/data_style/mesh/edges/vertex.js +3 -3
  108. package/internal/stores/data_style/mesh/edges/visibility.js +1 -1
  109. package/internal/stores/data_style/mesh/edges/width.js +1 -1
  110. package/internal/stores/data_style/mesh/index.js +4 -5
  111. package/internal/stores/data_style/mesh/points/color.js +1 -1
  112. package/internal/stores/data_style/mesh/points/index.js +6 -6
  113. package/internal/stores/data_style/mesh/points/size.js +1 -1
  114. package/internal/stores/data_style/mesh/points/vertex.js +3 -3
  115. package/internal/stores/data_style/mesh/points/visibility.js +1 -1
  116. package/internal/stores/data_style/mesh/polygons/color.js +1 -1
  117. package/internal/stores/data_style/mesh/polygons/index.js +7 -7
  118. package/internal/stores/data_style/mesh/polygons/polygon.js +3 -3
  119. package/internal/stores/data_style/mesh/polygons/textures.js +1 -1
  120. package/internal/stores/data_style/mesh/polygons/vertex.js +3 -3
  121. package/internal/stores/data_style/mesh/polygons/visibility.js +1 -1
  122. package/internal/stores/data_style/mesh/polyhedra/color.js +1 -1
  123. package/internal/stores/data_style/mesh/polyhedra/index.js +6 -6
  124. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +3 -3
  125. package/internal/stores/data_style/mesh/polyhedra/vertex.js +3 -3
  126. package/internal/stores/data_style/mesh/polyhedra/visibility.js +1 -1
  127. package/internal/stores/data_style/model/edges.js +1 -1
  128. package/internal/stores/data_style/model/index.js +32 -22
  129. package/internal/utils/api_fetch.js +8 -5
  130. package/internal/utils/viewer_call.js +42 -46
  131. package/nuxt.config.js +3 -3
  132. package/package.json +1 -1
  133. package/scripts/generate_geode_objects.js +8 -7
  134. package/tests/integration/setup.js +28 -21
  135. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -10
  136. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +18 -10
  137. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +9 -5
  138. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +17 -10
  139. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +18 -10
  140. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +18 -10
  141. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +10 -6
  142. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +10 -6
  143. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +9 -5
  144. package/tests/integration/stores/data_style/model/index.nuxt.test.js +9 -5
  145. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +10 -6
  146. package/tests/integration/stores/data_style/model/points.nuxt.test.js +9 -5
  147. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +10 -6
  148. package/tests/integration/stores/viewer.nuxt.test.js +55 -39
  149. package/tests/setup_indexeddb.js +1 -0
  150. package/tests/unit/components/CrsSelector.nuxt.test.js +18 -19
  151. package/tests/unit/components/ExtensionSelector.nuxt.test.js +24 -19
  152. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -36
  153. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +20 -25
  154. package/tests/unit/components/FileSelector.nuxt.test.js +27 -27
  155. package/tests/unit/components/FileUploader.nuxt.test.js +18 -17
  156. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +9 -16
  157. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +8 -6
  158. package/tests/unit/components/Launcher.nuxt.test.js +12 -17
  159. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +16 -19
  160. package/tests/unit/components/ObjectSelector.nuxt.test.js +30 -34
  161. package/tests/unit/components/PackagesVersions.nuxt.test.js +8 -11
  162. package/tests/unit/components/Step.nuxt.test.js +8 -7
  163. package/tests/unit/components/Stepper.nuxt.test.js +14 -12
  164. package/tests/unit/composables/ProjectManager.nuxt.test.js +142 -100
  165. package/tests/unit/composables/api_fetch.nuxt.test.js +12 -39
  166. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -61
  167. package/tests/unit/composables/upload_file.nuxt.test.js +21 -25
  168. package/tests/unit/plugins/project_load.nuxt.test.js +22 -21
  169. package/tests/unit/stores/App.nuxt.test.js +45 -43
  170. package/tests/unit/stores/Feedback.nuxt.test.js +16 -18
  171. package/tests/unit/stores/Geode.nuxt.test.js +135 -137
  172. package/tests/unit/stores/Infra.nuxt.test.js +20 -26
  173. package/tests/unit/stores/Lambda.nuxt.test.js +30 -31
  174. package/tests/unit/stores/Treeview.nuxt.test.js +53 -55
  175. package/tests/unit/stores/Viewer.nuxt.test.js +16 -23
  176. package/tests/unit/utils/validate_schema.nuxt.test.js +18 -18
  177. package/tests/utils.js +15 -2
  178. package/tests/vitest.config.js +6 -2
@@ -1,8 +1,12 @@
1
1
  <script setup>
2
2
  import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
3
- import vtkColorTransferFunction from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
3
+ import { newInstance as vtkColorTransferFunction } from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
4
4
 
5
- const props = defineProps({
5
+ const LAST_POINT_OFFSET = 4
6
+ const THREE = 3
7
+ const CHUNK_SIZE = 5
8
+
9
+ const { presets } = defineProps({
6
10
  presets: { type: Array, required: true },
7
11
  })
8
12
 
@@ -11,92 +15,113 @@
11
15
  const filterText = ref("")
12
16
  const canvasRefs = ref({})
13
17
  const loading = ref(true)
14
- let renderJobId = 0
18
+ const renderJobId = ref(0)
15
19
 
16
- const setCanvasRef = (presetName, el, id) => {
17
- if (el) {
18
- canvasRefs.value[id] = { el, presetName }
20
+ function setCanvasRef(presetName, element, id) {
21
+ if (element) {
22
+ canvasRefs.value[id] = { element, presetName }
19
23
  } else {
20
24
  delete canvasRefs.value[id]
21
25
  }
22
26
  }
23
27
 
24
28
  const filteredPresets = computed(() => {
25
- if (!filterText.value) return props.presets
29
+ if (!filterText.value) {
30
+ return presets
31
+ }
26
32
  const term = filterText.value.toLowerCase()
27
33
 
28
- return props.presets.reduce((acc, item) => {
34
+ const result = []
35
+ for (const item of presets) {
29
36
  if (item.Children) {
30
- const children = item.Children.filter((c) =>
31
- c.Name.toLowerCase().includes(term),
37
+ const children = item.Children.filter((child) =>
38
+ child.Name.toLowerCase().includes(term),
32
39
  )
33
- if (children.length) acc.push({ ...item, Children: children })
40
+ if (children.length > 0) {
41
+ result.push({ ...item, Children: children })
42
+ }
34
43
  } else if (item.Name.toLowerCase().includes(term)) {
35
- acc.push(item)
44
+ result.push(item)
36
45
  }
37
- return acc
38
- }, [])
46
+ }
47
+ return result
39
48
  })
40
49
 
41
50
  function drawPresetCanvas(presetName, canvas) {
42
- if (!canvas) return
51
+ if (!canvas) {
52
+ return
53
+ }
43
54
  const preset = vtkColorMaps.getPresetByName(presetName)
44
- if (!preset || !preset.RGBPoints) return
55
+ if (!preset || !preset.RGBPoints) {
56
+ return
57
+ }
45
58
 
46
59
  const ctx = canvas.getContext("2d")
47
- const { width, height } = canvas
48
- const lut = vtkColorTransferFunction.newInstance()
60
+ const { height, width } = canvas
61
+ const lut = vtkColorTransferFunction()
49
62
  const rgbPoints = preset.RGBPoints
50
63
 
51
- for (let i = 0; i < rgbPoints.length; i += 4) {
64
+ for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
52
65
  lut.addRGBPoint(
53
- rgbPoints[i],
54
- rgbPoints[i + 1],
55
- rgbPoints[i + 2],
56
- rgbPoints[i + 3],
66
+ rgbPoints[pointIdx],
67
+ rgbPoints[pointIdx + 1],
68
+ rgbPoints[pointIdx + 2],
69
+ rgbPoints[pointIdx + THREE],
57
70
  )
58
71
  }
59
72
 
60
73
  const table = lut.getUint8Table(
61
74
  rgbPoints[0],
62
- rgbPoints[rgbPoints.length - 4],
75
+ rgbPoints.at(-LAST_POINT_OFFSET),
63
76
  width,
64
77
  true,
65
78
  )
66
79
  const imageData = ctx.createImageData(width, height)
67
80
 
68
- for (let x = 0; x < width; x++) {
69
- const r = table[x * 4],
70
- g = table[x * 4 + 1],
71
- b = table[x * 4 + 2],
72
- a = table[x * 4 + 3]
73
- for (let y = 0; y < height; y++) {
74
- const idx = (y * width + x) * 4
75
- imageData.data[idx] = r
76
- imageData.data[idx + 1] = g
77
- imageData.data[idx + 2] = b
78
- imageData.data[idx + 3] = a
81
+ for (let xCoord = 0; xCoord < width; xCoord += 1) {
82
+ const alpha = table[xCoord * 4 + THREE],
83
+ blue = table[xCoord * 4 + 2],
84
+ green = table[xCoord * 4 + 1],
85
+ red = table[xCoord * 4]
86
+ for (let yCoord = 0; yCoord < height; yCoord += 1) {
87
+ const pixelIdx = (yCoord * width + xCoord) * 4
88
+ imageData.data[pixelIdx] = red
89
+ imageData.data[pixelIdx + 1] = green
90
+ imageData.data[pixelIdx + 2] = blue
91
+ imageData.data[pixelIdx + THREE] = alpha
79
92
  }
80
93
  }
81
94
  ctx.putImageData(imageData, 0, 0)
82
95
  }
83
96
 
84
- async function drawAllCanvases() {
85
- renderJobId++
86
- const currentJobId = renderJobId
87
- loading.value = true
88
- await nextTick()
89
- await new Promise((r) => setTimeout(r, 50))
90
-
91
- const entries = Object.entries(canvasRefs.value)
92
- for (let i = 0; i < entries.length; i += 5) {
93
- if (currentJobId !== renderJobId) return
94
- entries
95
- .slice(i, i + 5)
96
- .forEach(([_, { presetName, el }]) => drawPresetCanvas(presetName, el))
97
- await new Promise((r) => setTimeout(r, 0))
97
+ function processChunk(entries, index, jobId) {
98
+ if (jobId !== renderJobId.value || index >= entries.length) {
99
+ if (jobId === renderJobId.value) {
100
+ loading.value = false
101
+ }
102
+ return
98
103
  }
99
- if (currentJobId === renderJobId) loading.value = false
104
+
105
+ const end = Math.min(index + CHUNK_SIZE, entries.length)
106
+ for (let i = index; i < end; i += 1) {
107
+ const [unusedKey, refValue] = entries[i]
108
+ drawPresetCanvas(refValue.presetName, refValue.element)
109
+ }
110
+ const ZERO = 0
111
+ setTimeout(() => processChunk(entries, end, jobId), ZERO)
112
+ }
113
+
114
+ function drawAllCanvases() {
115
+ renderJobId.value += 1
116
+ const jobId = renderJobId.value
117
+ loading.value = true
118
+ nextTick(() => {
119
+ const WAIT_MS = 50
120
+ setTimeout(
121
+ () => processChunk(Object.entries(canvasRefs.value), 0, jobId),
122
+ WAIT_MS,
123
+ )
124
+ })
100
125
  }
101
126
 
102
127
  onMounted(drawAllCanvases)
@@ -1,9 +1,12 @@
1
1
  <script setup>
2
- import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
3
- import vtkColorTransferFunction from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
4
2
  import ColorMapList from "./ColorMapList.vue"
3
+ import { newInstance } from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
4
+ import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
5
5
 
6
- const props = defineProps({
6
+ const LAST_POINT_OFFSET = 4
7
+ const THREE = 3
8
+
9
+ const { max, min, modelValue } = defineProps({
7
10
  modelValue: { type: String, default: "Cool to Warm" },
8
11
  min: { type: Number, required: true },
9
12
  max: { type: Number, required: true },
@@ -12,8 +15,8 @@
12
15
  const emit = defineEmits(["update:modelValue"])
13
16
 
14
17
  const menuOpen = ref(false)
15
- const lutCanvas = ref(null)
16
- const selectedPresetName = ref(props.modelValue)
18
+ const lutCanvas = ref()
19
+ const selectedPresetName = ref(modelValue)
17
20
 
18
21
  const presets = computed(() => {
19
22
  const allPresets = vtkColorMaps.rgbPresetNames.map((name) =>
@@ -59,45 +62,49 @@
59
62
  })
60
63
 
61
64
  function drawLutCanvas() {
62
- if (!lutCanvas.value) return
65
+ if (!lutCanvas.value) {
66
+ return
67
+ }
63
68
  const preset = vtkColorMaps.getPresetByName(selectedPresetName.value)
64
- if (!preset || !preset.RGBPoints) return
69
+ if (!preset || !preset.RGBPoints) {
70
+ return
71
+ }
65
72
 
66
73
  const canvas = lutCanvas.value
67
74
  const ctx = canvas.getContext("2d")
68
- const { width, height } = canvas
75
+ const { height, width } = canvas
69
76
 
70
- const lut = vtkColorTransferFunction.newInstance()
77
+ const lut = newInstance()
71
78
  const rgbPoints = preset.RGBPoints
72
79
 
73
- for (let i = 0; i < rgbPoints.length; i += 4) {
80
+ for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
74
81
  lut.addRGBPoint(
75
- rgbPoints[i],
76
- rgbPoints[i + 1],
77
- rgbPoints[i + 2],
78
- rgbPoints[i + 3],
82
+ rgbPoints[pointIdx],
83
+ rgbPoints[pointIdx + 1],
84
+ rgbPoints[pointIdx + 2],
85
+ rgbPoints[pointIdx + THREE],
79
86
  )
80
87
  }
81
88
 
82
89
  const table = lut.getUint8Table(
83
90
  rgbPoints[0],
84
- rgbPoints[rgbPoints.length - 4],
91
+ rgbPoints.at(-LAST_POINT_OFFSET),
85
92
  width,
86
93
  true,
87
94
  )
88
95
  const imageData = ctx.createImageData(width, height)
89
96
 
90
- for (let x = 0; x < width; x++) {
91
- const r = table[x * 4],
92
- g = table[x * 4 + 1],
93
- b = table[x * 4 + 2],
94
- a = table[x * 4 + 3]
95
- for (let y = 0; y < height; y++) {
96
- const idx = (y * width + x) * 4
97
- imageData.data[idx] = r
98
- imageData.data[idx + 1] = g
99
- imageData.data[idx + 2] = b
100
- imageData.data[idx + 3] = a
97
+ for (let xCoord = 0; xCoord < width; xCoord += 1) {
98
+ const red = table[xCoord * 4]
99
+ const green = table[xCoord * 4 + 1]
100
+ const blue = table[xCoord * 4 + 2]
101
+ const alpha = table[xCoord * 4 + THREE]
102
+ for (let yCoord = 0; yCoord < height; yCoord += 1) {
103
+ const pixelIdx = (yCoord * width + xCoord) * 4
104
+ imageData.data[pixelIdx] = red
105
+ imageData.data[pixelIdx + 1] = green
106
+ imageData.data[pixelIdx + 2] = blue
107
+ imageData.data[pixelIdx + THREE] = alpha
101
108
  }
102
109
  }
103
110
  ctx.putImageData(imageData, 0, 0)
@@ -110,14 +117,13 @@
110
117
  }
111
118
 
112
119
  onMounted(() => nextTick(drawLutCanvas))
120
+ watch([lutCanvas, selectedPresetName, () => min, () => max], drawLutCanvas)
113
121
  watch(
114
- [lutCanvas, selectedPresetName, () => props.min, () => props.max],
115
- drawLutCanvas,
116
- )
117
- watch(
118
- () => props.modelValue,
122
+ () => modelValue,
119
123
  (nv) => {
120
- if (nv !== selectedPresetName.value) selectedPresetName.value = nv
124
+ if (nv !== selectedPresetName.value) {
125
+ selectedPresetName.value = nv
126
+ }
121
127
  },
122
128
  )
123
129
  </script>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- const el = useTemplateRef("el")
2
+ const colorPickerRef = useTemplateRef("colorPickerRef")
3
3
  const model = defineModel()
4
- const { pressed } = useMousePressed({ target: el })
4
+ const { pressed } = useMousePressed({ target: colorPickerRef })
5
5
 
6
6
  const color = ref(model)
7
7
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  <template>
16
16
  <v-color-picker
17
- ref="el"
17
+ ref="colorPickerRef"
18
18
  v-model="color"
19
19
  flat
20
20
  canvas-height="100"
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
+ import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector"
2
3
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker"
3
- import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector"
4
- import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector"
5
4
  import ViewerOptionsEdgeAttributeSelector from "@ogw_front/components/Viewer/Options/EdgeAttributeSelector"
6
5
  import ViewerOptionsPolygonAttributeSelector from "@ogw_front/components/Viewer/Options/PolygonAttributeSelector"
7
- import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector"
8
6
  import ViewerOptionsPolyhedronAttributeSelector from "@ogw_front/components/Viewer/Options/PolyhedronAttributeSelector"
7
+ import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector"
8
+ import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector"
9
9
 
10
10
  const coloring_style_key = defineModel("coloring_style_key")
11
11
 
@@ -34,14 +34,12 @@
34
34
  "polyhedron_attribute_color_map",
35
35
  )
36
36
 
37
- const props = defineProps({
37
+ const { id } = defineProps({
38
38
  id: { type: String, required: true },
39
39
  })
40
40
 
41
- const has_color = computed(() => (color.value !== undefined ? true : false))
42
- const has_textures = computed(() =>
43
- textures.value !== undefined ? true : false,
44
- )
41
+ const has_color = computed(() => color.value !== undefined)
42
+ const has_textures = computed(() => textures.value !== undefined)
45
43
  const has_vertex = computed(() => vertex_attribute_range.value !== undefined)
46
44
  const has_edge = computed(() => edge_attribute_range.value !== undefined)
47
45
  const has_cells = computed(() => cell_attribute_range.value !== undefined)
@@ -64,20 +62,30 @@
64
62
  }
65
63
  const coloring_styles = computed(() => {
66
64
  let array = []
67
- if (has_color.value) array.push(color_dict)
68
- if (has_textures.value) array.push(textures_dict)
69
- if (has_vertex.value) array.push(vertex_dict)
70
- if (has_edge.value) array.push(edge_dict)
71
- if (has_cells.value) array.push(cell_dict)
72
- if (has_polygons.value) array.push(polygon_dict)
73
- if (has_polyhedra.value) array.push(polyhedron_dict)
65
+ if (has_color.value) {
66
+ array.push(color_dict)
67
+ }
68
+ if (has_textures.value) {
69
+ array.push(textures_dict)
70
+ }
71
+ if (has_vertex.value) {
72
+ array.push(vertex_dict)
73
+ }
74
+ if (has_edge.value) {
75
+ array.push(edge_dict)
76
+ }
77
+ if (has_cells.value) {
78
+ array.push(cell_dict)
79
+ }
80
+ if (has_polygons.value) {
81
+ array.push(polygon_dict)
82
+ }
83
+ if (has_polyhedra.value) {
84
+ array.push(polyhedron_dict)
85
+ }
74
86
 
75
- const labels = array.map((coloring) => {
76
- return coloring.name
77
- })
78
- const values = array.map((coloring) => {
79
- return coloring.value
80
- })
87
+ const labels = array.map((coloring) => coloring.name)
88
+ const values = array.map((coloring) => coloring.value)
81
89
 
82
90
  return { labels, values }
83
91
  })
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
+ import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
2
3
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
4
  import { useGeodeStore } from "@ogw_front/stores/geode"
4
- import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
5
5
 
6
6
  const geodeStore = useGeodeStore()
7
7
 
@@ -16,7 +16,7 @@
16
16
  })
17
17
  const edge_attributes = ref([])
18
18
 
19
- const props = defineProps({
19
+ const { id } = defineProps({
20
20
  id: { type: String, required: true },
21
21
  })
22
22
 
@@ -40,7 +40,7 @@
40
40
  function getEdgeAttributes() {
41
41
  geodeStore.request(
42
42
  back_schemas.opengeodeweb_back.edge_attribute_names,
43
- { id: props.id },
43
+ { id: id },
44
44
  {
45
45
  response_function: (response) => {
46
46
  edge_attributes.value = response.attributes
@@ -49,11 +49,11 @@
49
49
  )
50
50
  }
51
51
 
52
- const currentAttribute = computed(() => {
53
- return edge_attributes.value.find(
52
+ const currentAttribute = computed(() =>
53
+ edge_attributes.value.find(
54
54
  (attr) => attr.attribute_name === edge_attribute_name.value,
55
- )
56
- })
55
+ ),
56
+ )
57
57
 
58
58
  function resetRange() {
59
59
  if (currentAttribute.value) {
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
+ import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
2
3
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
4
  import { useGeodeStore } from "@ogw_front/stores/geode"
4
- import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
5
5
 
6
6
  const geodeStore = useGeodeStore()
7
7
 
@@ -17,7 +17,7 @@
17
17
  )
18
18
  const polygon_attributes = ref([])
19
19
 
20
- const props = defineProps({
20
+ const { id } = defineProps({
21
21
  id: { type: String, required: true },
22
22
  })
23
23
 
@@ -41,7 +41,7 @@
41
41
  function getPolygonAttributes() {
42
42
  geodeStore.request(
43
43
  back_schemas.opengeodeweb_back.polygon_attribute_names,
44
- { id: props.id },
44
+ { id: id },
45
45
  {
46
46
  response_function: (response) => {
47
47
  polygon_attributes.value = response.attributes
@@ -50,11 +50,11 @@
50
50
  )
51
51
  }
52
52
 
53
- const currentAttribute = computed(() => {
54
- return polygon_attributes.value.find(
53
+ const currentAttribute = computed(() =>
54
+ polygon_attributes.value.find(
55
55
  (attr) => attr.attribute_name === polygon_attribute_name.value,
56
- )
57
- })
56
+ ),
57
+ )
58
58
 
59
59
  function resetRange() {
60
60
  if (currentAttribute.value) {
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
+ import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
2
3
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
4
  import { useGeodeStore } from "@ogw_front/stores/geode"
4
- import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
5
5
 
6
6
  const geodeStore = useGeodeStore()
7
7
 
@@ -17,7 +17,7 @@
17
17
  )
18
18
  const polyhedron_attributes = ref([])
19
19
 
20
- const props = defineProps({
20
+ const { id } = defineProps({
21
21
  id: { type: String, required: true },
22
22
  })
23
23
 
@@ -47,7 +47,7 @@
47
47
  function getPolyhedronAttributes() {
48
48
  geodeStore.request(
49
49
  back_schemas.opengeodeweb_back.polyhedron_attribute_names,
50
- { id: props.id },
50
+ { id: id },
51
51
  {
52
52
  response_function: (response) => {
53
53
  polyhedron_attributes.value = response.attributes
@@ -56,11 +56,11 @@
56
56
  )
57
57
  }
58
58
 
59
- const currentAttribute = computed(() => {
60
- return polyhedron_attributes.value.find(
59
+ const currentAttribute = computed(() =>
60
+ polyhedron_attributes.value.find(
61
61
  (attr) => attr.attribute_name === polyhedron_attribute_name.value,
62
- )
63
- })
62
+ ),
63
+ )
64
64
 
65
65
  function resetRange() {
66
66
  if (currentAttribute.value) {
@@ -1,21 +1,21 @@
1
1
  <script setup>
2
- import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
2
  import FileUploader from "@ogw_front/components/FileUploader"
3
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
4
4
  import { useGeodeStore } from "@ogw_front/stores/geode"
5
5
 
6
6
  const emit = defineEmits(["update_value"])
7
7
 
8
- const props = defineProps({
8
+ const { id } = defineProps({
9
9
  id: { type: String, required: true },
10
10
  texture_id: { type: String, required: true },
11
11
  texture_name: { type: String, required: true },
12
12
  })
13
13
 
14
14
  const texture_name = ref("")
15
- texture_name.value = props.texture_name
15
+ texture_name.value = texture_name
16
16
 
17
17
  const texture_id = ref("")
18
- texture_id.value = props.texture_id
18
+ texture_id.value = texture_id
19
19
 
20
20
  const texture_coordinates = ref([])
21
21
  const geodeStore = useGeodeStore()
@@ -27,7 +27,7 @@
27
27
  function getTextureCoordinates() {
28
28
  geodeStore.request(
29
29
  back_schemas.opengeodeweb_back.texture_coordinates,
30
- { id: props.id },
30
+ { id: id },
31
31
  {
32
32
  response_function: (response) => {
33
33
  texture_coordinates.value = response.texture_coordinates
@@ -3,14 +3,14 @@
3
3
 
4
4
  const textures = defineModel()
5
5
 
6
- const props = defineProps({
6
+ const { id } = defineProps({
7
7
  id: { type: String, required: true },
8
8
  })
9
9
 
10
10
  const internal_textures = ref([])
11
11
 
12
12
  onMounted(() => {
13
- if (textures.value != null) {
13
+ if (textures.value !== null) {
14
14
  internal_textures.value = textures.value
15
15
  } else {
16
16
  internal_textures.value = [{ id: "", texture_name: "" }]
@@ -19,9 +19,9 @@
19
19
 
20
20
  function update_value_event($event, index) {
21
21
  internal_textures.value[index][$event.key] = $event.value
22
- const filtered = internal_textures.value.filter((texture) => {
23
- return texture.texture_name !== "" && texture.id !== ""
24
- })
22
+ const filtered = internal_textures.value.filter(
23
+ (texture) => texture.texture_name !== "" && texture.id !== "",
24
+ )
25
25
  if (filtered.length !== 0) {
26
26
  textures.value = filtered
27
27
  }
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
+ import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
2
3
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
3
4
  import { useGeodeStore } from "@ogw_front/stores/geode"
4
- import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
5
5
 
6
6
  const geodeStore = useGeodeStore()
7
7
 
@@ -16,7 +16,7 @@
16
16
  })
17
17
  const vertex_attributes = ref([])
18
18
 
19
- const props = defineProps({
19
+ const { id } = defineProps({
20
20
  id: { type: String, required: true },
21
21
  })
22
22
 
@@ -40,7 +40,7 @@
40
40
  function getVertexAttributes() {
41
41
  geodeStore.request(
42
42
  back_schemas.opengeodeweb_back.vertex_attribute_names,
43
- { id: props.id },
43
+ { id: id },
44
44
  {
45
45
  response_function: (response) => {
46
46
  vertex_attributes.value = response.attributes
@@ -49,11 +49,11 @@
49
49
  )
50
50
  }
51
51
 
52
- const currentAttribute = computed(() => {
53
- return vertex_attributes.value.find(
52
+ const currentAttribute = computed(() =>
53
+ vertex_attributes.value.find(
54
54
  (attr) => attr.attribute_name === vertex_attribute_name.value,
55
- )
56
- })
55
+ ),
56
+ )
57
57
 
58
58
  function resetRange() {
59
59
  if (currentAttribute.value) {
@@ -1,8 +1,8 @@
1
1
  <script setup>
2
+ import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg"
2
3
  import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
3
- import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
4
4
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
5
- import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg"
5
+ import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
6
6
 
7
7
  import { useDataStyleStore } from "@ogw_front/stores/data_style"
8
8
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
@@ -10,11 +10,11 @@
10
10
  const dataStyleStore = useDataStyleStore()
11
11
  const hybridViewerStore = useHybridViewerStore()
12
12
 
13
- const props = defineProps({
13
+ const { itemProps } = defineProps({
14
14
  itemProps: { type: Object, required: true },
15
15
  })
16
16
 
17
- const id = toRef(() => props.itemProps.id)
17
+ const id = toRef(() => itemProps.id)
18
18
 
19
19
  const visibility = computed({
20
20
  get: () => dataStyleStore.meshPointsVisibility(id.value),
@@ -77,7 +77,7 @@
77
77
  </script>
78
78
  <template>
79
79
  <ViewerContextMenuItem
80
- :itemProps="props.itemProps"
80
+ :itemProps="itemProps"
81
81
  tooltip="Points options"
82
82
  :btn_image="PointSetPoints"
83
83
  >