Skip to content

Commit

Permalink
blast-results-view : implement show / hide - all checkbox
Browse files Browse the repository at this point in the history
blast-results-view.js : add viewRow, use in dataForTable.  rename data{Matrix,ForTable}Effect().
blast-results-view.hbs : change span class=filter-group-col to div.
  • Loading branch information
Don-Isdale committed Jun 7, 2021
1 parent 874192b commit 199875a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
22 changes: 17 additions & 5 deletions frontend/app/components/panel/upload/blast-results-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export default Component.extend({
[];
return cells;
}),
viewRow : computed('dataMatrix', 'viewFeaturesFlag', function () {
let
data = this.get('dataMatrix'),
viewFeaturesFlag = this.get('viewFeaturesFlag'),
viewRow = data.map((row) => viewFeaturesFlag);
return viewRow;
}),

/** Result data formatted for upload-table.js : submitFile()
*/
dataFeatures : computed('dataMatrix.[]', function () {
Expand Down Expand Up @@ -105,14 +113,15 @@ export default Component.extend({
/** Result data formatted for handsontable : loadData()
* Prepend a checkbox column.
*/
dataForTable : computed('dataMatrix.[]', function () {
dataForTable : computed('dataMatrix.[]', 'viewRow', function () {
let
data = this.get('dataMatrix'),
/** prepend with view flag = true. This copies row array. */
rows = data.map((row) => [true].concat(row) );
viewRow = this.get('viewRow'),
/** prepend with view flag (initially true). Use of [].concat() copies row array (not mutate). */
rows = data.map((row, i) => [viewRow[i]].concat(row) );
return rows;
}),
dataMatrixEffect : computed('table', 'dataForTable.[]', function () {
dataForTableEffect : computed('table', 'dataForTable.[]', function () {
let table = this.get('table');
if (table) {
table.loadData(this.get('dataForTable'));
Expand Down Expand Up @@ -151,10 +160,13 @@ export default Component.extend({
}),

viewAllResultAxesChange(proxy) {
const fnName = 'viewAllResultAxesChange';
let checked = proxy.target.checked;
/** this value seems to be delayed */
let viewAll = this.get('viewAllResultAxesFlag');
dLog('viewAllResultAxesChange', checked, viewAll);
dLog(fnName, checked, viewAll);


},

viewFeaturesEffect : computed('dataFeaturesForStore.[]', 'viewFeaturesFlag', 'active', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{dataMatrixEffect}}
{{dataForTableEffect}}
{{activeEffect}}
{{viewFeaturesEffect}}

Expand All @@ -8,16 +8,16 @@

{{!-- --------------------------------------------------------------------- --}}

<span class="filter-group-col">
<div>
{{input type="checkbox" name="viewAllResultAxesFlag" checked=viewAllResultAxesFlag
input=(action viewAllResultAxesChange)
}}
<label>View all axes with results</label>
</span>
</div>

<span class="filter-group-col">
<div>
{{input type="checkbox" name="viewFeaturesFlag" checked=viewFeaturesFlag }}
<label>Show Features (triangles)</label>
</span>
<label>Show / Hide all Features (triangles)</label>
</div>

{{!-- --------------------------------------------------------------------- --}}

0 comments on commit 199875a

Please sign in to comment.