You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(website): address Copilot review — factual errors and broken examples
- changelog: replace '— Current' header with real release dates (3.0.2:
2023-08-17, 3.0.1: 2023-07-20, 3.0.0: 2023-07-10)
- changelog: remove false claim that AstroData/AspectData/Dignity are
exported from the package entry point (only Chart, AspectCalculator,
and Settings are)
- changelog: add real 3.0.2 fix: SNode and Fortune symbol positions
- changelog: correct ADD_CLICK_AREA entry — remove mention of the
non-existent radix.on() event API
- click-events: rewrite guide to use real DOM addEventListener pattern
with predictable element IDs ({chartId}-radix-planets-{Name} /
{chartId}-radix-cusps-{index}) instead of fictional radix.on() API
- custom.css: rename .chart-demo selectors to .chart-demo-wrapper to
match the class actually used by ChartDemo.astro (dead CSS fix)
- vue.md: replace broken `import type { AstroData }` (not exported) with
derived type: Parameters<InstanceType<typeof Chart>['radix']>[0]
- ChartDemo.astro: fix package name in all 4 code snippets
('astrochart' → '@astrodraw/astrochart')
- ChartDemo.astro: fix animate snippet — replace no-arg transit.animate()
call with a valid call showing all required parameters
🤖 Generated with [eca](https://eca.dev)
Co-Authored-By: eca <git@eca.dev>
Copy file name to clipboardExpand all lines: website/src/content/docs/changelog.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,20 +12,17 @@ This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
12
12
13
13
---
14
14
15
-
## [3.0.2] — Current
15
+
## [3.0.2] — 2023-08-17
16
16
17
17
### Fixed
18
18
- Corrected planet collision-avoidance logic when `SYMBOL_SCALE` is set to a value other than `1`
19
19
- Resolved an edge case where `DIGNITIES_EXACT_EXALTATION_DEFAULT` positions were not applied when custom dignity data was provided
20
20
- Minor SVG attribute type-coercion fixes for strict browser environments
21
-
22
-
### Changed
23
-
- Improved TypeScript type exports — `AstroData`, `AspectData`, `Dignity`, and `Settings` interfaces are now all publicly exported from the package entry point
24
-
- Internal SVG group IDs (`ID_*` settings) are now overridable without side-effects
21
+
- Fixed `SNode` and `Fortune` symbol positions being rendered at incorrect ecliptic angles
25
22
26
23
---
27
24
28
-
## [3.0.1]
25
+
## [3.0.1] — 2023-07-20
29
26
30
27
### Fixed
31
28
- Transit chart rendering when cusps array contains boundary values at 0° or 360°
@@ -38,12 +35,12 @@ This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
38
35
39
36
---
40
37
41
-
## [3.0.0]
38
+
## [3.0.0] — 2023-07-10
42
39
43
40
### Added
44
41
- Full TypeScript rewrite — all public APIs are typed; ships with `.d.ts` declaration files
45
42
-`CUSTOM_SYMBOL_FN` setting for replacing any planet or sign symbol with a custom SVG element
46
-
-`ADD_CLICK_AREA` setting plus `radix.on('click:planet', ...)`and `radix.on('click:cusp', ...)` event API
43
+
-`ADD_CLICK_AREA` setting — adds transparent `<rect>` hit areas around planet and cusp symbols, enabling external DOM `click` event listeners
47
44
-`STROKE_ONLY` rendering mode for monochrome / print output
description: Add interactivity to chart elements with click event handlers.
3
+
description: Add interactivity to chart elements with click event listeners.
4
4
---
5
5
6
6
# Click Events
7
7
8
-
AstroChart can fire events when a user clicks on a planet or cusp. You must opt-in by setting `ADD_CLICK_AREA: true` when constructing the chart — without this flag no click areas are added and no events will fire.
8
+
AstroChart supports click interactivity via the `ADD_CLICK_AREA` setting. When enabled, transparent `<rect>` hit areas are rendered on top of each planet and cusp symbol. You attach standard DOM `click` listeners to those elements using their predictable `id` attributes.
9
9
10
10
---
11
11
@@ -16,39 +16,93 @@ Pass `ADD_CLICK_AREA: true` in your settings object:
Use `radix.on('click:planet', handler)` to respond when a planet symbol is clicked. The handler receives the planet name and the original DOM `MouseEvent`:
61
+
Attach one listener to the SVG container and inspect the target `id` to determine which
The `name` argument matches the planet key from your `AstroData` (e.g. `'Sun'`, `'Moon'`, `'Mars'`).
41
-
42
80
---
43
81
44
82
## Listening for Cusp Clicks
45
83
46
-
Use `radix.on('click:cusp', handler)` to respond when a house cusp is clicked. The handler receives the zero-based cusp index (0–11) and the `MouseEvent`:
84
+
Cusp indices are zero-based — house 1 = index `0`, house 12 = index `11`.
console.log(`House ${houseNumber} cusp starts at ${data.cusps[Number(cuspMatch[1])]}°`)
144
+
}
86
145
})
87
146
```
88
147
@@ -96,15 +155,18 @@ HTML:
96
155
97
156
## Notes
98
157
99
-
-**`ADD_CLICK_AREA: true` is required.** If this setting is omitted or set to `false`, no click areas are rendered and the `on()` handlers will never fire.
100
-
- Events are standard DOM `MouseEvent` objects so you have access to `event.target`, `event.clientX`, `event.clientY`, etc.
101
-
- The `click:planet` event fires for all planets present in your `AstroData.planets` map.
102
-
- The `click:cusp` index is zero-based — house 1 is index `0`, house 12 is index `11`.
158
+
- **`ADD_CLICK_AREA:true` is required.** Without it no transparent hit areas are rendered.
159
+
- The click target is the `<rect>` element, not the planet symbol itself. Use the `id`
160
+
attribute on `event.target` to identify which planet or cusp was clicked.
161
+
- Events are standard DOM `MouseEvent` objects — `event.clientX`, `event.clientY`,
162
+
`event.target`, etc. are all available.
163
+
- If you customise `ID_RADIX`, `ID_POINTS`, or `ID_CUSPS` in your settings, the element
164
+
IDs change. Adjust your regex patterns or selectors accordingly.
103
165
104
166
---
105
167
106
168
## Next Steps
107
169
108
170
- **[Custom Settings](./custom-settings)** — Configure `ADD_CLICK_AREA` and other options
109
171
- **[Framework Integrations](./frameworks/react)** — Use click events with React, Vue, and Angular
110
-
-**[API Reference](../api/chart)** — See all chart methods
172
+
- **[Settings API Reference](../api/settings)** — Full settings type documentation
0 commit comments