@opendata-ai/openchart-engine 8.3.0 → 8.3.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.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9722,11 +9722,11 @@ function applyFillPatterns(marks, markDef, theme) {
|
|
|
9722
9722
|
// src/compile/layer.ts
|
|
9723
9723
|
import {
|
|
9724
9724
|
AXIS_TITLE_TRAILING_PAD as AXIS_TITLE_TRAILING_PAD2,
|
|
9725
|
+
axisTitleOffset as axisTitleOffset3,
|
|
9725
9726
|
BREAKPOINT_COMPACT_MAX as BREAKPOINT_COMPACT_MAX2,
|
|
9726
9727
|
computeFieldFormatContext as computeFieldFormatContext5,
|
|
9727
9728
|
defaultNumberFormatter as defaultNumberFormatter7,
|
|
9728
9729
|
estimateTextWidth as estimateTextWidth17,
|
|
9729
|
-
getAxisTitleOffset as getAxisTitleOffset2,
|
|
9730
9730
|
resolveNumberFormatter as resolveNumberFormatter5,
|
|
9731
9731
|
resolveTheme as resolveTheme2,
|
|
9732
9732
|
TICK_LABEL_OFFSET
|
|
@@ -12149,9 +12149,9 @@ function compileLayerIndependent(leaves, layerSpec, options, compileChart2) {
|
|
|
12149
12149
|
const hasRightAxisTitle = !!yAxisConfig?.title;
|
|
12150
12150
|
const tickExtent = TICK_LABEL_OFFSET + rightAxisWidth;
|
|
12151
12151
|
const bodyFontSize = theme.fonts?.sizes?.body ?? 13;
|
|
12152
|
-
const axisTitleOffset4 = getAxisTitleOffset2(options.width);
|
|
12153
12152
|
const halfGlyph = Math.ceil(bodyFontSize / 2);
|
|
12154
|
-
const
|
|
12153
|
+
const titleCenterOffset = axisTitleOffset3(rightAxisWidth, bodyFontSize, options.width);
|
|
12154
|
+
const titleExtent = hasRightAxisTitle ? titleCenterOffset + halfGlyph + (options.width < BREAKPOINT_COMPACT_MAX2 ? 0 : AXIS_TITLE_TRAILING_PAD2) : 0;
|
|
12155
12155
|
const rightReserve = Math.max(tickExtent, titleExtent);
|
|
12156
12156
|
const optionsWithReserve = {
|
|
12157
12157
|
...options,
|
|
@@ -12186,7 +12186,7 @@ function compileLayerIndependent(leaves, layerSpec, options, compileChart2) {
|
|
|
12186
12186
|
},
|
|
12187
12187
|
...layout1.axes.y.label ? {
|
|
12188
12188
|
titlePosition: {
|
|
12189
|
-
x: layout0.area.x + layout0.area.width +
|
|
12189
|
+
x: layout0.area.x + layout0.area.width + axisTitleOffset3(rightAxisWidth, bodyFontSize, layout0.dimensions.width),
|
|
12190
12190
|
y: layout0.area.y + layout0.area.height / 2,
|
|
12191
12191
|
angle: 90
|
|
12192
12192
|
}
|
|
@@ -14544,7 +14544,7 @@ var DEFAULT_COLLISION_PADDING = 5;
|
|
|
14544
14544
|
// src/layout/dimensions.ts
|
|
14545
14545
|
import {
|
|
14546
14546
|
AXIS_TITLE_TRAILING_PAD as AXIS_TITLE_TRAILING_PAD3,
|
|
14547
|
-
axisTitleOffset as
|
|
14547
|
+
axisTitleOffset as axisTitleOffset4,
|
|
14548
14548
|
BREAKPOINT_COMPACT_MAX as BREAKPOINT_COMPACT_MAX3,
|
|
14549
14549
|
computeChrome as computeChrome5,
|
|
14550
14550
|
computeFieldFormatContext as computeFieldFormatContext6,
|
|
@@ -14905,7 +14905,7 @@ function computeDimensions(spec, options, legendLayout, theme, strategy, waterma
|
|
|
14905
14905
|
);
|
|
14906
14906
|
}
|
|
14907
14907
|
const titleFontSize = theme.fonts.sizes.body;
|
|
14908
|
-
const offset =
|
|
14908
|
+
const offset = axisTitleOffset4(estTickLabelWidth, titleFontSize, width, yIsInlinePre);
|
|
14909
14909
|
const halfGlyph = Math.ceil(titleFontSize / 2);
|
|
14910
14910
|
const rotatedLabelMargin = offset + halfGlyph + (width < BREAKPOINT_COMPACT_MAX3 ? 0 : AXIS_TITLE_TRAILING_PAD3);
|
|
14911
14911
|
margins.left = Math.max(margins.left, hPad + rotatedLabelMargin);
|