Skip to content

Commit 4016a41

Browse files
committedOct 25, 2020
minor adjustments, added firebase
1 parent 3539027 commit 4016a41

15 files changed

+4925
-496
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
favicon.ico,1603613920219,a2aee5309d0b59b9b66384ccc3969a07fab1b320d0bf76f1b25047a051d7f774
2+
index.html,1603613920234,a228718c347b5f7358d3807605eb4a36bd356ec20765fa2d0f807ac09c20fd0a
3+
runtime.acf0dec4155e77772545.js,1603613920113,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb
4+
styles.db9a73d3b9ec72d56901.css,1603613920113,f8e1c1ea2b85b16bd9f3e889e1df60cf3d2fb3ed4c1909401786e1db8abad37d
5+
3rdpartylicenses.txt,1603613920113,c1249b25cc8132d95a014b23a2bf9b100486e96ad1eb7a48ea6ee9e858d9b657
6+
polyfills.35a5ca1855eb057f016a.js,1603613920113,696eb043e309ace56506b69f85083dcd79b502a601892daaf91a27272d99c38b
7+
main.daa938bb5f984ef8c4cd.js,1603613920114,5c2e15c4cdfdc2f6988c5fa22a2357bb35494171a5bfb9e299517ccf25eef5b8

‎.firebaserc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"targets": {
3+
"signalgenerator-f4302": {
4+
"hosting": {
5+
"my-first-app": [
6+
"signalgenerator-f4302"
7+
]
8+
}
9+
}
10+
}
11+
}

‎angular.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,13 @@
121121
"devServerTarget": "my-first-app:serve:production"
122122
}
123123
}
124+
},
125+
"deploy": {
126+
"builder": "@angular/fire:deploy",
127+
"options": {}
124128
}
125129
}
126-
}},
130+
}
131+
},
127132
"defaultProject": "my-first-app"
128-
}
133+
}

‎firebase.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"hosting": [
3+
{
4+
"target": "my-first-app",
5+
"public": "dist/my-first-app",
6+
"ignore": [
7+
"**/.*"
8+
],
9+
"headers": [
10+
{
11+
"source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
12+
"headers": [
13+
{
14+
"key": "Cache-Control",
15+
"value": "public,max-age=31536000,immutable"
16+
}
17+
]
18+
}
19+
],
20+
"rewrites": [
21+
{
22+
"source": "**",
23+
"destination": "/index.html"
24+
}
25+
]
26+
}
27+
]
28+
}

‎package-lock.json

+4,817-468
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@angular/common": "~10.1.6",
1616
"@angular/compiler": "~10.1.6",
1717
"@angular/core": "~10.1.6",
18+
"@angular/fire": "^6.0.3",
1819
"@angular/forms": "~10.1.6",
1920
"@angular/platform-browser": "~10.1.6",
2021
"@angular/platform-browser-dynamic": "~10.1.6",
@@ -24,7 +25,8 @@
2425
"plotly.js": "^1.57.1",
2526
"rxjs": "~6.6.0",
2627
"tslib": "^2.0.0",
27-
"zone.js": "~0.10.2"
28+
"zone.js": "~0.10.2",
29+
"firebase": "^7.13.1"
2830
},
2931
"devDependencies": {
3032
"@angular-devkit/build-angular": "~0.1001.7",
@@ -44,6 +46,12 @@
4446
"protractor": "~7.0.0",
4547
"ts-node": "~8.3.0",
4648
"tslint": "~6.1.0",
47-
"typescript": "~4.0.2"
49+
"typescript": "~4.0.2",
50+
"@angular-devkit/architect": ">= 0.900 < 0.1100",
51+
"firebase-tools": "^8.0.0",
52+
"fuzzy": "^0.1.3",
53+
"inquirer": "^6.2.2",
54+
"inquirer-autocomplete-prompt": "^1.0.1",
55+
"open": "^7.0.3"
4856
}
4957
}

‎src/app/app.component.html

+4
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
<app-top-nav-bar></app-top-nav-bar>
55
<router-outlet>
66
</router-outlet>
7+
<footer>
8+
Made by Pascal Lohscheidt - using Angular & Firebase<br>
9+
Code available on GitHub
10+
</footer>
711
</div>

‎src/app/app.component.sass

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.root-container
22
width: 100%
3-
height: 100vh
3+
min-height: 100vh
44
background-color: #212121
55

6+
footer
7+
background-color: black
8+
padding: 20px
9+

‎src/app/chart-view/chart-view.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<app-chart></app-chart>
66
<div class="control-pane">
77
<app-curve-selection-view></app-curve-selection-view>
8+
<div class="vertical-border"></div>
89
<app-modulate-settings></app-modulate-settings>
910
</div>
1011
</div>

‎src/app/chart-view/chart-view.component.sass

+11-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
width: 80%
1010

1111
.vertical-flex-body
12-
background-color: green
12+
background-color: rgb(40,40,40)
1313
width: 100%
1414
height: 100%
1515
display: flex
@@ -21,3 +21,13 @@
2121

2222
.control-pane
2323
width: 100%
24+
display: flex
25+
flex-direction: row
26+
justify-content: space-around
27+
28+
.vertical-border
29+
height: 380px
30+
background-color: white
31+
width: 2px
32+
align-self: center
33+

‎src/app/chart.service.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ChartService {
6868
generateGraphs() {
6969
let data = [];
7070
this.curves.forEach(curve => {
71-
if(curve.curveSettings.active) data.push(this.generateGraphData(curve.curveSettings)); //ONLY if the curve is active show it in the graph
71+
if(curve.curveSettings.active) data.push(this.generateGraphData(curve.curveSettings, curve.id)); //ONLY if the curve is active show it in the graph
7272
});
7373

7474

@@ -92,15 +92,16 @@ export class ChartService {
9292
y: summedUpY,
9393
type: 'scatter',
9494
mode: 'lines+points',
95-
marker: {color: 'cyan'}
95+
marker: {color: 'cyan'},
96+
name: 'result curve'
9697
}
9798
data.push(newCurveData);
9899
}
99100

100101
return data;
101102
}
102103

103-
private generateGraphData(settings) {
104+
private generateGraphData(settings, curveId) {
104105
let stepSize = 0.03;
105106

106107

@@ -117,7 +118,8 @@ export class ChartService {
117118
y: yCoordinates,
118119
type: 'scatter',
119120
mode: 'lines+points',
120-
marker: {color: GRAPH_COLORS[settings.curveId]}
121+
marker: {color: GRAPH_COLORS[settings.id]},
122+
name: (curveId + 1).toString() + '# curve'
121123
}
122124
return data;
123125
}

‎src/app/curve-selection-view/curve-selection-view.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div class="curve-selection-parent">
22
<div class="curve-info" *ngFor="let curve of curves">
3-
<h3>Curve: {{ curve.id + 1 }} </h3>
3+
<h3>Curve: {{ curve.id + 1 }} </h3>
44
<h4>Amplitude: {{ curve.curveSettings.amplitude}} </h4>
5-
<h4>Amplitude: {{ curve.curveSettings.frequency}} </h4>
5+
<h4>Frequency: {{ curve.curveSettings.frequency}} </h4>
66
<h4>Phase shift: {{ curve.curveSettings.shift}} </h4>
77
<h4>Active: {{ curve.curveSettings.active }} </h4>
88
<button (click)="selectCurve(curve.id)" class="standard-btn"> Select </button>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.curve-selection-parent
22
height: 400px
33
background-color: rgb(40,40,40)
4-
float: left
5-
width: 70%
64
box-sizing: border-box
75
display: flex
86
flex-direction: row
@@ -11,6 +9,5 @@
119
.curve-info
1210
width: 400px
1311
height: 100%
14-
border: white 2px solid
1512
padding: 15px
1613
box-sizing: border-box

‎src/app/modulate-settings/modulate-settings.component.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="settings-parent">
2-
<h3>Settings</h3>
2+
<h3>Curve settings</h3>
33
<form [formGroup]="settingsForm" (ngSubmit)="onSubmit(settingsForm.value)" >
44
<div>
55
<label for="curveType">
@@ -15,28 +15,28 @@ <h3>Settings</h3>
1515

1616
<div>
1717
<label for="amplitude">
18-
Amp
18+
Amplitude:
1919
</label>
2020
<input id="amp" type="number" formControlName="amplitude" />
2121
</div>
2222

2323
<div>
2424
<label for="frequency">
25-
Freq
25+
Frequency:
2626
</label>
2727
<input id="freq" type="number" formControlName="frequency" />
2828
</div>
2929

3030
<div>
3131
<label for="shift">
32-
Shft
32+
Phase shift:
3333
</label>
3434
<input id="shft" type="number" formControlName="shift" />
3535
</div>
3636

3737
<div>
3838
<label for="active">
39-
Active
39+
Active & visible
4040
</label>
4141
<input id="active" type="checkbox" formControlName="active" />
4242
</div>

‎src/app/modulate-settings/modulate-settings.component.sass

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,32 @@
22
background-color: rgb(40,40,40)
33
height: 100%
44
min-height: 400px
5+
min-width: 250px
56
padding: 10px
6-
width: 30%
7-
float: left
87
box-sizing: border-box
9-
border-left: white 2px solid
108

119
form
1210
width: 100%
13-
height: 100%
11+
1412
display: flex
1513
flex-direction: column
16-
justify-content: center
14+
justify-content: flex-start
1715
align-items: center
1816

1917
div
20-
width: 100px
18+
display: flex
19+
flex-direction: row
20+
justify-content: space-between
21+
width: 100%
2122
height: 40px
2223
margin-bottom: 10px
2324

25+
label
26+
width: 100px
27+
min-width: 100px
28+
align-self: center
2429
input
2530
width: 50px
26-
27-
input, label
2831
height: 100%
2932

3033

0 commit comments

Comments
 (0)