1+ // Third party imports
12import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3+
4+ // Local constants
25const mesh_points_schemas = viewer_schemas . opengeodeweb_viewer . mesh . points
36
47export function useMeshPointsStyle ( ) {
@@ -19,7 +22,9 @@ export function useMeshPointsStyle() {
1922 response_function : ( ) => {
2023 points_style . visibility = visibility
2124 console . log (
22- `${ setMeshPointsVisibility . name } ${ id } ${ meshPointsVisibility ( id ) } ` ,
25+ setMeshPointsVisibility . name ,
26+ { id } ,
27+ meshPointsVisibility ( id ) ,
2328 )
2429 } ,
2530 } ,
@@ -33,13 +38,17 @@ export function useMeshPointsStyle() {
3338 const coloring = meshPointsStyle ( id ) . coloring
3439 coloring . active = type
3540 console . log (
36- `${ setMeshPointsActiveColoring . name } ${ id } ${ meshPointsActiveColoring ( id ) } ` ,
41+ setMeshPointsActiveColoring . name ,
42+ { id } ,
43+ meshPointsActiveColoring ( id ) ,
3744 )
3845 if ( type == "color" ) {
3946 return dataStyleStore . setMeshPointsColor ( id , coloring . color )
4047 } else if ( type == "vertex" && coloring . vertex !== null ) {
4148 return dataStyleStore . setMeshPointsVertexAttribute ( id , coloring . vertex )
42- } else throw new Error ( "Unknown points coloring type: " + type )
49+ } else {
50+ throw new Error ( "Unknown mesh points coloring type: " + type )
51+ }
4352 }
4453
4554 function meshPointsColor ( id ) {
@@ -53,7 +62,9 @@ export function useMeshPointsStyle() {
5362 response_function : ( ) => {
5463 coloring_style . color = color
5564 console . log (
56- `${ setMeshPointsColor . name } ${ id } ${ JSON . stringify ( meshPointsColor ( id ) ) } ` ,
65+ setMeshPointsColor . name ,
66+ { id } ,
67+ JSON . stringify ( meshPointsColor ( id ) ) ,
5768 )
5869 } ,
5970 } ,
@@ -73,7 +84,9 @@ export function useMeshPointsStyle() {
7384 response_function : ( ) => {
7485 coloring_style . vertex = vertex_attribute
7586 console . log (
76- `${ setMeshPointsVertexAttribute . name } ${ id } ${ meshPointsVertexAttribute ( id ) } ` ,
87+ setMeshPointsVertexAttribute . name ,
88+ { id } ,
89+ meshPointsVertexAttribute ( id ) ,
7790 )
7891 } ,
7992 } ,
@@ -84,19 +97,19 @@ export function useMeshPointsStyle() {
8497 return meshPointsStyle ( id ) . size
8598 }
8699 function setMeshPointsSize ( id , size ) {
87- const points_style = meshPointsStyle ( id )
88100 return viewer_call (
89101 { schema : mesh_points_schemas . size , params : { id, size } } ,
90102 {
91103 response_function : ( ) => {
92- points_style . size = size
93- console . log ( ` ${ setMeshPointsSize . name } ${ id } ${ meshPointsSize ( id ) } ` )
104+ meshPointsStyle ( id ) . size = size
105+ console . log ( setMeshPointsSize . name , { id } , meshPointsSize ( id ) )
94106 } ,
95107 } ,
96108 )
97109 }
98110
99- function applyMeshPointsStyle ( id , style ) {
111+ function applyMeshPointsStyle ( id ) {
112+ const style = meshPointsStyle ( id )
100113 return Promise . all ( [
101114 setMeshPointsVisibility ( id , style . visibility ) ,
102115 setMeshPointsActiveColoring ( id , style . coloring . active ) ,
0 commit comments