-
-
Notifications
You must be signed in to change notification settings - Fork 97
Docs: explain degree display (whole degrees only) and how to get degrees + minutes #117
Description
Context
Issue #87 asks: "How can I add a second number to the degree you are showing next to planet signs? (e.g. instead of 2, show 2 deg 10 min where 2 and 10 are degrees and minutes)"
Issue #82 comments also ask how to display degrees of planets and cusps.
The library currently renders only the whole degree within the sign (0-29) next to each planet. Minutes are never shown. There is no documentation explaining this limitation, why it works this way, or what alternatives exist.
What is missing from the docs
- No page explains that only whole degrees are displayed (e.g. a planet at 12.75 degrees shows "12").
- No page mentions Zodiac.toDMS(), the built-in helper that converts a decimal degree to a "deg min sec" string.
- There is no guidance on how to obtain and display a degree+minutes value externally (e.g. in a tooltip or legend alongside the chart).
What should be added
In the Radix Chart guide or a new "Reading the Chart" page
Add a section explaining what text labels are rendered next to each planet:
- Degree within sign: whole number 0-29 (e.g. a planet at 42.5 deg ecliptic longitude = 12 deg Taurus, shows "12")
- Retrograde marker: "R" when the planet velocity value is negative
- Dignity letter: r/d/e/E/f when applicable (see dignity docs issue)
Note clearly that minutes and seconds are not rendered on the chart.
Explain Zodiac.toDMS()
Document the toDMS() helper method available on the Zodiac class:
import { Zodiac } from '@astrodraw/astrochart'
const zodiac = new Zodiac(cusps, settings)
zodiac.toDMS(12.75) // returns "12 deg 45' 0"
zodiac.toDMS(245.5) // returns "245 deg 30' 0"This can be used to build an external planet table or tooltip with full degree+minute precision.
Practical example: external position table
Show users how to display a position table alongside the chart:
import { Chart, Zodiac } from '@astrodraw/astrochart'
const data = {
planets: { Sun: [42.75, 0], Moon: [145.5, 0] },
cusps: [315, 35, 65, 92, 125, 155, 135, 215, 245, 272, 305, 335]
}
const chart = new Chart('chart', 600, 600)
chart.radix(data)
// Build a degree+minutes table separately
const zodiac = new Zodiac(data.cusps, {})
for (const [planet, [position]] of Object.entries(data.planets)) {
console.log(planet, zodiac.toDMS(position % 30))
}
// Sun 12 deg 45' 0
// Moon 25 deg 30' 0Note in the API reference (api/zodiac.md)
Add toDMS() to the Zodiac API reference if not already present.
Relevant links
- Original questions: I have a few questions. #87, Please write a proper documentation for this library. #82
- Degree rendering: project/src/radix.ts drawPoints() line with Math.floor(degrees) % 30
- toDMS source: project/src/zodiac.ts toDMS()