cx 24.3.2 → 24.3.3

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.css CHANGED
@@ -134,6 +134,11 @@
134
134
  stroke-width: 1;
135
135
  }
136
136
 
137
+ .cxe-swimlanes-lane {
138
+ fill: #f1f1f1;
139
+ stroke: none;
140
+ }
141
+
137
142
  .cxe-column-rect {
138
143
  stroke-width: 1px;
139
144
  fill: #eee;
package/dist/charts.js CHANGED
@@ -2588,6 +2588,135 @@ Gridlines.prototype.anchors = "0 1 1 0";
2588
2588
  Gridlines.prototype.baseClass = "gridlines";
2589
2589
  BoundedObject.alias("gridlines", Gridlines);
2590
2590
 
2591
+ var Swimlanes = /*#__PURE__*/ (function (_BoundedObject) {
2592
+ _inheritsLoose(Swimlanes, _BoundedObject);
2593
+ function Swimlanes() {
2594
+ return _BoundedObject.apply(this, arguments) || this;
2595
+ }
2596
+ var _proto = Swimlanes.prototype;
2597
+ _proto.init = function init() {
2598
+ this.laneStyle = parseStyle(this.laneStyle);
2599
+ _BoundedObject.prototype.init.call(this);
2600
+ };
2601
+ _proto.declareData = function declareData() {
2602
+ var _BoundedObject$protot;
2603
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2604
+ args[_key] = arguments[_key];
2605
+ }
2606
+ (_BoundedObject$protot = _BoundedObject.prototype.declareData).call.apply(
2607
+ _BoundedObject$protot,
2608
+ [this].concat(args, [
2609
+ {
2610
+ size: undefined,
2611
+ step: undefined,
2612
+ laneOffset: undefined,
2613
+ laneStyle: {
2614
+ structured: true,
2615
+ },
2616
+ },
2617
+ ]),
2618
+ );
2619
+ };
2620
+ _proto.explore = function explore(context, instance) {
2621
+ _BoundedObject.prototype.explore.call(this, context, instance);
2622
+ instance.xAxis = context.axes[this.xAxis];
2623
+ instance.yAxis = context.axes[this.yAxis];
2624
+ };
2625
+ _proto.prepare = function prepare(context, instance) {
2626
+ _BoundedObject.prototype.prepare.call(this, context, instance);
2627
+ var xAxis = instance.xAxis,
2628
+ yAxis = instance.yAxis;
2629
+ if ((xAxis && xAxis.shouldUpdate) || (yAxis && yAxis.shouldUpdate)) instance.markShouldUpdate(context);
2630
+ };
2631
+ _proto.render = function render(context, instance, key) {
2632
+ var data = instance.data,
2633
+ xAxis = instance.xAxis,
2634
+ yAxis = instance.yAxis;
2635
+ var bounds = data.bounds;
2636
+ var CSS = this.CSS,
2637
+ baseClass = this.baseClass;
2638
+ var axis = this.vertical ? xAxis : yAxis;
2639
+ if (!axis) return null;
2640
+ var min, max, valueFunction;
2641
+ if (axis.scale) {
2642
+ min = axis.scale.min;
2643
+ max = axis.scale.max;
2644
+ var clamp = function clamp(value) {
2645
+ return [Math.max(min, Math.min(max, value)), 0];
2646
+ };
2647
+ valueFunction = function valueFunction(value, offset) {
2648
+ return clamp(value + offset);
2649
+ };
2650
+ } else if (axis.valueList) {
2651
+ min = 0;
2652
+ max = axis.valueList.length;
2653
+ valueFunction = function valueFunction(value, offset) {
2654
+ return [axis.valueList[value], offset];
2655
+ };
2656
+ }
2657
+ if (!(min < max)) return null;
2658
+ var rects = [];
2659
+ var at = Math.ceil(min / data.step) * data.step;
2660
+ var index = 0;
2661
+ var rectClass = CSS.element(baseClass, "lane");
2662
+ while (at - data.size / 2 < max) {
2663
+ var c1 = axis.map.apply(axis, valueFunction(at, -data.size / 2 + data.laneOffset));
2664
+ var c2 = axis.map.apply(axis, valueFunction(at, +data.size / 2 + data.laneOffset));
2665
+ if (this.vertical) {
2666
+ rects.push(
2667
+ /*#__PURE__*/ jsx(
2668
+ "rect",
2669
+ {
2670
+ y: bounds.t,
2671
+ x: Math.min(c1, c2),
2672
+ height: bounds.b - bounds.t,
2673
+ width: Math.abs(c1 - c2),
2674
+ className: rectClass,
2675
+ style: data.laneStyle,
2676
+ },
2677
+ index++,
2678
+ ),
2679
+ );
2680
+ } else {
2681
+ rects.push(
2682
+ /*#__PURE__*/ jsx(
2683
+ "rect",
2684
+ {
2685
+ x: bounds.l,
2686
+ y: Math.min(c1, c2),
2687
+ width: bounds.r - bounds.l,
2688
+ height: Math.abs(c1 - c2),
2689
+ className: rectClass,
2690
+ style: data.laneStyle,
2691
+ },
2692
+ index++,
2693
+ ),
2694
+ );
2695
+ }
2696
+ at += data.step;
2697
+ }
2698
+ return /*#__PURE__*/ jsx(
2699
+ "g",
2700
+ {
2701
+ className: data.classNames,
2702
+ children: rects,
2703
+ },
2704
+ key,
2705
+ );
2706
+ };
2707
+ return Swimlanes;
2708
+ })(BoundedObject);
2709
+ Swimlanes.prototype.xAxis = "x";
2710
+ Swimlanes.prototype.yAxis = "y";
2711
+ Swimlanes.prototype.anchors = "0 1 1 0";
2712
+ Swimlanes.prototype.baseClass = "swimlanes";
2713
+ Swimlanes.prototype.size = 0.5;
2714
+ Swimlanes.prototype.laneOffset = 0;
2715
+ Swimlanes.prototype.step = 1;
2716
+ Swimlanes.prototype.vertical = false;
2717
+ Swimlanes.prototype.styled = true;
2718
+ BoundedObject.alias("swimlanes", Swimlanes);
2719
+
2591
2720
  var LineGraph = /*#__PURE__*/ (function (_Widget) {
2592
2721
  _inheritsLoose(LineGraph, _Widget);
2593
2722
  function LineGraph() {
@@ -4840,6 +4969,7 @@ export {
4840
4969
  Range,
4841
4970
  ScatterGraph,
4842
4971
  SnapPointFinder,
4972
+ Swimlanes,
4843
4973
  TimeAxis,
4844
4974
  ValueAtFinder,
4845
4975
  bar,