ingred-ui 37.5.0-canary.0 → 37.5.0

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.
@@ -24,9 +24,11 @@ export declare const ChartValueAxis: React.FC<ChartValueAxisProps>;
24
24
  type ChartCategoryLabelsProps = {
25
25
  orientation: BarChartOrientation;
26
26
  labels: string[];
27
+ width: number;
27
28
  height: number;
28
29
  paddingBottom: number;
29
30
  paddingLeft: number;
31
+ paddingRight: number;
30
32
  paddingTop: number;
31
33
  slotWidth: number;
32
34
  labelEvery: number;
@@ -10,7 +10,7 @@ type ChartScrollViewportProps = {
10
10
  ariaLabel: string;
11
11
  chartLayout: ChartLayout;
12
12
  /**
13
- * 縦方向チャートの金額ラベル。スクロール領域の外に固定する。
13
+ * 縦方向チャートの金額ラベル。横にはみ出すときだけ、スクロール領域の外に固定する。
14
14
  * horizontal では渡さない(値軸が横方向のため)。
15
15
  */
16
16
  stickyAxes?: ChartStickyAxisSpec[];
@@ -0,0 +1,22 @@
1
+ export type CategoryLabelPlacement = {
2
+ x: number;
3
+ textAnchor: "start" | "middle";
4
+ };
5
+ /**
6
+ * 文字幅の見積もり。日付のような ASCII は fontSize の 0.62 倍、
7
+ * それ以外は fontSize と同じ幅として扱う。
8
+ */
9
+ export declare function estimateCategoryLabelWidth(label: string, fontSize: number): number;
10
+ /**
11
+ * 縦グラフのカテゴリラベルを、左右の余白にはみ出さない位置に置く。
12
+ * 収まるときはスロット中央。はみ出す分だけ内側へずらす。
13
+ */
14
+ export declare function getVerticalCategoryLabelPlacement({ label, index, slotWidth, paddingLeft, paddingRight, width, fontSize, }: {
15
+ label: string;
16
+ index: number;
17
+ slotWidth: number;
18
+ paddingLeft: number;
19
+ paddingRight: number;
20
+ width: number;
21
+ fontSize: number;
22
+ }): CategoryLabelPlacement;
@@ -4,6 +4,7 @@ export type ChartLayoutConfig = {
4
4
  minSlotSize: number;
5
5
  narrowContainerBreakpoint: number;
6
6
  horizontalMinValueWidth: number;
7
+ horizontalMinSlotSize: number;
7
8
  };
8
9
  export type ChartLayoutOptions = {
9
10
  categoryCount: number;