Astronomy sky charts viewer application
Astronomy sky charts browsing application
This application allows to view sky maps using a Web browser:
It provides various possibilities for showing different layers and changing graphical appearance:
It is written in Angular/TypeScript and should work in any modern Web browser.
It was implemented just for fun, by an amateur astronomer. But it can be used to visualize sky charts for whatever purpose you want, and extended by adding more visualizable objects.
The application has been designed keeping in mind to make it flexible and provide a possibility for different further usages. For example, we can imagine it to be extended and reused in:
You can navigate in the map by dragging it with the mouse or by using UI controls. The layers visibility can be toggled and the field of view in the viewport adjusted for your needs, using the UI control buttons.
The main viewport is interactive:
The UI controls sidebar is toggled by clicking the tools button at the top left corner of the view:
All elements of the UI controls have tool tips. All their functionalities can be summarized as follows:
Theme drop-down: selection of graphical theme for the main view.
Go To selection: type an object code (‘lyr’), name (‘Sirius’) or sky coordinate in decimal degrees (‘185 -60’) to center the view on your point of interest.
Objects selection: toggle the display of available layers and their properties.
View properties:
The Visual Studio Code IDE is recommended.
The following VSC extensions are also recommended:
./.editorconfig
file.For the tools/data processing part, any IDE supporting Java+Maven projects may be used. However, IntelliJ IDEA CE was used for the development.
Currently, the application does not have a specific back-end part. All the served resources are static and they are generated using the ./tools/data-import
sub-project.
NodeJS v5.6.0+ must be installed in order to lauch the application in development mode.
The following commands runnable with npm {command}
or npm run {command}
are defined in package.json
:
clean
: removes the contents of the current dist
directory, supposed to contain the last production build files.start
: executes a build in development mode and launches the server on http://localhost:4200
.build:dev
: executes a build in the development mode, without starting the server.build:prod
: cleans the current distribution files and executes a build in the production mode. The resulting files are placed in the ./dist
folder.test
: executes the unit tests.lint
: executes linting checks.Quickstart after cloning the source repository:
npm install
to retrieve all the necessary dependencies.npm start
command should launch the application at http://localhost:4200
.The commands above should work equally from the VSC integrated terminals or from any terminal/CLI tools.
When the command build:prod
is issued, the build sequence adds a prefix to the URLs handled by the application. This is done by passing --base-href /astrocadre --deploy-url /astrocadre/
args to ng build --prod
command in package.json
.
All the paths to the assets are also processed by using environment.pathInContext
function (from environments/environment[.prod].ts
), which appends the prefix depending on the build target.
The project is structured as follows:
./
|- /dist // distribution files for production deployment
|- /doc // additional documentation
|- /src // the source code and related files
| |- /app // main and test source code files
| |- /assets // static resources served by the back-end of the app
| |- /environments // environment configuration files
| |- /raw // raw source files for assets, excluded from dist
| |- main.ts // main entry point of the application
| |- test.ts // test entry point of the application
|- /tools
| |- /data-import // static resources generation utility
| | |- README.md // documentation for the tools
|- LICENSE // license file
|- README.md // this README file
|- {other configuration files}
./tools/data-import
contains a Maven project written in Java, allowing to generate static resource JSON files with stellar and other data used in the application. The generated files are placed into ./src/assets
folder and then included into the distribution. For more information about how to generate the static resources and their format, please check the respective README.md
file in ./tools/data-import
.
The graphic properties of the application can be configured by providing a few JSON files placed in /src/assets/themes
.
The themes allow to switch easily between different sets of graphical representation. For example, the following series of images contain exactly the same view, rendered with various themes.
Sky Chart
theme:Wikipedia
theme:Night View
theme:Tiny
theme:All available graphic themes are described in the src/assets/themes/themes.json
file. To add a new theme definition, the following structure should be appended to the JSON array:
{
"code": "theme-code", // mandatory, should be alphanumeric, without spaces.
"label": "Theme label", // optinal, the label to show in the UI controls.
"description": "description", // optional description shown in the UI controls.
}
To remove an existing theme, simply delete the respective JSON object from the array.
The first item of the array is the theme loaded by default when the application starts.
For each theme declared in the themes.json
file, a corresponding configuration file must exist in the same folder. The name of the file must be {code}.json
, where {code}
is the value used as the code
property in themes.json
. For example, for the theme metadata definition above, there must be a file named theme-code.json
.
The theme configuration file should respect the following structure (cf src/app/modules/core/models/theme/theme.ts
):
{
"code": "string", // redundant with respective "code" value from themes.json
"background": BackgroundStyle;
"layers": Array<LayerStyle>; // an extension of the LayerStyle interface is expected
// in each layer module in the models/theme folder.
}
For more details on the configuration, please check the documentation in the *-style.ts
files in the models/theme
folders of each layer module.
This project started in April 2018 and an initial prototype was published in June 2018 (version 18.6).
After having acquired more experience in the front-end development with Angular and TypeScript, the author
started a huge refactoring & update of the project in February 2021. It allowed to publish a much cleaner and improved version of the application in April 2021 (version 21.4).
More details on the evolution of the project are available in the changelog and in the follow-up documentation.
The most recent validated version of the project is available on the master
branch.
The development branches should be prefixed with dev-
. When a feature is implemented on its dev
branch, a
pull request should be created in order to review and merge it.
This software is distributed under MIT license conditions.
Please check more details in LICENSE
file.
© 2018 - 2021 Anton Telechev