@barefootjs/chart 0.1.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.
- package/dist/chart-container.d.ts +10 -0
- package/dist/chart-container.d.ts.map +1 -0
- package/dist/context.d.ts +10 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2254 -0
- package/dist/types.d.ts +235 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/arcs.d.ts +44 -0
- package/dist/utils/arcs.d.ts.map +1 -0
- package/dist/utils/areas.d.ts +23 -0
- package/dist/utils/areas.d.ts.map +1 -0
- package/dist/utils/classes.d.ts +24 -0
- package/dist/utils/classes.d.ts.map +1 -0
- package/dist/utils/lines.d.ts +18 -0
- package/dist/utils/lines.d.ts.map +1 -0
- package/dist/utils/radar.d.ts +25 -0
- package/dist/utils/radar.d.ts.map +1 -0
- package/dist/utils/scales.d.ts +12 -0
- package/dist/utils/scales.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/chart-container.ts +17 -0
- package/src/context.ts +14 -0
- package/src/index.ts +75 -0
- package/src/types.ts +270 -0
- package/src/utils/arcs.ts +149 -0
- package/src/utils/areas.ts +69 -0
- package/src/utils/classes.ts +24 -0
- package/src/utils/lines.ts +61 -0
- package/src/utils/radar.ts +53 -0
- package/src/utils/scales.ts +64 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Apply CSS variables from ChartConfig to a container element.
|
|
4
|
+
* Sets --color-{key} for each config entry.
|
|
5
|
+
*
|
|
6
|
+
* Reused by the JSX-native `ChartContainer` ref callback in
|
|
7
|
+
* `ui/components/ui/chart/index.tsx`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyChartCSSVariables(container: HTMLElement, config: ChartConfig): void;
|
|
10
|
+
//# sourceMappingURL=chart-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../src/chart-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,WAAW,EACtB,MAAM,EAAE,WAAW,GAClB,IAAI,CAIN"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BarChartContextValue, RadialChartContextValue, RadarChartContextValue, PieChartContextValue, AreaChartContextValue, ChartConfig } from './types';
|
|
2
|
+
export declare const BarChartContext: import("@barefootjs/client/runtime").Context<BarChartContextValue>;
|
|
3
|
+
export declare const RadialChartContext: import("@barefootjs/client/runtime").Context<RadialChartContextValue>;
|
|
4
|
+
export declare const RadarChartContext: import("@barefootjs/client/runtime").Context<RadarChartContextValue>;
|
|
5
|
+
export declare const PieChartContext: import("@barefootjs/client/runtime").Context<PieChartContextValue>;
|
|
6
|
+
export declare const AreaChartContext: import("@barefootjs/client/runtime").Context<AreaChartContextValue>;
|
|
7
|
+
export declare const ChartConfigContext: import("@barefootjs/client/runtime").Context<{
|
|
8
|
+
config: ChartConfig;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE9J,eAAO,MAAM,eAAe,oEAAwC,CAAA;AAEpE,eAAO,MAAM,kBAAkB,uEAA2C,CAAA;AAE1E,eAAO,MAAM,iBAAiB,sEAA0C,CAAA;AAExE,eAAO,MAAM,eAAe,oEAAwC,CAAA;AAEpE,eAAO,MAAM,gBAAgB,qEAAyC,CAAA;AAEtE,eAAO,MAAM,kBAAkB;YAA2B,WAAW;EAAK,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { BarChartContext, RadialChartContext, RadarChartContext, PieChartContext, AreaChartContext, ChartConfigContext } from './context';
|
|
2
|
+
export { createBandScale, createLinearScale, createPointScale, createRadarRadialScale } from './utils/scales';
|
|
3
|
+
export { buildRadialBarArcs, buildPieSlices, type RadialBarArcSpec, type PieSliceSpec } from './utils/arcs';
|
|
4
|
+
export { buildLinePath, buildLinePoints, type LinePoint } from './utils/lines';
|
|
5
|
+
export { buildAreaPaths, buildAreaDots, type AreaPaths, type AreaDot } from './utils/areas';
|
|
6
|
+
export { buildRadarVertices, buildRadarPolygonPoints, type RadarVertex } from './utils/radar';
|
|
7
|
+
export { CHART_CLASS_GRID, CHART_CLASS_X_AXIS, CHART_CLASS_Y_AXIS, CHART_CLASS_POLAR_GRID, CHART_CLASS_POLAR_ANGLE_AXIS, CHART_CLASS_RADIAL_BAR, CHART_CLASS_RADIAL_LABEL, CHART_CLASS_BAR, CHART_CLASS_LINE, CHART_CLASS_AREA, CHART_CLASS_AREA_DOT, CHART_CLASS_RADAR, CHART_CLASS_PIE, CHART_CLASS_TOOLTIP, } from './utils/classes';
|
|
8
|
+
export { applyChartCSSVariables } from './chart-container';
|
|
9
|
+
export type { ChartConfig, BarRegistration, RadialBarRegistration, RadarRegistration, PieRegistration, AreaRegistration, ChartContainerProps, BarChartProps, BarProps, PieChartProps, PieProps, PieTooltipProps, AreaChartProps, AreaProps, LineChartProps, LineProps, CartesianGridProps, XAxisProps, YAxisProps, ChartTooltipProps, RadialChartProps, RadialBarProps, RadialChartLabelProps, RadarChartProps, RadarProps, PolarGridProps, PolarAngleAxisProps, RadarTooltipProps, } from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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