ra-dec-picker
v0.0.9
Published
A simple RA/Dec picker for astronomical coordinates, allowing users to input Right Ascension and Declination values easily.
Downloads
28
Maintainers
Readme
RA Dec Picker
A simple and user-friendly RA/Dec picker for astronomical coordinates. This package allows users to easily input Right Ascension (RA) and Declination (Dec) values.
Features
- Easy-to-use input fields for RA and Dec values.
- Validations for user inputs to ensure correctness.
- Lightweight and simple integration into your web projects.
Installation
To install the package, use npm:
npm install ra-dec-picker
Usage
Include the CSS and JS files in your project. Initialize the picker by targeting a container element.
<div id="ra-dec-picker-container"></div>
import RaDecPicker from 'ra-dec-picker';
const container = document.getElementById('ra-dec-picker-container');
if (container) {
new RaDecPicker(container, (result) => {
console.log('RA:', result.ra);
console.log('Dec:', result.dec);
});
}
});```
## Validation
The RA and Dec inputs include validation to ensure the following:
RA values are within valid ranges (0 to 23 hours, 0 to 59 minutes, 0 to 59 seconds).
Dec values are within valid ranges (-90 to 90 degrees, 0 to 59 arc minutes, 0 to 59 arc seconds).