Skip to content

Commit 0b23044

Browse files
authored
Updated star catalog, first-day-of-week option. (#21)
* Updated star catalog. * Added optional first-day-of-week for calendars. * Fixed screen layout problem caused by delayed loading of CSS. * Fixed build warnings.
1 parent ad68d2b commit 0b23044

14 files changed

Lines changed: 2508 additions & 2070 deletions

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Sky View Café
22

3-
Copyright © 2017-2021 Kerry Shetline, kerry@shetline.com
3+
Copyright © 2016-2022 Kerry Shetline, kerry@shetline.com
44

55
### Licensing
66

package-lock.json

Lines changed: 2399 additions & 2025 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svc-ng",
3-
"version": "1.14.5",
3+
"version": "1.14.6",
44
"license": "MIT AND GPL-3.0-or-later",
55
"author": "Kerry Shetline <kerry@shetline.com>",
66
"scripts": {
@@ -10,60 +10,62 @@
1010
"build-debug": "ng build --sourceMap=true",
1111
"test": "ng test",
1212
"lint": "eslint 'src/**/*.ts'",
13-
"e2e": "ng e2e"
13+
"e2e": "ng e2e",
14+
"postinstall": "patch-package"
1415
},
1516
"private": true,
1617
"dependencies": {
17-
"@angular/animations": "^13.1.0",
18-
"@angular/cdk": "^13.1.0",
19-
"@angular/common": "^13.1.0",
20-
"@angular/compiler": "^13.1.0",
21-
"@angular/core": "^13.1.0",
18+
"@angular/animations": "^13.1.2",
19+
"@angular/cdk": "^13.1.2",
20+
"@angular/common": "^13.1.2",
21+
"@angular/compiler": "^13.1.2",
22+
"@angular/core": "^13.1.2",
2223
"@angular/flex-layout": "^13.0.0-beta.36",
23-
"@angular/forms": "^13.1.0",
24-
"@angular/platform-browser": "^13.1.0",
25-
"@angular/platform-browser-dynamic": "^13.1.0",
26-
"@angular/router": "^13.1.0",
24+
"@angular/forms": "^13.1.2",
25+
"@angular/platform-browser": "^13.1.2",
26+
"@angular/platform-browser-dynamic": "^13.1.2",
27+
"@angular/router": "^13.1.2",
2728
"@fortawesome/fontawesome-free": "^5.15.4",
2829
"@tubular/array-buffer-reader": "^3.0.2",
29-
"@tubular/astronomy": "^3.0.14",
30+
"@tubular/astronomy": "^3.1.0",
3031
"@tubular/math": "^3.1.0",
31-
"@tubular/ng-widgets": "^2.0.2",
32+
"@tubular/ng-widgets": "^2.0.3",
3233
"@tubular/time": "^3.8.0",
33-
"@tubular/util": "^4.5.1",
34+
"@tubular/util": "^4.6.0",
3435
"core-js": "^2.6.12",
3536
"detect-resize": "^0.1.5",
3637
"lodash-es": "^4.17.21",
3738
"primeicons": "^5.0.0",
38-
"primeng": "^13.0.2",
39+
"primeng": "^13.0.4",
3940
"rxjs": "^6.6.7",
4041
"zone.js": "~0.11.4"
4142
},
4243
"devDependencies": {
43-
"@angular-devkit/build-angular": "^13.1.1",
44-
"@angular/cli": "^13.1.1",
45-
"@angular/compiler-cli": "^13.1.0",
46-
"@angular/language-service": "^13.1.0",
44+
"@angular-devkit/build-angular": "^13.1.3",
45+
"@angular/cli": "^13.1.3",
46+
"@angular/compiler-cli": "^13.1.2",
47+
"@angular/language-service": "^13.1.2",
4748
"@types/googlemaps": "^3.43.3",
48-
"@types/jasmine": "^3.10.2",
49+
"@types/jasmine": "^3.10.3",
4950
"@types/jasminewd2": "^2.0.10",
5051
"@types/lodash-es": "^4.17.5",
51-
"@typescript-eslint/eslint-plugin": "^5.6.0",
52-
"@typescript-eslint/parser": "^5.6.0",
52+
"@typescript-eslint/eslint-plugin": "^5.9.1",
53+
"@typescript-eslint/parser": "^5.9.1",
5354
"codelyzer": "^6.0.2",
5455
"eslint": "^7.32.0",
5556
"eslint-config-standard": "^16.0.3",
56-
"eslint-plugin-import": "^2.25.3",
57+
"eslint-plugin-import": "^2.25.4",
5758
"eslint-plugin-node": "^11.1.0",
5859
"jasmine-core": "~3.10.1",
5960
"jasmine-spec-reporter": "~7.0.0",
60-
"karma": "^6.3.9",
61+
"karma": "^6.3.11",
6162
"karma-chrome-launcher": "~3.1.0",
6263
"karma-coverage-istanbul-reporter": "~3.0.3",
6364
"karma-jasmine": "~4.0.1",
6465
"karma-jasmine-html-reporter": "^1.7.0",
66+
"patch-package": "^6.4.7",
6567
"protractor": "~7.0.0",
6668
"ts-node": "^10.4.0",
67-
"typescript": "~4.5.3"
69+
"typescript": "^4.5.4"
6870
}
6971
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@tubular/astronomy/dist/fesm2015/index.js b/node_modules/@tubular/astronomy/dist/fesm2015/index.js
2+
index af3a8cc..d19e3b0 100644
3+
--- a/node_modules/@tubular/astronomy/dist/fesm2015/index.js
4+
+++ b/node_modules/@tubular/astronomy/dist/fesm2015/index.js
5+
@@ -374,7 +374,7 @@ le.behindDisc=le.withinDisc&&!le.inferior,i[e]=le);return i}static solveOuterMoo
6+
;i=t?zA.solarSystem.getGreenwichApparentSiderealTime(e):DA.getGreenwichMeanSiderealTime(e),this.cachedHourAngle=new l(i,r.DEGREES).add_nonneg(this._longitude),this.cacheTimeHourAngle=e,this.cacheApparentHourAngle=t}return this.cachedHourAngle}getApparentSolarTime(e){const t=this.getLocalHourAngle(e,!0),i=A(e),s=zA.solarSystem.getEquatorialPosition(0,i,this).rightAscension;return t.subtract(s).add_nonneg(l.STRAIGHT)}equatorialTopocentricAdjustment(e,t,i){
7+
const A=s(t),C=this.getLocalHourAngle(A,0!=(4&i)).radians,B=e.radius,n=u(8.79412/3600/180*D)/B;let a=e.rightAscension.radians;const o=e.declination.radians,r=C-a;let l=h(-this.ρ_cos_gcl*n*u(r),c(o)-this.ρ_cos_gcl*n*c(r)),g=h((u(o)-this.ρ_sin_gcl*n)*c(l),c(o)-this.ρ_cos_gcl*n*c(r));if(0!=(128&i))if(a+=l,m(g)>d-485e-8){l=0;const e=d-m(g),t=1551e-9*this._latitude.cos,i=c(a)*e-u(C)*t,A=u(a)*e+c(C)*t,s=p(i*i+A*A);a=h(A,i),g=(d-s)*O(g)}else l=1551e-9*this._latitude.cos*c(r)/c(g),
8+
g+=1551e-9*this._latitude.cos*u(g)*u(r);return new f(a+l,g,B)}equatorialToHorizontal(e,t,i=0){const A=this.getLocalHourAngle(t,0!=(4&i)).radians,s=e.rightAscension.radians,C=e.declination.radians,B=A-s,n=h(u(B),c(B)*this._latitude.sin-y(C)*this._latitude.cos);let a=g(E(this._latitude.sin*u(C)+this._latitude.cos*c(C)*c(B)));const r=a;if(0!=(16&i)&&(a=G(tA(Ae(a)))),e instanceof f){let t=e.radius;if(0!=(8&i)){const e=6356.755+(6378.14-6356.755)*this._latitude.cos+this.elevation/1e3;t-=u(r)*e/jt}
9+
-return new f(n,a,t)}return new o(n,a)}horizontalToEquatorial(e,t,i=0){const A=this.getLocalHourAngle(t,0!=(4&i)).radians;let s=e.altitude.radians;const C=e.azimuth.radians;0!=(16&i)&&(s=G(AA(Ae(s))));const B=A-h(u(C),c(C)*this._latitude.sin+y(s)*this._latitude.cos),n=g(E(this._latitude.sin*u(s)-this._latitude.cos*c(s)*c(C)));return new o(M(B,_),n)}}let XA,VA;try{XA=void 0!==typeof Buffer&&Buffer,VA=!!XA&&new Function("req",'return req("fs").readFile')("undefined"!=typeof require&&require)}catch(e){}
10+
+return new f(n,a,t)}return new o(n,a)}horizontalToEquatorial(e,t,i=0){const A=this.getLocalHourAngle(t,0!=(4&i)).radians;let s=e.altitude.radians;const C=e.azimuth.radians;0!=(16&i)&&(s=G(AA(Ae(s))));const B=A-h(u(C),c(C)*this._latitude.sin+y(s)*this._latitude.cos),n=g(E(this._latitude.sin*u(s)-this._latitude.cos*c(s)*c(C)));return new o(M(B,_),n)}}let XA,VA;try{XA=void 0!==typeof Buffer&&Buffer,VA=!!XA&&new Function("req",'return req("fs").readFile')("undefined"!=typeof reqwire&&reqwire)}catch(e){}
11+
var $A,KA;!function(e){e[e.FK5=0]="FK5",e[e.BSC=1]="BSC",e[e.HIP=2]="HIP"}($A||($A={})),function(e){e[e.INC_FK5=255]="INC_FK5",e[e.NEW_STATE=254]="NEW_STATE",e[e.DBL_PREC=253]="DBL_PREC",e[e.SNG_PREC=252]="SNG_PREC"}(KA||(KA={}))
12+
;const JA="And~Andromeda~Gam,Bet,Del,Alp,Pi,Mu,Xi,51\nAnt~Antlia~Iot,Alp,The,Eps\nAps~Apus~Bet,Gam,Del-1,Alp\nAql~Aquila~12,Lam,Del,The,Bet,Alp,Gam,Zet,Del;Zet,Eps\nAqr~Aquarius~88,Del,Tau-2,Lam,Phi,Eta,Zet,Gam,Alp,Bet,Mu,Eps;Iot,The,Alp\nAra~Ara~Del,Gam,Bet,Alp,Eps-1,Zet,Eta;Gam,Zet;The,Alp\nAri~Aries~41,Alp,Bet,Gam\nAur~Auriga~Alp,Eps,Eta,Iot,Bet (Tau),The,Bet,Alp\nBoo~Boötes~Zet,Alp,Eps,Del,Bet,Gam,Rho,Alp,Eta\nCae~Caelum~Alp,Bet\nCam~Camelopardalis~7,Bet,Alp,Gam;Alp,36,43\nCap~Capricornus~Alp-1,Bet,Psi,Ome,24,Zet,Eps,Del,Gam,Iot,The,Bet\nCar~Carina~Ups,Bet,Ome,The,FK5:397,FK5:1264,Iot,Eps,Chi,Alp\nCas~Cassiopeia~Eps,Del,Gam,Alp,Bet\nCen~Centaurus~Kap,Eta,Nu,BSC:5089,Iot;The,Nu,Mu,Zet,Eps,Alp;Bet,Eps,Gam,Sig,Del,Rho,Pi,FK5:443,Lam\nCep~Cepheus~Del,Eps,Zet,Iot,Gam,Bet,Alp,Zet;Alp,Eta,The\nCet~Cetus~Gam,Alp,Lam,Mu,Xi-2,Nu,Gam,Del,Omi,Zet,Tau,Bet,Iot,Eta,The,Zet\nCha~Chamaeleon~Bet,Gam,Alp,The,Del-2\nCir~Circinus~Gam,Alp,Bet\nCMa~Canis Major~Eta,Del,Omi-2,Alp,Bet;Eps,Sig,Alp\nCMi~Canis Minor~Alp,Bet\nCnc~Cancer~Alp,Del,Iot;Del,Bet\nCol~Columba~Del,Kap,Gam,Bet,Eta;Bet,Alp,Eps\nCom~Coma Berenices~Alp,Bet,Gam\nCrA~Corona Australis~Zet,Del,Bet,Alp,Gam,Eps\nCrB~Corona Borealis~Iot,Eps,Del,Gam,Alp,Bet,The\nCrt~Crater~Eta,Zet,Gam,Del,Eps,The;Gam,Bet,Alp,Del\nCru~Crux~Alp,Gam;Bet,Del\nCrv~Corvus~Alp,Eps,Gam,Del,Bet,Eps\nCVn~Canes Venatici~Alp,Bet\nCyg~Cygnus~Alp,Gam,Bet;Zet,Eps,Gam,Del,Iot-2,Kap\nDel~Delphinus~Eps,Bet,Alp,Gam,Del,Bet\nDor~Dorado~Del,Bet,Zet,Alp,Gam;BSC:2102,Bet\nDra~Draco~Xi,Nu,Bet,Gam,Xi,Del,Eps,Tau,Chi,Psi,Zet,Eta,@The,Iot,Alp,Kap,Lam\nEqu~Equuleus~Alp,Bet,Del,Gam,Alp\nEri~Eridanus~Lam,Bet,Ome,Mu,Nu,Omi-1,Gam,Pi,Del,Eps,Zet,Eta,@Tau-1,Tau-3,Tau-4,Tau-5,Tau-6,Tau-8,Tau-9,Ups-1,Ups-2,43,Ups-4,The,Iot,Kap,Phi,Chi,Alp\nFor~Fornax~Alp,Bet,Nu\nGem~Gemini~Xi,Gam,Nu,Mu,Eps,Tau,Rho,Alp,Sig,Bet,Kap,Del,Zet,Gam;Lam,Del;Eta,Mu\nGru~Grus~Alp,Bet,Iot,The;Zet,Eps,Bet,Del-2,Mu-1,Lam,Gam\nHer~Hercules~Alp,Bet,Gam;Bet,Zet,Eta,Sig,Tau,Phi,Chi;Zet,Eps,Pi,Eta;Pi,Rho,The,Iot;Eps,Del,Lam,Mu,Xi,Omi\nHor~Horologium~Alp,BSC:868,Zet,Mu,Bet\nHya~Hydra~Pi,Gam,Bet,Xi,Nu,@Mu,Lam,Ups-1,Alp,Iot,The,Zet,Eta,Sig,Del,Eps,Zet\nHyi~Hydrus~Alp,Bet,Gam,Alp\nInd~Indus~Alp,The,Del;The,Bet\nLac~Lacerta~1,FK5:1583,6,2,5,4,Alp,Bet\nLeo~Leo~Eps,Mu,Zet,Gam,Eta,Alp,The,Bet,Del,Gam\nLep~Lepus~Del,Gam,Bet,Alp,Zet,Eta;Eps,Bet;Alp,Mu\nLib~Libra~48,The,Gam,Bet,Sig,Ups,Tau;Sig,Alp-2,Bet\nLMi~Leo Minor~46,Bet,21\nLup~Lupus~The,Eta,Gam,Del,Phi-1,Chi\nLyn~Lynx~Alp,38,FK5:339,31,21,15,2\nLyr~Lyra~Eps-2,Alp,Zet,Bet,Gam,Del-2,Zet\nMen~Mensa~Alp,Gam,Eta,Bet\nMic~Microscopium~The-1,Eps,Gam,Alp\nMon~Monoceros~Zet,Alp,Del,18,8 Eps,13;Del,Bet,Gam\nMus~Musca~Bet,Alp,Gam;Del,Alp,Eps,Lam\nNor~Norma~Eps,Gam-2,Eta\nOct~Octans~Bet,Del,Nu,Bet\nOph~Ophiuchus~45,The,44,Xi,Eta,Bet,Alp,Kap,Del,Eps,Ups,Zet,Eta;70,67,Gam,Bet;Gam,Nu\nOri~Orion~Alp,Zet,Kap,Bet,Del,Gam,Lam,Alp,Mu,Xi,Nu,Chi-1;Xi,Chi-2;Pi-1,Pi-2,Pi-3,Gam;Pi-3,Pi-4,Pi-5,Pi-6\nPav~Pavo~Alp,Bet,Eps,Zet,Eta,Pi,Xi,Lam,Del,Bet,Gam\nPeg~Pegasus~Bet,Alp (And),Gam,Alp,Bet,Eta,Iot,Kap;Bet,Mu,Lam,9,1;Alp,Xi,Zet,The,Eps\nPer~Perseus~Omi,Zet,Xi,Eps,Del,Alp,Gam,Eta,Phi;Alp,Kap,Bet,Rho,16\nPhe~Phoenix~Del,Gam,Bet,Alp,Eps,Eta,Zet,Bet\nPic~Pictor~Alp,Gam,Bet\nPsA~Piscis Austrinus~Alp,Del,Gam,Bet,Mu,Iot,The,Lam,Eps,Alp\nPsc~Pisces~Tau,Ups,Phi,Eta,Omi,Alp,Nu,Mu,Eps,@Del,Ome,Iot,Lam,Kap,Gam,The,Iot\nPup~Puppis~Zet,Sig,Tau,Nu,Pi,Xi,Rho,Zet\nPyx~Pyxis~Bet,Alp,Gam\nRet~Reticulum~Alp,Bet,Del,Eps,Alp\nScl~Sculptor~Alp,Iot,Del,Gam,Bet\nSco~Scorpius~Lam,Kap,Iot-1,The,Eta,Zet-2,Mu-1,Eps,Tau,Alp,Sig,Del,Bet,Nu;Del,Pi,Rho\nSct~Scutum~Bet,Alp,Gam;Alp,Zet\nSer~Serpens Caput~Mu,Eps,Alp,Del,Bet,Kap,Gam,Bet\nSer~Serpens Cauda~The,Eta,Omi,Xi,Nu\nSex~Sextans~Bet,Alp,Gam\nSge~Sagitta~Eta,Gam,Zet,Alp;Zet,Bet\nSgr~Sagittarius~Alp,Iot,The-1,62,52,Tau,Zet,Eps,Eta;Bet-2,Iot;Tau,Sig,Omi,Pi,Rho-1;Zet,Phi,Sig;Mu,Lam,Phi,Del,Gam-2,3;Lam,Del,Eps;Eps,Gam-2\nTau~Taurus~Bet,Tau,Eps,Del,Gam,Lam,Xi,Omi;Zet,Alp,The,Gam\nTel~Telescopium~Zet,Alp,Eps\nTrA~Triangulum Australe~Alp,Bet,Gam,Alp\nTri~Triangulum~Alp,Bet,Gam,Alp\nTuc~Tucana~Del,Alp,Gam,Bet-1,Zet,Eps,Gam\nUMa~Ursa Major~Eta,Zet,Eps,Del,Alp,Bet,Gam,Del;Kap,Iot,The,Ups,Omi,23,Alp;Ups,Bet;Gam,Chi,Nu,Xi;Chi,Psi,Mu,Lam\nUMi~Ursa Minor~Alp,Del,Eps,Zet,Bet,Gam,Eta,Zet\nVel~Vela~Gam,Del,Kap,Phi,Mu,BSC:4167,FK5:1273,FK5:382,Psi,Lam,BSC:3477,FK5:324,Gam\nVir~Virgo~Mu,Iot,Kap,Alp,The,Gam,Del,Zet,Alp;109,Tau,Zet;Eps,Del;Gam,Eta,Bet\nVol~Volans~Alp,Bet,Eps,Zet,Gam,Del,Eps\nVul~Vulpecula~13,Alp,1",YA=-1,WA=-2
13+
;function QA(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}class es{constructor(e,t){if(this.bscLookup={},this.cachedPositions=[],this.constellations=[],this.ecliptic=new Fi,this.fk5Lookup={},this.hipLookup={},this.messierLookup={},this.ngcIcLookup={},this.nameLookup={},this.properlyInitialized=!1,this.starNames={},this.sunCacheTime=-1e10,this.sunLongitudeCache=-1,this.stars=[],XA){if(e instanceof XA)return this.readStarData(QA(e)),void(t&&t(this.properlyInitialized))

src/app/app.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div class="about-dialog">
55
<img src="/assets/resources/svc_lunar_eclipse.png" alt="lunar eclipse" width="64" height="64">
66
<h2>Sky View Café NP</h2>
7-
Version 1.14.5<br><br>
8-
Copyright © 2016-2021 Kerry Shetline.
7+
Version 1.14.6<br><br>
8+
Copyright © 2016-2022 Kerry Shetline.
99
</div>
1010
</p-dialog>
1111
<svc-native-date-time-dialog [(visible)]="app.showNativeInputDialog"></svc-native-date-time-dialog>
@@ -59,6 +59,7 @@ <h2>Sky View Café NP</h2>
5959
<tbw-calendar #calendar
6060
[(ngModel)]="date"
6161
[timezone]="timezone"
62+
[firstDay]="firstDay"
6263
[gregorianChangeDate]="gcDate"
6364
showDst
6465
[minYear]="SVC_MIN_YEAR"

src/app/app.component.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { AfterViewInit, Component, HostListener, OnDestroy } from '@angular/core';
1+
import { AfterViewInit, Component, ElementRef, HostListener, OnDestroy } from '@angular/core';
22
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
33
import { Router } from '@angular/router';
44
import { AstroEvent, EventFinder, FIRST_QUARTER, FULL_MOON, LAST_QUARTER, NEW_MOON } from '@tubular/astronomy';
55
import { max, min, Point } from '@tubular/math';
66
import { CalendarDateInfo, TimeEditorOptions, YearStyle } from '@tubular/ng-widgets';
7-
import { DateTime, Timezone, YMDDate } from '@tubular/time';
7+
import { DateTime, defaultLocale, getStartOfWeek, Timezone, YMDDate } from '@tubular/time';
88
import { isEqual, toggleFullScreen } from '@tubular/util';
99
import { debounce } from 'lodash-es';
1010
import { MenuItem, MessageService } from 'primeng/api';
@@ -14,6 +14,8 @@ import {
1414
PROPERTY_GREGORIAN_CHANGE_DATE, PROPERTY_NATIVE_DATE_TIME, SVC_MAX_YEAR, SVC_MIN_YEAR, UserSetting, VIEW_APP
1515
} from './app.service';
1616
import { SvcAtlasService } from './svc/svc-atlas.service';
17+
import { addResizeListener, removeResizeListener } from 'detect-resize';
18+
import { PROPERTY_FIRST_DAY_OF_WEEK, VIEW_CALENDAR } from './svc/svc-calendar-view/svc-calendar-view.component';
1719

1820
const MIN_APP_WIDTH = 1040;
1921
const MIN_APP_HEIGHT = 640;
@@ -56,6 +58,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
5658
clockCaption = '\xA0';
5759
displayAbout = false;
5860
displayPreferences = false;
61+
firstDay = getStartOfWeek(defaultLocale);
5962
floatingClockFontSize = FLOAT_CLOCK_MAX_FONT_SIZE_EMS;
6063
gcDate = '1582-10-15';
6164
nativeDateTime = false;
@@ -66,7 +69,8 @@ export class AppComponent implements AfterViewInit, OnDestroy {
6669
private router: Router,
6770
atlasService: SvcAtlasService,
6871
private messageService: MessageService,
69-
private sanitizer: DomSanitizer
72+
private sanitizer: DomSanitizer,
73+
private elemRef: ElementRef
7074
) {
7175
this.time = app.time;
7276

@@ -90,12 +94,15 @@ export class AppComponent implements AfterViewInit, OnDestroy {
9094
else if (setting.property === PROPERTY_NATIVE_DATE_TIME)
9195
this.nativeDateTime = setting.value as boolean;
9296
}
97+
else if (setting.view === VIEW_CALENDAR && setting.property === PROPERTY_FIRST_DAY_OF_WEEK)
98+
this.firstDay = (setting.value as number) < 0 ? getStartOfWeek(defaultLocale) : setting.value as number;
9399
});
94100

95101
app.getCurrentTabUpdates(tabIndex => this.selectedTab = tabIndex);
96102
}
97103

98104
ngAfterViewInit(): void {
105+
addResizeListener(this.elemRef.nativeElement, this.onResize);
99106
setTimeout(() => {
100107
this.doResize();
101108

@@ -108,6 +115,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
108115

109116
ngOnDestroy(): void {
110117
this.stopTimer();
118+
removeResizeListener(this.elemRef.nativeElement, this.onResize);
111119
}
112120

113121
stopTimer(): void {
@@ -268,7 +276,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
268276
toggleFullScreen();
269277
}
270278

271-
@HostListener('window:resize') private onResize(): void {
279+
@HostListener('window:resize') private onResize = (): void => {
272280
if (!this.debouncedResize)
273281
this.debouncedResize = debounce(() => this.doResize(), 1000);
274282

src/app/svc/generic-planetary-view.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export abstract class GenericPlanetaryViewDirective extends GenericViewDirective
522522
let crowdedDso = false;
523523

524524
if (li.labelType === LABEL_TYPE.DSO) {
525-
const ngc = dc.sc.getNGCNumber(-1 - li.bodyIndex);
525+
const ngc = dc.sc.getNgcNumber(-1 - li.bodyIndex);
526526
crowdedDso = (ngc === 869 || ngc === 884);
527527
}
528528

src/app/svc/generic-sky-view.directive.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { strokeEllipse } from '@tubular/util';
55
import { reverse, sortBy } from 'lodash-es';
66
import { AppService, CurrentTab } from '../app.service';
77
import {
8-
DrawingContextPlanetary, FAR_AWAY, GenericPlanetaryViewDirective, highlightedStarColor, LABEL_TYPE, NONPLANET, SELECTION_TYPE,
8+
DrawingContextPlanetary, FAR_AWAY, GenericPlanetaryViewDirective, highlightedStarColor, LABEL_TYPE, LabelInfo, NONPLANET, SELECTION_TYPE,
99
SortablePlanet, SUBJECT
1010
} from './generic-planetary-view.directive';
1111

@@ -83,10 +83,10 @@ export abstract class GenericSkyViewDirective extends GenericPlanetaryViewDirect
8383

8484
protected drawConstellations(dc: DrawingContextPlanetary): void {
8585
let minD = FAR_AWAY;
86-
let selectedLabel;
86+
let selectedLabel: LabelInfo;
8787

88-
for (let i = 0; i < dc.sc.getConstellationCount(); ++i) {
89-
const starList = dc.sc.getConstellationDrawingStars(i);
88+
dc.sc.forEachConstellation(cInfo => {
89+
const starList = cInfo.starList;
9090
let starCount = 0;
9191
let breakLine = true;
9292
let minX = Number.MAX_SAFE_INTEGER, minY = Number.MAX_SAFE_INTEGER;
@@ -138,7 +138,7 @@ export abstract class GenericSkyViewDirective extends GenericPlanetaryViewDirect
138138
const pt = { x: this.scaledRound((minX + maxX) / 2), y: this.scaledRound((minY + maxY) / 2) };
139139

140140
if (this.withinPlot(pt.x, pt.y, dc)) {
141-
const name = dc.sc.getConstellationName(i).toUpperCase();
141+
const name = cInfo.name.toUpperCase();
142142
const li = { name: name, pt: pt, labelType: LABEL_TYPE.CONSTELLATION, bodyIndex: NO_MATCH };
143143

144144
if (this.lastMoveX < 0 || this.lastMoveY < 0)
@@ -156,7 +156,7 @@ export abstract class GenericSkyViewDirective extends GenericPlanetaryViewDirect
156156
}
157157
}
158158
}
159-
}
159+
});
160160

161161
if (selectedLabel)
162162
this.addLabel(selectedLabel, dc);

src/app/svc/svc-calendar-view/svc-calendar-view-options.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
</div>
2222
</div>
2323
<hr>
24+
<ks-dropdown fxFlex="0 0 auto" [options]="firstDays" [(ngModel)]="firstDay"></ks-dropdown>
25+
<div class="first-day-caption">first day of week</div>
2426
<ks-checkbox fxFlex="0 0 auto" [(ngModel)]="keyMoonPhases" binary="true" label="Key Moon phases"></ks-checkbox>
2527
<ks-checkbox fxFlex="0 0 auto" [(ngModel)]="equisolstice" binary="true" label="Equinox/Solstice"></ks-checkbox>
2628
<ks-checkbox fxFlex="0 0 auto" [(ngModel)]="dailyDaylight" binary="true" label="Daily daylight"></ks-checkbox>

src/app/svc/svc-calendar-view/svc-calendar-view-options.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "../../../styles";
2+
13
hr {
24
width: 12em;
35
border: 1px #D8D8D8 solid;
@@ -23,3 +25,8 @@ hr {
2325
text-align: center;
2426
vertical-align: middle;
2527
}
28+
29+
.first-day-caption {
30+
@extend .small-caption;
31+
text-align: center;
32+
}

0 commit comments

Comments
 (0)