cx 25.9.0 → 25.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/charts.js CHANGED
@@ -482,17 +482,31 @@ var Axis = /*#__PURE__*/ (function (_BoundedObject) {
482
482
  );
483
483
  }
484
484
  lines.forEach(function (p, i) {
485
+ var data =
486
+ p.data != null
487
+ ? Object.entries(p.data).reduce(function (acc, _ref) {
488
+ var key = _ref[0],
489
+ val = _ref[1];
490
+ acc["data-" + key] = val;
491
+ return acc;
492
+ }, {})
493
+ : null;
485
494
  result.push(
486
495
  /*#__PURE__*/ jsx(
487
496
  "tspan",
488
- {
489
- dy: lines.length > 1 ? (i == 0 ? offset : _this2.labelLineHeight) + "em" : dy,
490
- x: x,
491
- style: p.style,
492
- className: p.className,
493
- dx: dx,
494
- children: p.text,
495
- },
497
+ _extends(
498
+ {
499
+ dy: lines.length > 1 ? (i == 0 ? offset : _this2.labelLineHeight) + "em" : dy,
500
+ x: x,
501
+ style: p.style,
502
+ className: p.className,
503
+ dx: dx,
504
+ },
505
+ data,
506
+ {
507
+ children: p.text,
508
+ },
509
+ ),
496
510
  i,
497
511
  ),
498
512
  );
@@ -502,9 +516,9 @@ var Axis = /*#__PURE__*/ (function (_BoundedObject) {
502
516
  _proto.prepare = function prepare(context, instance) {
503
517
  _BoundedObject.prototype.prepare.call(this, context, instance);
504
518
  var bounds = instance.data.bounds;
505
- var _ref = !this.vertical ? [bounds.l, bounds.r] : [bounds.b, bounds.t],
506
- a = _ref[0],
507
- b = _ref[1];
519
+ var _ref2 = !this.vertical ? [bounds.l, bounds.r] : [bounds.b, bounds.t],
520
+ a = _ref2[0],
521
+ b = _ref2[1];
508
522
  instance.calculator.measure(a, b);
509
523
  if (this.onMeasured) instance.invoke("onMeasured", instance.calculator.hash(), instance);
510
524
  if (!instance.calculator.isSame(instance.cached.axis)) instance.markShouldUpdate(context);