-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Impemented a filter component for filtering and reordering all micro-…
…synteny tracks, thus deprecating the order and regexp components previously used for these tasks. This required updating the left slider component to support switching between sub components. The left slider was as updated to no longer require the parent component to have explicit knowledge of its state. Lastly, a button was added to the header in the genes view to toggle the new filter component.
- Loading branch information
1 parent
4eacce0
commit 9f43e38
Showing
25 changed files
with
270 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
client/src/app/gene/components/forms/filters/filters.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<form id="search-parameters" (ngSubmit)="submit()"> | ||
<fieldset id="micro-filters"> | ||
<legend>Micro-Synteny<a id="micro-help" class="float-right" (click)="microHelp=!microHelp"><span class="fa fa-question-circle"></span></a></legend> | ||
<div class="form-group"> | ||
<label for="regexp">Filter by name</label> | ||
<input class="form-control" type="text" id="regexp" name="regexp" | ||
(input)="updateRegexp($event.target.value)" | ||
[ngModel]="currentRegexp|async"> | ||
<small class="form-text text-muted">A regular expression</small> | ||
<p class="help-block" *ngIf="microHelp">A regular expression used to filter the micro-synteny tracks by name.</p> | ||
</div> | ||
<div class="form-group"> | ||
<label for="order">Track order</label> | ||
<select class="form-control" id="order" name="order" | ||
(change)="updateOrder($event.target.value)" | ||
[ngModel]="(selectedOrderAlgorithm|async).id"> | ||
<option *ngFor="let alg of orderAlgorithms" [value]="alg.id">{{alg.name}}</option> | ||
</select> | ||
<p class="help-block" *ngIf="microHelp">What order the micro-synteny tracks should be displayed in.</p> | ||
</div> | ||
</fieldset> | ||
</form> |
40 changes: 40 additions & 0 deletions
40
client/src/app/gene/components/forms/filters/filters.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Angular | ||
import { Component } from '@angular/core'; | ||
import { Observable, Subject } from 'rxjs'; | ||
import { takeUntil } from 'rxjs/operators'; | ||
// app | ||
import { ORDER_ALGORITHMS } from '@gcv/gene/algorithms'; | ||
import { Algorithm } from '@gcv/gene/models'; | ||
import { FilterService } from '@gcv/gene/services'; | ||
|
||
|
||
@Component({ | ||
selector: 'filters', | ||
templateUrl: './filters.component.html', | ||
}) | ||
export class FiltersComponent { | ||
|
||
orderAlgorithms = ORDER_ALGORITHMS; | ||
currentRegexp: Observable<string>; | ||
selectedOrderAlgorithm: Observable<Algorithm>; | ||
|
||
microHelp = false; | ||
|
||
private _destroy: Subject<boolean> = new Subject(); | ||
|
||
constructor(private _filterService: FilterService) { | ||
this.currentRegexp = this._filterService.getRegexp(); | ||
this.selectedOrderAlgorithm = this._filterService.getOrderAlgorithm(); | ||
} | ||
|
||
// public | ||
|
||
updateRegexp(regexp: string): void { | ||
this._filterService.setRegexp(regexp); | ||
} | ||
|
||
updateOrder(id: string): void { | ||
this._filterService.setOrder(id); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './filters.component'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { FiltersComponent } from './filters'; | ||
import { ParamsComponent } from './params'; | ||
|
||
export const components: any[] = [ | ||
FiltersComponent, | ||
ParamsComponent, | ||
]; | ||
|
||
export * from './filters'; | ||
export * from './params'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './params.component'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<left-slider [open]="showLeftSlider|async" (onClose)="closeLeftSlider()"> | ||
<params (valid)="closeLeftSlider()" (invalid)="openLeftSlider()"></params> | ||
</left-slider> | ||
<left-slider></left-slider> | ||
<div class="viewers" [gcvGoldenLayout]="layoutComponents" [config]="layoutConfig"> | ||
<div [gcvTooltipFactory]="tooltipComponents"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.