|
1 | 1 | --- |
2 | 2 | title: Settings Reference |
3 | | -description: All available AstroChart settings. |
| 3 | +description: Complete reference for all AstroChart settings. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Settings Reference |
7 | 7 |
|
8 | | -Customize AstroChart charts with the `Settings` object. |
| 8 | +All settings are passed as a plain object to the `Chart` constructor. Every key is optional — omitted keys fall back to the values listed here. |
9 | 9 |
|
10 | | -## Colors |
| 10 | +```typescript |
| 11 | +import { Chart } from '@astrodraw/astrochart' |
| 12 | +const chart = new Chart('chart', 600, 600, { /* settings here */ }) |
| 13 | +``` |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## General |
| 18 | + |
| 19 | +| Setting | Type | Default | Description | |
| 20 | +|---------|------|---------|-------------| |
| 21 | +| `SYMBOL_SCALE` | `number` | `1` | Global scale multiplier for all rendered symbols | |
| 22 | +| `COLOR_BACKGROUND` | `string` | `'#fff'` | SVG canvas background fill color | |
| 23 | +| `MARGIN` | `number` | `50` | Outer margin in pixels | |
| 24 | +| `PADDING` | `number` | `18` | Inner padding in pixels | |
| 25 | +| `SHIFT_IN_DEGREES` | `number` | `180` | Chart rotation offset; `180` places 0° on the left (West) | |
| 26 | +| `STROKE_ONLY` | `boolean` | `false` | Render all symbols as outlines — no fill | |
| 27 | +| `ADD_CLICK_AREA` | `boolean` | `false` | Add invisible click-target areas; required for click events | |
| 28 | +| `COLLISION_RADIUS` | `number` | `10` | Planet collision-avoidance radius in px (at `SYMBOL_SCALE: 1`) | |
| 29 | +| `DEBUG` | `boolean` | `false` | Print internal debug information to the browser console | |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Points / Planets |
| 34 | + |
| 35 | +| Setting | Type | Default | Description | |
| 36 | +|---------|------|---------|-------------| |
| 37 | +| `POINTS_COLOR` | `string` | `'#000'` | Fill/stroke color for planet symbols | |
| 38 | +| `POINTS_TEXT_SIZE` | `number` | `8` | Font size in px for the text next to each planet (angle, retrograde, dignity) | |
| 39 | +| `POINTS_STROKE` | `number` | `1.8` | Stroke width for planet symbols | |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## Signs |
11 | 44 |
|
12 | 45 | | Setting | Type | Default | Description | |
13 | 46 | |---------|------|---------|-------------| |
14 | | -| `BACKGROUND_COLOR` | string | `'#ffffff'` | Chart background color | |
15 | | -| `PAPER_BORDER_COLOR` | string | `'#000000'` | Outer border color | |
16 | | -| `ZODIAC_SIGN_COLOR` | string | `'#666666'` | Zodiac sign color | |
| 47 | +| `SIGNS_COLOR` | `string` | `'#000'` | Color for zodiac sign symbols | |
| 48 | +| `SIGNS_STROKE` | `number` | `1.5` | Stroke width for zodiac sign symbols | |
| 49 | +| `COLOR_ARIES` | `string` | `'#FF4500'` | Sector color — Aries | |
| 50 | +| `COLOR_TAURUS` | `string` | `'#8B4513'` | Sector color — Taurus | |
| 51 | +| `COLOR_GEMINI` | `string` | `'#87CEEB'` | Sector color — Gemini | |
| 52 | +| `COLOR_CANCER` | `string` | `'#27AE60'` | Sector color — Cancer | |
| 53 | +| `COLOR_LEO` | `string` | `'#FF4500'` | Sector color — Leo | |
| 54 | +| `COLOR_VIRGO` | `string` | `'#8B4513'` | Sector color — Virgo | |
| 55 | +| `COLOR_LIBRA` | `string` | `'#87CEEB'` | Sector color — Libra | |
| 56 | +| `COLOR_SCORPIO` | `string` | `'#27AE60'` | Sector color — Scorpio | |
| 57 | +| `COLOR_SAGITTARIUS` | `string` | `'#FF4500'` | Sector color — Sagittarius | |
| 58 | +| `COLOR_CAPRICORN` | `string` | `'#8B4513'` | Sector color — Capricorn | |
| 59 | +| `COLOR_AQUARIUS` | `string` | `'#87CEEB'` | Sector color — Aquarius | |
| 60 | +| `COLOR_PISCES` | `string` | `'#27AE60'` | Sector color — Pisces | |
| 61 | +| `COLORS_SIGNS` | `string[]` | *(array of the 12 above in order)* | Ordered array of all 12 sign sector colors | |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Circles & Lines |
| 66 | + |
| 67 | +| Setting | Type | Default | Description | |
| 68 | +|---------|------|---------|-------------| |
| 69 | +| `CIRCLE_COLOR` | `string` | `'#333'` | Color of chart ring circles | |
| 70 | +| `CIRCLE_STRONG` | `number` | `2` | Stroke width for circles | |
| 71 | +| `LINE_COLOR` | `string` | `'#333'` | Color of house spoke lines | |
| 72 | +| `INDOOR_CIRCLE_RADIUS_RATIO` | `number` | `2` | `radius / INDOOR_CIRCLE_RADIUS_RATIO` determines the inner-most circle size | |
| 73 | +| `INNER_CIRCLE_RADIUS_RATIO` | `number` | `8` | `radius - radius/INNER_CIRCLE_RADIUS_RATIO` determines the planet ring inner edge | |
| 74 | +| `RULER_RADIUS` | `number` | `4` | `(radius / INNER_CIRCLE_RADIUS_RATIO) / RULER_RADIUS` determines degree ruler band width | |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Axis & Cusps |
| 79 | + |
| 80 | +| Setting | Type | Default | Description | |
| 81 | +|---------|------|---------|-------------| |
| 82 | +| `SYMBOL_AS` | `string` | `'As'` | Ascendant axis label text | |
| 83 | +| `SYMBOL_DS` | `string` | `'Ds'` | Descendant axis label text | |
| 84 | +| `SYMBOL_MC` | `string` | `'Mc'` | Midheaven axis label text | |
| 85 | +| `SYMBOL_IC` | `string` | `'Ic'` | Imum Coeli axis label text | |
| 86 | +| `SYMBOL_AXIS_FONT_COLOR` | `string` | `'#333'` | Color for As/Ds/Mc/Ic labels | |
| 87 | +| `SYMBOL_AXIS_STROKE` | `number` | `1.6` | Stroke width for axis labels | |
| 88 | +| `CUSPS_STROKE` | `number` | `1` | Stroke width for cusp dividing lines | |
| 89 | +| `CUSPS_FONT_COLOR` | `string` | `'#000'` | Color of cusp number labels | |
| 90 | +| `SYMBOL_CUSP_1` | `string` | `'1'` | Label for cusp 1 | |
| 91 | +| `SYMBOL_CUSP_2` | `string` | `'2'` | Label for cusp 2 | |
| 92 | +| `SYMBOL_CUSP_3` | `string` | `'3'` | Label for cusp 3 | |
| 93 | +| `SYMBOL_CUSP_4` | `string` | `'4'` | Label for cusp 4 | |
| 94 | +| `SYMBOL_CUSP_5` | `string` | `'5'` | Label for cusp 5 | |
| 95 | +| `SYMBOL_CUSP_6` | `string` | `'6'` | Label for cusp 6 | |
| 96 | +| `SYMBOL_CUSP_7` | `string` | `'7'` | Label for cusp 7 | |
| 97 | +| `SYMBOL_CUSP_8` | `string` | `'8'` | Label for cusp 8 | |
| 98 | +| `SYMBOL_CUSP_9` | `string` | `'9'` | Label for cusp 9 | |
| 99 | +| `SYMBOL_CUSP_10` | `string` | `'10'` | Label for cusp 10 | |
| 100 | +| `SYMBOL_CUSP_11` | `string` | `'11'` | Label for cusp 11 | |
| 101 | +| `SYMBOL_CUSP_12` | `string` | `'12'` | Label for cusp 12 | |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Symbol Text (Planets & Signs) |
| 106 | + |
| 107 | +These settings control which key name is used to look up each symbol in the built-in symbol renderer. Changing them only makes sense if you have custom symbol definitions that use different keys. |
17 | 108 |
|
18 | | -## Sizing |
| 109 | +| Setting | Type | Default | |
| 110 | +|---------|------|---------| |
| 111 | +| `SYMBOL_SUN` | `string` | `'Sun'` | |
| 112 | +| `SYMBOL_MOON` | `string` | `'Moon'` | |
| 113 | +| `SYMBOL_MERCURY` | `string` | `'Mercury'` | |
| 114 | +| `SYMBOL_VENUS` | `string` | `'Venus'` | |
| 115 | +| `SYMBOL_MARS` | `string` | `'Mars'` | |
| 116 | +| `SYMBOL_JUPITER` | `string` | `'Jupiter'` | |
| 117 | +| `SYMBOL_SATURN` | `string` | `'Saturn'` | |
| 118 | +| `SYMBOL_URANUS` | `string` | `'Uranus'` | |
| 119 | +| `SYMBOL_NEPTUNE` | `string` | `'Neptune'` | |
| 120 | +| `SYMBOL_PLUTO` | `string` | `'Pluto'` | |
| 121 | +| `SYMBOL_CHIRON` | `string` | `'Chiron'` | |
| 122 | +| `SYMBOL_LILITH` | `string` | `'Lilith'` | |
| 123 | +| `SYMBOL_NNODE` | `string` | `'NNode'` | |
| 124 | +| `SYMBOL_SNODE` | `string` | `'SNode'` | |
| 125 | +| `SYMBOL_FORTUNE` | `string` | `'Fortune'` | |
| 126 | +| `SYMBOL_ARIES` | `string` | `'Aries'` | |
| 127 | +| `SYMBOL_TAURUS` | `string` | `'Taurus'` | |
| 128 | +| `SYMBOL_GEMINI` | `string` | `'Gemini'` | |
| 129 | +| `SYMBOL_CANCER` | `string` | `'Cancer'` | |
| 130 | +| `SYMBOL_LEO` | `string` | `'Leo'` | |
| 131 | +| `SYMBOL_VIRGO` | `string` | `'Virgo'` | |
| 132 | +| `SYMBOL_LIBRA` | `string` | `'Libra'` | |
| 133 | +| `SYMBOL_SCORPIO` | `string` | `'Scorpio'` | |
| 134 | +| `SYMBOL_SAGITTARIUS` | `string` | `'Sagittarius'` | |
| 135 | +| `SYMBOL_CAPRICORN` | `string` | `'Capricorn'` | |
| 136 | +| `SYMBOL_AQUARIUS` | `string` | `'Aquarius'` | |
| 137 | +| `SYMBOL_PISCES` | `string` | `'Pisces'` | |
| 138 | +| `SYMBOL_SIGNS` | `string[]` | `['Aries', 'Taurus', ..., 'Pisces']` | |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## Custom Symbols |
19 | 143 |
|
20 | 144 | | Setting | Type | Default | Description | |
21 | 145 | |---------|------|---------|-------------| |
22 | | -| `PAPER_BORDER_WIDTH` | number | `2` | Border stroke width | |
23 | | -| `INNER_CIRCLE_RADIUS_RATIO` | number | `0.5` | Ratio of inner circle to paper | |
| 146 | +| `CUSTOM_SYMBOL_FN` | `((name: string, x: number, y: number, context: SVG) => Element) \| null` | `null` | Custom symbol renderer. Return a valid SVG `Element`, or `null`/`undefined` to fall back to the built-in symbol for that name. | |
| 147 | + |
| 148 | +See the [Custom Symbols guide](../guides/custom-symbols) for full examples. |
24 | 149 |
|
25 | | -## Rendering |
| 150 | +--- |
| 151 | + |
| 152 | +## Aspects |
26 | 153 |
|
27 | 154 | | Setting | Type | Default | Description | |
28 | 155 | |---------|------|---------|-------------| |
29 | | -| `STROKE_ONLY` | boolean | `false` | Render planets as outlines only | |
30 | | -| `ADD_CLICK_AREA` | boolean | `false` | Enable click detection | |
| 156 | +| `ASPECTS` | `Record<string, { degree: number, orbit: number, color: string }>` | *(see below)* | Aspect definitions. Each key is an aspect name; the value defines its degree, allowed orb, and line color. | |
31 | 157 |
|
32 | | -## Example |
| 158 | +Default value: |
33 | 159 |
|
34 | 160 | ```javascript |
35 | | -const settings = { |
36 | | - BACKGROUND_COLOR: '#f5f5f5', |
37 | | - PAPER_BORDER_COLOR: '#333333', |
38 | | - STROKE_ONLY: true |
| 161 | +{ |
| 162 | + conjunction: { degree: 0, orbit: 10, color: 'transparent' }, |
| 163 | + square: { degree: 90, orbit: 8, color: '#FF4500' }, |
| 164 | + trine: { degree: 120, orbit: 8, color: '#27AE60' }, |
| 165 | + opposition: { degree: 180, orbit: 10, color: '#27AE60' } |
39 | 166 | } |
| 167 | +``` |
| 168 | + |
| 169 | +You can add any custom aspects — for example, a sextile: |
| 170 | + |
| 171 | +```javascript |
| 172 | +const chart = new Chart('chart', 600, 600, { |
| 173 | + ASPECTS: { |
| 174 | + conjunction: { degree: 0, orbit: 10, color: 'transparent' }, |
| 175 | + sextile: { degree: 60, orbit: 6, color: '#3498db' }, |
| 176 | + square: { degree: 90, orbit: 8, color: '#FF4500' }, |
| 177 | + trine: { degree: 120, orbit: 8, color: '#27AE60' }, |
| 178 | + opposition: { degree: 180, orbit: 10, color: '#27AE60' } |
| 179 | + } |
| 180 | +}) |
| 181 | +``` |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +## Dignities |
| 186 | + |
| 187 | +| Setting | Type | Default | Description | |
| 188 | +|---------|------|---------|-------------| |
| 189 | +| `SHOW_DIGNITIES_TEXT` | `boolean` | `true` | Show dignity labels next to planet symbols | |
| 190 | +| `DIGNITIES_RULERSHIP` | `string` | `'r'` | Label shown when a planet is in its rulership sign | |
| 191 | +| `DIGNITIES_DETRIMENT` | `string` | `'d'` | Label shown when a planet is in detriment | |
| 192 | +| `DIGNITIES_EXALTATION` | `string` | `'e'` | Label shown when a planet is in exaltation | |
| 193 | +| `DIGNITIES_EXACT_EXALTATION` | `string` | `'E'` | Label shown when a planet is at its exact degree of exaltation | |
| 194 | +| `DIGNITIES_FALL` | `string` | `'f'` | Label shown when a planet is in fall | |
| 195 | +| `DIGNITIES_EXACT_EXALTATION_DEFAULT` | `Dignity[]` | *(Crowley positions)* | Array of `{ name, position, orbit }` defining exact exaltation degrees | |
| 196 | + |
| 197 | +Default `DIGNITIES_EXACT_EXALTATION_DEFAULT`: |
40 | 198 |
|
41 | | -const chart = new Chart('chart', 600, 600, settings) |
42 | | -chart.radix(data) |
| 199 | +```javascript |
| 200 | +[ |
| 201 | + { name: 'Sun', position: 19, orbit: 2 }, // 19° Aries |
| 202 | + { name: 'Moon', position: 33, orbit: 2 }, // 3° Taurus |
| 203 | + { name: 'Mercury', position: 155, orbit: 2 }, // 15° Virgo |
| 204 | + { name: 'Venus', position: 357, orbit: 2 }, // 27° Pisces |
| 205 | + { name: 'Mars', position: 298, orbit: 2 }, // 28° Capricorn |
| 206 | + { name: 'Jupiter', position: 105, orbit: 2 }, // 15° Cancer |
| 207 | + { name: 'Saturn', position: 201, orbit: 2 }, // 21° Libra |
| 208 | + { name: 'NNode', position: 63, orbit: 2 }, // 3° Gemini |
| 209 | +] |
43 | 210 | ``` |
44 | 211 |
|
45 | | -## Next Steps |
| 212 | +--- |
| 213 | + |
| 214 | +## Animation |
| 215 | + |
| 216 | +| Setting | Type | Default | Description | |
| 217 | +|---------|------|---------|-------------| |
| 218 | +| `ANIMATION_CUSPS_ROTATION_SPEED` | `number` | `2` | Speed of the transit cusps rotation animation. Valid range: `0`–`4`. | |
| 219 | + |
| 220 | +--- |
| 221 | + |
| 222 | +## Internal IDs |
| 223 | + |
| 224 | +These settings control the `id` attributes applied to SVG group elements inside the chart. **You should not change these unless you have a specific reason** (e.g. avoiding conflicts with other SVG elements on the page). |
| 225 | + |
| 226 | +| Setting | Default | |
| 227 | +|---------|---------| |
| 228 | +| `ID_CHART` | `'astrology'` | |
| 229 | +| `ID_RADIX` | `'radix'` | |
| 230 | +| `ID_TRANSIT` | `'transit'` | |
| 231 | +| `ID_ASPECTS` | `'aspects'` | |
| 232 | +| `ID_POINTS` | `'planets'` | |
| 233 | +| `ID_SIGNS` | `'signs'` | |
| 234 | +| `ID_CIRCLES` | `'circles'` | |
| 235 | +| `ID_AXIS` | `'axis'` | |
| 236 | +| `ID_CUSPS` | `'cusps'` | |
| 237 | +| `ID_RULER` | `'ruler'` | |
| 238 | +| `ID_BG` | `'bg'` | |
| 239 | + |
| 240 | +--- |
| 241 | + |
| 242 | +## Related |
46 | 243 |
|
47 | | -- **[Custom Settings Guide](../guides/custom-settings)** — Learn more |
48 | | -- **[Types Reference](./types)** — See all type definitions |
| 244 | +- **[Custom Settings Guide](../guides/custom-settings)** — Practical examples and dark theme recipe |
| 245 | +- **[Custom Symbols Guide](../guides/custom-symbols)** — Using `CUSTOM_SYMBOL_FN` |
| 246 | +- **[Click Events Guide](../guides/click-events)** — Using `ADD_CLICK_AREA` |
0 commit comments