You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We repeat this paradigm a lot in empress.js (five times just using this._featureMetadataColumns, by my count, and I'm pretty sure most of these are my fault :P):
varfmIdx=_.indexOf(this._featureMetadataColumns,cat);if(fmIdx<0){throw'Feature metadata column "'+cat+'" not present in data.';}
It'd be nice to just make a convenience function for this:
// retrieves index in this._featureMetadataColumns and automatically does validationvarfmIdx=this.getFMIdx(cat);
For what it's worth, the BIOM table JS also does something similar with sample metadata. We could essentially just copy over this function and change it to reference feature instead of sample metadata. (I guess it'd be extra nice to make both these functions call another utility function that actually uses _.indexOf(), but at a certain point abstracting things like this stops being useful...)
We repeat this paradigm a lot in
empress.js
(five times just usingthis._featureMetadataColumns
, by my count, and I'm pretty sure most of these are my fault :P):It'd be nice to just make a convenience function for this:
For what it's worth, the BIOM table JS also does something similar with sample metadata. We could essentially just copy over this function and change it to reference feature instead of sample metadata. (I guess it'd be extra nice to make both these functions call another utility function that actually uses
_.indexOf()
, but at a certain point abstracting things like this stops being useful...)empress/empress/support_files/js/biom-table.js
Lines 159 to 167 in 582c054
The text was updated successfully, but these errors were encountered: