@selectwin/kit 0.1.179 → 0.1.180
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/SelectLineChart.d.ts +7 -1
- package/dist/chartUtils.d.ts +9 -0
- package/dist/index.js +430 -399
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,13 @@ type SelectLineChartOwnProps = {
|
|
|
6
6
|
height?: number;
|
|
7
7
|
format?: (n: number) => string;
|
|
8
8
|
area?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Ocupa a altura que sobra no pai (0.1.180): `height` vira o PISO e o gráfico cresce até o fim da coluna — o card
|
|
11
|
+
* do gráfico ao lado de um card mais alto fecha sem faixa branca embaixo. O pai precisa ser uma coluna flex que
|
|
12
|
+
* estica (ex.: `SelectStack fill growLast`, com o gráfico por último); fora dela, fica na altura `height`.
|
|
13
|
+
*/
|
|
14
|
+
fill?: boolean;
|
|
9
15
|
};
|
|
10
16
|
export type SelectLineChartProps = SelectLineChartOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectLineChartOwnProps>;
|
|
11
|
-
export declare function SelectLineChart({ series, labels, height, format, area, className, ...rest }: SelectLineChartProps): import("react").JSX.Element;
|
|
17
|
+
export declare function SelectLineChart({ series, labels, height: baseHeight, format, area, fill, className, style, ...rest }: SelectLineChartProps): import("react").JSX.Element;
|
|
12
18
|
export {};
|
package/dist/chartUtils.d.ts
CHANGED
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
export declare function useChartSize(height: number): {
|
|
4
4
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
5
5
|
width: number;
|
|
6
|
+
boxHeight: number;
|
|
6
7
|
height: number;
|
|
7
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Recuo esquerdo do plot na medida do MAIOR rótulo do eixo Y (0.1.180). O recuo fixo de 48px cabia "R$ 8 mil", mas
|
|
11
|
+
* "R$ 500,00" e "R$ 1,5 mil" vazavam para a esquerda do SVG e encostavam na borda do card, fora do alinhamento do
|
|
12
|
+
* resto do conteúdo. Agora o rótulo mais largo começa no x=0 do gráfico — na mesma linha do que está acima dele.
|
|
13
|
+
* Mede com o canvas (a fonte do eixo: 500, 0.6875rem, na família do próprio gráfico — `el`, a caixa dele; o `body` do
|
|
14
|
+
* app pode ter outra); sem canvas (teste), estima pela contagem de caracteres.
|
|
15
|
+
*/
|
|
16
|
+
export declare function yAxisPad(labels: string[], el?: Element | null): number;
|
|
8
17
|
/** Live pixel width of a ref'd element, for viewBox SVGs whose box is sized in rem (so it
|
|
9
18
|
* scales with the fluid root): feeding the measured px back into the geometry keeps the
|
|
10
19
|
* viewBox 1:1 with the rendered px, so px-positioned HTML overlays (tooltips) stay aligned.
|