I’m trying to work with the speckle viewer and am wondering if I am using the correct version/documentation.
I am currently on the latest version of the speckle viewer from npm (2.9.0).
The referenced documentation is here, although I assume that it might be outdated since the viewer is still changing. So far I have assumed that the source code for the viewer is the one found here on github but I can’t seem to get the code from github to mach my locally installed files. ( missing functions, types, etc.)
Is the best way to clone the whole speckle-server repository and just reference the files form there?
Is the speckle viewer on npm actually tracking different source code?
I don’t need a fully flushed out documentation. I am happy reading source code.
But I have the impression that right now I am trying to reverse engineer the node module.
PS: Might it be an idea to make the individual packages in the speckle-server repository their own submodules?
That way one could clone them individually but still work on them as a whole inside the speckle-server project.
Compare with how your currently integrated code compares with that in main.ts
The specifics of handling click event example in the API documentation works with both a viewer referencing the server code or the npm release
viewer.on(ViewerEvent.ObjectClicked, (selectionInfo: SelectionEvent) => {
if (selectionInfo) {
// Object was clicked. Focus in on it
viewer.zoom([selectionInfo.userData.id as string])
}
else {
// No object clicked. Restore focus to entire scene
viewer.zoom()
}
})
indeed all the events are to be populated at runtime: Busy, LoadComplete, LoadProgress, ObjectClicked, ObjectDoubleClicked, SectionBoxChanged, UnloadAllComplete, UnloadComplete
Give that a go and if you have any further problems report back!
thanks for the chat the other day and all the help.
I did some updating, rebuilding and copying of code snippets form the sandbox and it seems to be working. Actually, so well that now I am having trouble to reproduce the error from before.
I’ll have to do some cleaning up of my code as it is all over the place from all the edits. But I seem to be on a good track.