@opendata-ai/openchart-core 6.19.0 → 6.19.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
@@ -2779,7 +2779,7 @@ declare function estimateTextWidth(text: string, fontSize: number, fontWeight?:
2779
2779
  * so adjacent text doesn't crowd it. Used by chrome and legend layout to avoid
2780
2780
  * overlapping the brand.
2781
2781
  */
2782
- declare const BRAND_RESERVE_WIDTH = 110;
2782
+ declare const BRAND_RESERVE_WIDTH = 130;
2783
2783
  /** Font size of the brand watermark (px). Shared between layout and renderer. */
2784
2784
  declare const BRAND_FONT_SIZE = 12;
2785
2785
  /** Minimum chart width to render the brand watermark (px). */
package/dist/index.js CHANGED
@@ -1031,7 +1031,7 @@ function resolveTheme(userTheme, base = DEFAULT_THEME) {
1031
1031
  }
1032
1032
 
1033
1033
  // src/layout/text-measure.ts
1034
- var AVG_CHAR_WIDTH_RATIO = 0.55;
1034
+ var AVG_CHAR_WIDTH_RATIO = 0.57;
1035
1035
  var WEIGHT_ADJUSTMENT = {
1036
1036
  100: 0.9,
1037
1037
  200: 0.92,
@@ -1058,7 +1058,7 @@ function estimateTextWidth(text, fontSize, fontWeight = 400) {
1058
1058
  }
1059
1059
  return text.length * charWidth;
1060
1060
  }
1061
- var BRAND_RESERVE_WIDTH = 110;
1061
+ var BRAND_RESERVE_WIDTH = 130;
1062
1062
  var BRAND_FONT_SIZE = 12;
1063
1063
  var BRAND_MIN_WIDTH = 120;
1064
1064
  function estimateTextHeight(fontSize, lineCount = 1, lineHeight = 1.3) {
@@ -1140,7 +1140,8 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
1140
1140
  }
1141
1141
  const pad2 = padding ?? theme.spacing.padding;
1142
1142
  const chromeGap = theme.spacing.chromeGap;
1143
- const maxWidth = width - pad2 * 2;
1143
+ const WRAP_SAFETY_BUFFER = 5;
1144
+ const maxWidth = width - pad2 * 2 - WRAP_SAFETY_BUFFER;
1144
1145
  const fontFamily = theme.fonts.family;
1145
1146
  let topY = pad2;
1146
1147
  const topElements = {};