const viewer = await createSomakine(container, {
dataset,
accessibleLabel: "Interactive body model",
onSelection: ({ structure }) => {
console.log(structure.id);
},
});
viewer.setLayer("muscle");
viewer.selectStructure(structureId);
viewer.selectStructures([structureId, anotherStructureId]); // IDs may span Regions
viewer.setStructureStyle(structureId, { color: "#e19a5b" });
SOMAKINE / ALPHA 0.1
The open body framework.
A host-independent anatomy model, honest visual coverage, and a small semantic viewer API.
Loading anatomy…
Drag to rotate · Right-drag to pan · Ctrl/Cmd-click to multi-select · Scroll to zoom
Loading anatomy…
DEVELOPER SURFACE
A small viewer API, ready for your interface.
Keep layout, controls, and education content in your host application. Somakine owns the verified model, camera, and semantic selection events.
QUICK START
viewer.ts
CORE API
viewer
createSomakine(container, options)- Create a viewer with a verified data pack and host callbacks.
setLocale(locale) · setInteractionMode(mode)- Switch labels and choose primary drag rotation or panning.
setLayer(type | null) · setVisible(ids)- Show one structure type or apply a host-computed visibility set.
selectStructure(id) · selectStructures(ids)- Highlight one structure or an arbitrary cross-Region set; unknown IDs are ignored and visibility is preserved.
focusStructure(id)- Explicitly isolate one structure and its declared context geometry.
onSelectionGroup(selections)- Receive the resolved selection records after a single or multi-structure highlight; canvas Ctrl/Cmd-click toggles picked meshes.
setStructureStyle(id, style)- Set a structure-specific colour, emissive, opacity, or surface style; pass
nullto reset. showBody() · reset()- Restore the complete framed model and initial camera.
dispose()- Release controls, listeners, renderer, and loaded resources.