katucharts.js 0.2.3 → 0.2.5

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.
@@ -34,6 +34,7 @@ export declare class Chart {
34
34
  private clipPathId;
35
35
  private chartWidth;
36
36
  private chartHeight;
37
+ private autoHeight;
37
38
  private resizeObserver;
38
39
  private titleGroup;
39
40
  private stackLabelsGroup;
@@ -50,6 +51,37 @@ export declare class Chart {
50
51
  private axes;
51
52
  private createFixedAxisOverlay;
52
53
  private getDefaultHeightAspectRatio;
54
+ /**
55
+ * Minimum usable plot-area height for an auto-sized chart. Below this the
56
+ * series get squeezed into an unreadable strip on narrow viewports.
57
+ */
58
+ private static readonly MIN_AUTO_PLOT_HEIGHT;
59
+ /**
60
+ * Hard ceiling for auto-grown height so a chart with extreme fixed overhead
61
+ * (very long rotated labels, large legends) can't expand without bound.
62
+ */
63
+ private static readonly MAX_AUTO_HEIGHT;
64
+ /**
65
+ * Minimum height per category band on a vertical category axis (heatmap rows,
66
+ * inverted/bar categories) so row labels don't overlap.
67
+ */
68
+ private static readonly MIN_CATEGORY_ROW_HEIGHT;
69
+ /**
70
+ * When the height is derived rather than configured, a chart on a narrow
71
+ * viewport can end up shorter than the fixed vertical overhead (title,
72
+ * subtitle, legend, axis labels), collapsing the plot area to nothing.
73
+ *
74
+ * The overhead is independent of the chart height, so a single probe layout
75
+ * at a tall height yields the true overhead; the height is then grown just
76
+ * enough to give the plot area a usable minimum.
77
+ */
78
+ private fitHeightToContent;
79
+ /**
80
+ * Categories rendered down the vertical axis (heatmap rows, or the category
81
+ * axis of an inverted/bar chart). Each one needs a minimum band so the labels
82
+ * stay legible instead of piling up when the plot is short.
83
+ */
84
+ private verticalCategoryCount;
53
85
  private resolveHeight;
54
86
  private applyChartStyles;
55
87
  private computeLayout;
@@ -5658,7 +5658,10 @@ class dh extends nt {
5658
5658
  }).attr("stroke-width", (p) => {
5659
5659
  var g, y;
5660
5660
  return ((g = p.marker) == null ? void 0 : g.lineWidth) ?? ((y = this.config.marker) == null ? void 0 : y.lineWidth) ?? 1;
5661
- }).attr("opacity", this.config.opacity ?? 1).merge(u).transition().duration(t).attr("cx", (p, g) => this.cachedPositions[g].cx).attr("cy", (p, g) => this.cachedPositions[g].cy).attr("r", (p) => {
5661
+ }).attr("opacity", this.config.opacity ?? 1).merge(u).attr("fill", (p) => this.getPointFill(p, i)).attr("stroke", (p) => {
5662
+ var g, y;
5663
+ return ((g = p.marker) == null ? void 0 : g.lineColor) ?? ((y = this.config.marker) == null ? void 0 : y.lineColor) ?? i;
5664
+ }).transition().duration(t).attr("cx", (p, g) => this.cachedPositions[g].cx).attr("cy", (p, g) => this.cachedPositions[g].cy).attr("r", (p) => {
5662
5665
  var g;
5663
5666
  return ((g = p.marker) == null ? void 0 : g.radius) ?? s;
5664
5667
  });
@@ -5670,7 +5673,10 @@ class dh extends nt {
5670
5673
  }).attr("stroke-width", (g) => {
5671
5674
  var y, m;
5672
5675
  return ((y = g.marker) == null ? void 0 : y.lineWidth) ?? ((m = this.config.marker) == null ? void 0 : m.lineWidth) ?? 1;
5673
- }).attr("opacity", this.config.opacity ?? 1).merge(d).transition().duration(t).attr(
5676
+ }).attr("opacity", this.config.opacity ?? 1).merge(d).attr("fill", (g) => this.getPointFill(g, i)).attr("stroke", (g) => {
5677
+ var y, m;
5678
+ return ((y = g.marker) == null ? void 0 : y.lineColor) ?? ((m = this.config.marker) == null ? void 0 : m.lineColor) ?? i;
5679
+ }).transition().duration(t).attr(
5674
5680
  "transform",
5675
5681
  (g, y) => `translate(${this.cachedPositions[y].cx},${this.cachedPositions[y].cy})`
5676
5682
  ).attr("d", (g) => {