Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
210 stars 64 forks source link

fix(Viewer): Expose picked values via click subscription #284

Closed scottwittenburg closed 4 years ago

scottwittenburg commented 4 years ago

@thewtex There's no other subscription management functionality in the store, but I put this one there so we would have it available to any of our components, as well as making it available to embedding applications. Let me know if a cleaner approach comes to mind.

oeway commented 4 years ago

Nice! I am thinking that would a even more generic event bus make sense? The viewer can expose a standard EventEmitter interface(with functions including on, once, off, emit etc.), one can subscribe to many different events. Not only pick value, but also view change, camera position change etc.

thewtex commented 4 years ago

@scottwittenburg nice!

@oeway thanks for the suggestion!

@scottwittenburg could you please look into providing subscriptions and exposing the EventEmitter interface via the eventemitter2 package?

scottwittenburg commented 4 years ago

@scottwittenburg could you please look into providing subscriptions and exposing the EventEmitter interface via the eventemitter2 package?

Yes, will do. 👍

thewtex commented 4 years ago

I noticed eventemitter3 is available -- I am guessing it is better than eventemitter2 ;-).

https://www.npmjs.com/package/eventemitter3

thewtex commented 4 years ago

Required API's for Juptyer

thewtex commented 4 years ago

Superceded by #289