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

Export utility functions for customizing the viewer #238

Closed oeway closed 4 years ago

oeway commented 4 years ago

Not sure how you would do this, but with this PR, I am trying to extract utility functions and export it such that it will be much easier to customize the viewer.

For now, itkVtkViewer.utils has:

With these extracted functions and additions to existing api, I would like to:

  1. be able to load a file object locally or fetched remotely with utils.readFiles
  2. construct an ITK image for the veiwer with convertItkToVtkImage
  3. create the MainUI in a custom container which will likely outside the root container of the viewer
  4. be able to recreate the MainUI by passing the store object obtained from the added publicAPI function called getStore.

And I think we can add more in the future.

Please let me know if you have better idea.

thewtex commented 4 years ago

@oeway awesome! Thank you! :1st_place_medal:

Beautiful ideas, and I love the implementation :heart:

Two requests:

1) Please add comments over getStore, getViewProxy, and the UserInterface export along the lines of

/ The Store is considered an internal implementation detail and its interface and behavior may change without changes to the major version. /

Since these will likely change as we add Zarr, categorical color, etc. support, and we do not want it to be unexpected that they will change. :-)

2) Please do a rebase, squash fix-up commits, and add commitizen conventional changelog prefixes to the commit subject line (see other commits in the repository for examples). When creating commits in the future, npm run commit to commit can help walk through the prefixes and format. A brief reference is here:

https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular

This is used to generate our Release Notes and the Zenodo Citation Notes.

oeway commented 4 years ago

@thewtex Glad that you liked it. Thank you for your tips, and I just made a squash. Please take a look and let me know if you want me to change anything.

thewtex commented 4 years ago

@oeway thanks!

Could feat[utils] please be updated to feat(utils)?

oeway commented 4 years ago

Sure, just did it, sorry about that.

thewtex commented 4 years ago

Thanks!

thewtex commented 4 years ago

:tada: This PR is included in version 9.17.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: