Kitware / candela

Visualization components for the web
https://candela.readthedocs.io
Apache License 2.0
116 stars 29 forks source link

Add update / destroy API for VisComponent #495

Closed waxlamp closed 7 years ago

waxlamp commented 7 years ago

TODO:

This PR adds update() and destroy() methods to VisComponent, allowing for in-place updates and cleanup upon destroying a component. These should make component lifecycles more explicit and manageable in automated contexts such as Resonant Lab and the Candela plugin for Girder.

Note that this now completes a sort of "CRUD" model for VisComponent: create == constructor(), read == render(), update == update(), and delete == destroy(). In particular, this means that render() should really just take the state of a component and make it visible - nothing more or less than that. Whether this is a valid model we want to officially promote for components is something that remains to discuss.

codecov-io commented 7 years ago

Codecov Report

Merging #495 into master will increase coverage by 2.9%. The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #495     +/-   ##
=========================================
+ Coverage   46.24%   49.14%   +2.9%     
=========================================
  Files          39       39             
  Lines        1544     1583     +39     
=========================================
+ Hits          714      778     +64     
+ Misses        830      805     -25
Impacted Files Coverage Δ
components/SentenTree/index.js 40% <0%> (-5.46%) :arrow_down:
components/SimilarityGraph/index.js 8.77% <0%> (ø) :arrow_up:
components/Geo/index.js 18.18% <0%> (-1.82%) :arrow_down:
VisComponent/mixin/VegaChart.js 83.87% <100%> (+61.64%) :arrow_up:
components/TreeHeatmap/index.js 83.98% <100%> (ø) :arrow_up:
components/GeoDots/index.js 11.94% <6.38%> (-1.4%) :arrow_down:
VisComponent/index.js 60% <66.66%> (+2.85%) :arrow_up:
util/vega/index.js 87.44% <0%> (+16.88%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7b93bc4...b323c43. Read the comment docs.

waxlamp commented 7 years ago

@jeffbaumes this is ready for review.