@opendata-ai/openchart-core 6.18.0 → 6.19.1
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 +3 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/layout/text-measure.ts +2 -2
- package/src/types/layout.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -2046,6 +2046,8 @@ interface ResolvedLabel {
|
|
|
2046
2046
|
style: TextStyle;
|
|
2047
2047
|
/** Whether this label is visible or was demoted to tooltip-only by collision detection. */
|
|
2048
2048
|
visible: boolean;
|
|
2049
|
+
/** Maximum available width for the label text. When set, the renderer should wrap or truncate. */
|
|
2050
|
+
maxWidth?: number;
|
|
2049
2051
|
/** If not at the anchor point, draw a connector line from label to anchor. */
|
|
2050
2052
|
connector?: {
|
|
2051
2053
|
/** Connector start (at the label). */
|
|
@@ -2777,7 +2779,7 @@ declare function estimateTextWidth(text: string, fontSize: number, fontWeight?:
|
|
|
2777
2779
|
* so adjacent text doesn't crowd it. Used by chrome and legend layout to avoid
|
|
2778
2780
|
* overlapping the brand.
|
|
2779
2781
|
*/
|
|
2780
|
-
declare const BRAND_RESERVE_WIDTH =
|
|
2782
|
+
declare const BRAND_RESERVE_WIDTH = 130;
|
|
2781
2783
|
/** Font size of the brand watermark (px). Shared between layout and renderer. */
|
|
2782
2784
|
declare const BRAND_FONT_SIZE = 12;
|
|
2783
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.
|
|
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 =
|
|
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) {
|