Skip to content

Commit

Permalink
Merge pull request #57 from daisybio/rewrite_lena
Browse files Browse the repository at this point in the history
Add spongeEffects page
  • Loading branch information
nictru authored Dec 18, 2024
2 parents 3f1684c + 2847e88 commit cdadfd8
Show file tree
Hide file tree
Showing 57 changed files with 2,019 additions and 23 deletions.
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}
17 changes: 14 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"graphology-layout-force": "^0.2.4",
"lodash": "^4.17.21",
"ngx-bootstrap": "^19.0.1",
"ngx-dropzone": "^3.1.0",
"rxjs": "~7.8.0",
"sigma": "^3.0.0-beta.38",
"tslib": "^2.3.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file added public/favicon_old.ico
Binary file not shown.
Binary file added public/magnifying_glass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {VersionsService} from "./services/versions.service";
styleUrl: './app.component.scss'
})
export class AppComponent {
subpages = ['Browse', 'Genes', 'Documentation', 'Download'];
title = 'SPONGE-web-frontend';
subpages = ['Browse', 'Genes', 'SpongEffects', 'Documentation', 'Download'];
version: WritableSignal<number>;

constructor(versionsService: VersionsService) {
Expand Down
17 changes: 17 additions & 0 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
} from "./routes/documentation/browse-functionalities/browse-functionalities.component";
import {BrowseSidebarComponent} from "./routes/documentation/browse-sidebar/browse-sidebar.component";
import {MoreComponent} from "./routes/documentation/more/more.component";
import {SpongEffectsComponent} from "./routes/spongeffects/spongeffects.component";
import {GenesComponent} from "./routes/genes/genes.component";
import {ExploreComponent} from "./routes/spongeffects/explore/explore.component";
import {PredictComponent} from "./routes/spongeffects/predict/predict.component";

export const routes: Routes = [
{
Expand Down Expand Up @@ -59,6 +62,20 @@ export const routes: Routes = [
path: 'download',
component: DownloadComponent
},
{
path: 'spongeffects',
component: SpongEffectsComponent,
children: [
{
path: '',
component: ExploreComponent
},
{
path: 'predict',
component: PredictComponent
}
],
},
{
path: '**',
redirectTo: ''
Expand Down
37 changes: 37 additions & 0 deletions src/app/components/info/info.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@if (type() == 'modal') {
<div class="card-container">
<button mat-button (click)="openDialog()">
<mat-icon>info</mat-icon>
{{ title() }}
</button>
</div>
} @else {
<mat-expansion-panel style="margin: 10px">
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon style="margin-right: 5px">info</mat-icon>
{{ title() }}
</mat-panel-title>
@if (subtitle(); as subtitle) {
<mat-panel-description>
{{ subtitle }}
</mat-panel-description>
}
</mat-expansion-panel-header>
<ng-container *ngTemplateOutlet="content"></ng-container>
</mat-expansion-panel>
}

<ng-template #dialog>
<h1 mat-dialog-title>{{ title() }}</h1>
@if (subtitle(); as subtitle) {
<h2 mat-dialog-title>{{ subtitle }}</h2>
}
<mat-dialog-content>
<ng-container *ngTemplateOutlet="content"></ng-container>
</mat-dialog-content>
</ng-template>

<ng-template #content>
<ng-content></ng-content>
</ng-template>
Empty file.
23 changes: 23 additions & 0 deletions src/app/components/info/info.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { InfoComponent } from './info.component';

describe('InfoComponent', () => {
let component: InfoComponent;
let fixture: ComponentFixture<InfoComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [InfoComponent]
})
.compileComponents();

fixture = TestBed.createComponent(InfoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
31 changes: 31 additions & 0 deletions src/app/components/info/info.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {Component, inject, input, viewChild} from '@angular/core';
import {MatButton} from "@angular/material/button";
import {MatExpansionModule} from "@angular/material/expansion";
import {MatIcon} from "@angular/material/icon";
import {MatDialog, MatDialogModule} from "@angular/material/dialog";
import {NgTemplateOutlet} from "@angular/common";

@Component({
selector: 'app-info',
imports: [
MatButton,
MatExpansionModule,
MatIcon,
MatDialogModule,
NgTemplateOutlet
],
templateUrl: './info.component.html',
styleUrl: './info.component.scss'
})
export class InfoComponent {
dialog = inject(MatDialog);
dialogTemplate = viewChild<any>('dialog');

title = input<string>('What does this mean?');
subtitle = input<string>();
type = input<'modal' | 'panel'>('modal');

openDialog() {
this.dialog.open(this.dialogTemplate())
}
}
Loading

0 comments on commit cdadfd8

Please sign in to comment.