@opendata-ai/openchart-core 7.9.0 → 7.9.2

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/index.d.ts CHANGED
@@ -4328,10 +4328,15 @@ declare const AXIS_TITLE_GAP = 7;
4328
4328
  * visible clearance remains. Falls back to the viewport-minimum offset when the
4329
4329
  * dynamic value would be smaller (short tick labels on wide containers).
4330
4330
  *
4331
+ * When `inline` is true the y-tick labels render inside the chart area (above
4332
+ * their gridlines) rather than in a left gutter, so the title only needs to
4333
+ * clear the chart edge — no tick-label width and no viewport-minimum floor,
4334
+ * both of which would otherwise leave a dead gap between the title and the plot.
4335
+ *
4331
4336
  * Shared by the engine (margin reservation) and the renderer (title placement)
4332
4337
  * so the reserved space always matches where the title is drawn.
4333
4338
  */
4334
- declare function axisTitleOffset(maxTickLabelWidth: number, titleFontSize: number, width: number): number;
4339
+ declare function axisTitleOffset(maxTickLabelWidth: number, titleFontSize: number, width: number, inline?: boolean): number;
4335
4340
  /**
4336
4341
  * Width below which "narrow" adjustments apply: extra iOS Safari top padding and
4337
4342
  * tighter category label gaps. Sits between compact (< 400) and medium (400–700).
package/dist/index.js CHANGED
@@ -1209,8 +1209,11 @@ var HPAD_COMPACT_MIN = 4;
1209
1209
  var TICK_LABEL_OFFSET = 6;
1210
1210
  var AXIS_TITLE_TRAILING_PAD = 4;
1211
1211
  var AXIS_TITLE_GAP = 7;
1212
- function axisTitleOffset(maxTickLabelWidth, titleFontSize, width) {
1212
+ function axisTitleOffset(maxTickLabelWidth, titleFontSize, width, inline = false) {
1213
1213
  const halfTitleGlyph = Math.ceil(titleFontSize / 2);
1214
+ if (inline) {
1215
+ return TICK_LABEL_OFFSET + AXIS_TITLE_GAP + halfTitleGlyph;
1216
+ }
1214
1217
  const dynamic = TICK_LABEL_OFFSET + maxTickLabelWidth + AXIS_TITLE_GAP + halfTitleGlyph;
1215
1218
  return Math.max(dynamic, getAxisTitleOffset(width));
1216
1219
  }