npm apexcharts 7.5.1
๐Ÿ’Ž Version 7.5.1

4 hours ago

A patch for one bug in the Weave inventory that 7.5.0 introduced, found
by the first thing to consume it: api.drawn() kept listing an overlay
after the plugin had cleared it away, because declarations were dropped
only on a chart redraw and switching an overlay off does not cause one.

Nothing else changed, and no plugin needs to do anything differently.

gzip
7.5.0 default bundle 269,856 B
7.5.1 default bundle 269,879 B

Both are dist/apexcharts.min.js gzipped at the default level, which is the figure npm run build prints.

Upgrading is npm install apexcharts@7.5.1.

๐Ÿ› Fixes

Drop a plugin's declarations when it empties its layer

api.drawn() reported drawings that were no longer on screen.

Declarations were cleared in one place, at the start of each draw pass,
on the reasoning that layers are wiped there and repainted from state,
so an inventory could never outlive what it described. That holds only
for a plugin whose drawing is driven by chart renders.

An overlay plugin is not. Switching an overlay off is an interaction: it
empties its layer and repaints, and no chart render happens, because
going through one to remove a drawing would be an expensive way to do
nothing. The declaration made for the previous paint then survived, and
drawn() went on listing a trend line the viewer had just dismissed.

That is worse than the incompleteness the owner column exists to own
up to. A reader can see that a list covers only the features which opted
in; they cannot see that a row in it is stale.

Emptying the layer is the plugin saying, in the only way this API gives
it, that it is drawing nothing. So that is now what it means:

api.on('draw', () => {
  const layer = api.layer()
  layer.line({ x1, y1, x2, y2, stroke: '#888' })
  api.declare({ id: 'trend', label: 'Trend' })
})

// When the viewer switches the overlay off, with no redraw involved:
layer.clear() // the declaration goes with the drawing

Scoped to the plugin that cleared. Another plugin's declarations are
none of its business, and a clear that emptied the whole map would let
one plugin erase everyone's work from a readout.

Found by the first thing to consume drawn() rather than by review: an
inventory panel that listed an overlay which had been switched off. An
API with no consumer is an API whose lifecycle has not been tested, and
this one was published without one.

๐Ÿงน Housekeeping

  • publish.yml went straight from the npm publish to the end of the job, so the tag and the GitHub release were manual every time. 7.5.0 shipped to npm without either, and nothing anywhere said so: the run was green, the package installed, and the only symptom was a version with no notes.
  • The first generated notes ran to 500 words about a build script, under the fix anybody actually opened the release to read.

Don't miss a new apexcharts release

NewReleases is sending notifications on new releases.