11// Third party imports
22import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
33
4+ import { useDataStyleStore } from "../data.js"
5+ import { useViewerStore } from "../viewer.js"
6+
47// Local constants
58const mesh_cells_schemas = viewer_schemas . opengeodeweb_viewer . mesh . cells
69export function useMeshCellsStyle ( ) {
710 const dataStyleStore = useDataStyleStore ( )
11+ const viewerStore = useViewerStore ( )
812
913 function meshCellsStyle ( id ) {
1014 return dataStyleStore . getStyle ( id ) . cells
@@ -15,7 +19,6 @@ export function useMeshCellsStyle() {
1519 }
1620 function setMeshCellsVisibility ( id , visibility ) {
1721 const cells_style = meshCellsStyle ( id )
18- const viewerStore = useViewerStore ( )
1922 return viewerStore . request (
2023 mesh_cells_schemas . visibility ,
2124 { id, visibility } ,
@@ -37,7 +40,6 @@ export function useMeshCellsStyle() {
3740 }
3841 function setMeshCellsColor ( id , color ) {
3942 const coloring_style = meshCellsStyle ( id ) . coloring
40- const viewerStore = useViewerStore ( )
4143 return viewerStore . request (
4244 mesh_cells_schemas . color ,
4345 { id, color } ,
@@ -59,7 +61,6 @@ export function useMeshCellsStyle() {
5961 }
6062 function setMeshCellsTextures ( id , textures ) {
6163 const coloring_style = meshCellsStyle ( id ) . coloring
62- const viewerStore = useViewerStore ( )
6364 return viewerStore . request (
6465 mesh_cells_schemas . apply_textures ,
6566 { id, textures } ,
@@ -78,7 +79,6 @@ export function useMeshCellsStyle() {
7879
7980 function setMeshCellsVertexAttribute ( id , vertex_attribute ) {
8081 const coloring_style = meshCellsStyle ( id ) . coloring
81- const viewerStore = useViewerStore ( )
8282 return viewerStore . request (
8383 mesh_cells_schemas . vertex_attribute ,
8484 { id, ...vertex_attribute } ,
@@ -100,7 +100,6 @@ export function useMeshCellsStyle() {
100100 }
101101 function setMeshCellsCellAttribute ( id , cell_attribute ) {
102102 const coloring_style = meshCellsStyle ( id ) . coloring
103- const viewerStore = useViewerStore ( )
104103 return viewerStore . request (
105104 mesh_cells_schemas . cell_attribute ,
106105 { id, ...cell_attribute } ,
0 commit comments