A single-feature release for the plugin layer. Weave reaches contract v4, and api.pointer() tells a plugin which data point the viewer is pointing at or has selected.
Purely additive. No behaviour a chart already had changes, and a chart running no plugins is untouched, which the 446 bytes below reflect. Upgrading is npm install apexcharts@7.3.0.
| gzip | |
|---|---|
| 7.2.0 default bundle | 266,795 B |
| 7.3.0 default bundle | 267,241 B |
✨ New
Weave v4: api.pointer()
A plugin could draw on the chart and reserve room for its own UI, but it had no way to know what the viewer was doing. To react to a hover it had to hit-test the SVG itself, re-deriving from raw pixels an answer the chart had already worked out, and then disagree with the tooltip on the same pixel.
api.pointer(fn) forwards the chart's own dataPointMouseEnter, dataPointMouseLeave and dataPointSelection as one normalised payload, and returns an unsubscribe.
ApexCharts.registerPlugin({
name: 'coordinator',
apiVersion: 2,
setup(api) {
if (typeof api.pointer !== 'function') return
const off = api.pointer((e) => {
// e.type 'enter' | 'leave' | 'select'
// e.seriesIndex which series
// e.dataPointIndex which point
// e.category the resolved display label, e.g. 'Mar'
// e.seriesName undefined on a pie
// e.selected on 'select' only: is the point now in or out
})
},
})Three things worth knowing about the payload:
categoryis the resolved display label, the same stringapi.categoriescarries, not the raw slot list. A plugin coordinating two charts keys on the label, because an index means something different on every chart. Readingglobals.labelsdirectly reports3where the chart showsMar.seriesNameisundefinedon a pie, where the series carries bare numbers, rather than a guess.selectedis filled only on a select, from the chart's own selection set, so a second click on a point reads as a deselect rather than another select.
Nothing here lets a plugin intercept or cancel. The chart's tooltip, selection state and the caller's own dataPoint* events are unaffected, and a handler that throws is contained rather than allowed to break the interaction it was watching. Wiring is lazy and torn down with the chart, so a chart whose plugins never ask pays nothing.
Feature-detect with typeof api.pointer === 'function' rather than declaring apiVersion: 4, on the same terms as api.reserve in 7.2.0: a host older than the version a plugin declares skips that plugin outright rather than serving it a smaller API, so one build keeps working everywhere.
Weave is in the default bundle; for the lean-core channel it is import 'apexcharts/features/weave'.
📦 A note on prerelease tags
Landing just after this release, and worth flagging because it changes an install command: prereleases no longer publish under next. They now take a tag naming their own release line, so 7.4.0-rc.1 publishes under rc-7.4.
A floating next has to be maintained. The moment a stable ships, it points at something older than latest and npm i apexcharts@next quietly installs the wrong thing. Moving it back is a registry write, and npm's OIDC trusted publishing covers npm publish only, so a workflow that fixed it would need a publish-capable token in a repo that deliberately holds none. A tag naming a line never goes stale, because it states a fact rather than a position.
npm i apexcharts@next therefore now fails with "No matching version", which is the honest answer and better than an old one. Each prerelease's notes will name its exact tag.
Full Changelog: v7.2.0...v7.3.0