Skip to content

Commit 647d820

Browse files
committed
fix: circular dep
1 parent 7fdaf55 commit 647d820

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

packages/charts/src/common/text_utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type { $Values as Values } from 'utility-types';
1111
import type { Color } from './colors';
1212
import type { Pixels, Rectangle } from './geometry';
1313
import type { ArrayEntry } from '../chart_types/partition_chart/layout/utils/group_by_rollup';
14-
import { ELLIPSIS } from '../renderers/canvas/primitives/text';
1514
import { integerSnap, monotonicHillClimb } from '../solvers/monotonic_hill_climb';
1615
import type { TextMeasure } from '../utils/bbox/canvas_text_bbox_calculator';
1716
import type { Datum } from '../utils/common';
@@ -76,6 +75,13 @@ export const TEXT_BASELINE = Object.freeze([
7675
'bottom',
7776
] as const);
7877

78+
/** @internal */
79+
export const ELLIPSIS = '…';
80+
/** @internal */
81+
export const SPACE = ' ';
82+
/** @internal */
83+
export const DASH = '-';
84+
7985
/** @internal */
8086
export interface Box extends Font {
8187
text: string;

packages/charts/src/renderers/canvas/primitives/text.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { withContext } from '..';
1010
import type { Degrees } from '../../../common/geometry';
1111
import type { Font, TextAlign, TextBaseline } from '../../../common/text_utils';
12-
import { cssFontShorthand } from '../../../common/text_utils';
12+
import { cssFontShorthand, DASH, ELLIPSIS, SPACE } from '../../../common/text_utils';
1313
import { measureText } from '../../../utils/bbox/canvas_text_bbox_calculator';
1414
import { degToRad } from '../../../utils/common';
1515
import type { Point } from '../../../utils/point';
@@ -60,12 +60,6 @@ export function renderText(
6060
});
6161
}
6262

63-
/** @internal */
64-
export const ELLIPSIS = '…';
65-
66-
const SPACE = ' ';
67-
const DASH = '-';
68-
6963
interface Options {
7064
wrapAtWord: boolean;
7165
shouldAddEllipsis: boolean;

packages/charts/src/utils/text/wrap.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9-
import type { Font } from '../../common/text_utils';
10-
import { ELLIPSIS } from '../../renderers/canvas/primitives/text';
9+
import { ELLIPSIS, type Font } from '../../common/text_utils';
1110
import { monotonicHillClimb } from '../../solvers/monotonic_hill_climb';
1211
import type { TextMeasure } from '../bbox/canvas_text_bbox_calculator';
1312

0 commit comments

Comments
 (0)