@octanejs/visx 0.1.30 → 0.1.32
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/package.json +4 -4
- package/src/annotation/components/CircleSubject.tsrx +2 -2
- package/src/annotation/components/CircleSubject.tsrx.d.ts +2 -2
- package/src/annotation/components/Connector.tsrx +2 -2
- package/src/annotation/components/Connector.tsrx.d.ts +2 -2
- package/src/annotation/components/EditableAnnotation.tsrx +4 -3
- package/src/annotation/components/EditableAnnotation.tsrx.d.ts +4 -3
- package/src/annotation/components/Label.tsrx +3 -2
- package/src/annotation/components/Label.tsrx.d.ts +2 -2
- package/src/annotation/components/LineSubject.tsrx +2 -2
- package/src/annotation/components/LineSubject.tsrx.d.ts +2 -2
- package/src/axis/types.ts +3 -2
- package/src/brush/BaseBrush.tsrx +3 -2
- package/src/brush/BaseBrush.tsrx.d.ts +3 -2
- package/src/brush/Brush.tsrx +2 -2
- package/src/brush/Brush.tsrx.d.ts +2 -2
- package/src/brush/BrushSelection.tsrx +3 -2
- package/src/brush/BrushSelection.tsrx.d.ts +3 -2
- package/src/chord/Ribbon.tsrx +2 -2
- package/src/chord/Ribbon.tsrx.d.ts +2 -2
- package/src/clip-path/clip-paths/CircleClipPath.tsrx +2 -2
- package/src/clip-path/clip-paths/CircleClipPath.tsrx.d.ts +2 -2
- package/src/clip-path/clip-paths/ClipPath.tsrx +2 -2
- package/src/clip-path/clip-paths/ClipPath.tsrx.d.ts +2 -2
- package/src/clip-path/clip-paths/RectClipPath.tsrx +2 -2
- package/src/clip-path/clip-paths/RectClipPath.tsrx.d.ts +2 -2
- package/src/delaunay/components/Polygon.tsrx +2 -2
- package/src/delaunay/components/Polygon.tsrx.d.ts +2 -2
- package/src/external.d.ts +12 -0
- package/src/geo/graticule/Graticule.tsrx +2 -2
- package/src/geo/graticule/Graticule.tsrx.d.ts +2 -2
- package/src/geo/projections/Projection.tsrx +3 -2
- package/src/geo/projections/Projection.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphCircle.tsrx +2 -2
- package/src/glyph/glyphs/GlyphCircle.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphCross.tsrx +2 -2
- package/src/glyph/glyphs/GlyphCross.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphDiamond.tsrx +2 -2
- package/src/glyph/glyphs/GlyphDiamond.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphDot.tsrx +2 -2
- package/src/glyph/glyphs/GlyphDot.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphSquare.tsrx +2 -2
- package/src/glyph/glyphs/GlyphSquare.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphStar.tsrx +2 -2
- package/src/glyph/glyphs/GlyphStar.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphTriangle.tsrx +2 -2
- package/src/glyph/glyphs/GlyphTriangle.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphWye.tsrx +2 -2
- package/src/glyph/glyphs/GlyphWye.tsrx.d.ts +2 -2
- package/src/gradient/gradients/LinearGradient.tsrx +2 -2
- package/src/gradient/gradients/LinearGradient.tsrx.d.ts +2 -2
- package/src/gradient/gradients/RadialGradient.tsrx +2 -2
- package/src/gradient/gradients/RadialGradient.tsrx.d.ts +2 -2
- package/src/heatmap/heatmaps/HeatmapCircle.tsrx +2 -2
- package/src/heatmap/heatmaps/HeatmapCircle.tsrx.d.ts +2 -2
- package/src/heatmap/heatmaps/HeatmapRect.tsrx +2 -2
- package/src/heatmap/heatmaps/HeatmapRect.tsrx.d.ts +2 -2
- package/src/hierarchy/hierarchies/Cluster.tsrx +7 -3
- package/src/hierarchy/hierarchies/Pack.tsrx +5 -2
- package/src/hierarchy/hierarchies/Partition.tsrx +5 -2
- package/src/hierarchy/hierarchies/Tree.tsrx +7 -3
- package/src/hierarchy/hierarchies/Treemap.tsrx +5 -2
- package/src/marker/markers/Marker.tsrx +2 -2
- package/src/marker/markers/Marker.tsrx.d.ts +2 -2
- package/src/network/DefaultNode.tsrx +2 -2
- package/src/network/DefaultNode.tsrx.d.ts +2 -2
- package/src/network/Links.tsrx +5 -2
- package/src/network/Nodes.tsrx +5 -2
- package/src/react-spring/grid/AnimatedGridLines.tsrx +2 -2
- package/src/react-spring/grid/AnimatedGridLines.tsrx.d.ts +2 -2
- package/src/stats/BoxPlot.tsrx +7 -7
- package/src/stats/BoxPlot.tsrx.d.ts +7 -7
- package/src/stats/ViolinPlot.tsrx +2 -2
- package/src/stats/ViolinPlot.tsrx.d.ts +2 -2
- package/src/threshold/Threshold.tsrx +2 -2
- package/src/threshold/Threshold.tsrx.d.ts +2 -2
- package/src/tooltip/context/TooltipPositionContext.tsrx +15 -1
- package/src/tooltip/context/TooltipPositionContext.tsrx.d.ts +10 -1
- package/src/voronoi/components/VoronoiPolygon.tsrx +2 -2
- package/src/voronoi/components/VoronoiPolygon.tsrx.d.ts +2 -2
- package/src/xychart/components/Tooltip.tsrx +6 -5
- package/src/xychart/components/Tooltip.tsrx.d.ts +5 -5
- package/src/xychart/components/annotation/AnnotationLineSubject.tsrx +2 -2
- package/src/xychart/components/annotation/AnnotationLineSubject.tsrx.d.ts +2 -2
- package/src/xychart/components/series/private/AnimatedPath.tsrx +2 -3
- package/src/xychart/components/series/private/AnimatedPath.tsrx.d.ts +2 -2
- package/src/xychart/components/series/private/BaseAreaSeries.tsrx +5 -4
- package/src/xychart/components/series/private/BaseAreaSeries.tsrx.d.ts +5 -4
- package/src/xychart/components/series/private/BaseAreaStack.tsrx +4 -3
- package/src/xychart/components/series/private/BaseAreaStack.tsrx.d.ts +3 -2
- package/src/xychart/components/series/private/BaseLineSeries.tsrx +4 -3
- package/src/xychart/components/series/private/BaseLineSeries.tsrx.d.ts +4 -3
- package/src/xychart/types/series.ts +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
2
2
|
import type { OctaneNode } from 'octane';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import type { PickD3Scale, ContinuousDomainScaleType } from '@octanejs/visx/scale';
|
|
@@ -36,7 +36,7 @@ export default function ViolinPlot<Datum extends object>({
|
|
|
36
36
|
horizontal,
|
|
37
37
|
children,
|
|
38
38
|
...restProps
|
|
39
|
-
}: ViolinPlotProps<Datum> & Omit<SVGProps<SVGPathElement>, keyof ViolinPlotProps<Datum>>) {
|
|
39
|
+
}: ViolinPlotProps<Datum> & Omit<Octane.SVGProps<SVGPathElement>, keyof ViolinPlotProps<Datum>>) {
|
|
40
40
|
const center = (horizontal ? top : left) + width / 2;
|
|
41
41
|
const binCounts = data.map((bin) => count(bin));
|
|
42
42
|
const widthScale = scaleLinear<number>({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import type { OctaneNode } from 'octane';
|
|
4
4
|
import type { PickD3Scale, ContinuousDomainScaleType } from '@octanejs/visx/scale';
|
|
5
5
|
import type { SharedProps } from './types';
|
|
@@ -19,4 +19,4 @@ export type ViolinPlotProps<Datum extends object> = SharedProps & {
|
|
|
19
19
|
path: string;
|
|
20
20
|
}) => OctaneNode;
|
|
21
21
|
};
|
|
22
|
-
export default function ViolinPlot<Datum extends object>({ left, top, className, data, width, count, value, valueScale, horizontal, children, ...restProps }: ViolinPlotProps<Datum> & Omit<SVGProps<SVGPathElement>, keyof ViolinPlotProps<Datum>>): import("react").JSX.Element;
|
|
22
|
+
export default function ViolinPlot<Datum extends object>({ left, top, className, data, width, count, value, valueScale, horizontal, children, ...restProps }: ViolinPlotProps<Datum> & Omit<Octane.SVGProps<SVGPathElement>, keyof ViolinPlotProps<Datum>>): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { Area } from '@octanejs/visx/shape';
|
|
4
4
|
import type { AreaProps as AreaOwnProps } from '@octanejs/visx/shape';
|
|
@@ -6,7 +6,7 @@ import { ClipPath } from '@octanejs/visx/clip-path';
|
|
|
6
6
|
import useStableId from '../kernel/ids/useStableId.tsrx';
|
|
7
7
|
|
|
8
8
|
type AreaProps<Datum> =
|
|
9
|
-
AreaOwnProps<Datum> & Omit<SVGProps<SVGPathElement>, keyof AreaOwnProps<Datum>>;
|
|
9
|
+
AreaOwnProps<Datum> & Omit<Octane.SVGProps<SVGPathElement>, keyof AreaOwnProps<Datum>>;
|
|
10
10
|
|
|
11
11
|
type NumberAccessor<Datum> = (datum: Datum, index: number, data: Datum[]) => number;
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import type { AreaProps as AreaOwnProps } from '@octanejs/visx/shape';
|
|
4
|
-
type AreaProps<Datum> = AreaOwnProps<Datum> & Omit<SVGProps<SVGPathElement>, keyof AreaOwnProps<Datum>>;
|
|
4
|
+
type AreaProps<Datum> = AreaOwnProps<Datum> & Omit<Octane.SVGProps<SVGPathElement>, keyof AreaOwnProps<Datum>>;
|
|
5
5
|
type NumberAccessor<Datum> = (datum: Datum, index: number, data: Datum[]) => number;
|
|
6
6
|
export type ThresholdProps<Datum> = {
|
|
7
7
|
/** className applied to container g element. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from 'octane';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
|
|
3
4
|
export type TooltipPositionContextType = {
|
|
4
5
|
isFlippedVertically: boolean;
|
|
@@ -11,6 +12,19 @@ const TooltipPositionContext = createContext<TooltipPositionContextType>({
|
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
export const TooltipPositionProvider = TooltipPositionContext.Provider;
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Octane deliberately has no render-prop `Context.Consumer` (see
|
|
18
|
+
* docs/differences-from-react.md); reading `.Consumer` returns `undefined` and
|
|
19
|
+
* warns in development. Keep upstream's render-prop API by reading the context
|
|
20
|
+
* with `useContext` instead.
|
|
21
|
+
*/
|
|
22
|
+
export function TooltipPositionConsumer({
|
|
23
|
+
children,
|
|
24
|
+
}: {
|
|
25
|
+
children: (value: TooltipPositionContextType) => OctaneNode;
|
|
26
|
+
}) {
|
|
27
|
+
return <>{children(useContext(TooltipPositionContext))}</>;
|
|
28
|
+
}
|
|
15
29
|
|
|
16
30
|
export const useTooltipPosition = () => useContext(TooltipPositionContext);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
export type TooltipPositionContextType = {
|
|
3
4
|
isFlippedVertically: boolean;
|
|
4
5
|
isFlippedHorizontally: boolean;
|
|
@@ -7,5 +8,13 @@ export declare const TooltipPositionProvider: import("octane").ComponentBody<{
|
|
|
7
8
|
value: TooltipPositionContextType;
|
|
8
9
|
children?: any;
|
|
9
10
|
}, any>;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Octane deliberately has no render-prop `Context.Consumer` (see
|
|
13
|
+
* docs/differences-from-react.md); reading `.Consumer` returns `undefined` and
|
|
14
|
+
* warns in development. Keep upstream's render-prop API by reading the context
|
|
15
|
+
* with `useContext` instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TooltipPositionConsumer({ children, }: {
|
|
18
|
+
children: (value: TooltipPositionContextType) => OctaneNode;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
11
20
|
export declare const useTooltipPosition: () => TooltipPositionContextType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
2
2
|
import type { OctaneNode } from 'octane';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ export default function VoronoiPolygon({
|
|
|
22
22
|
className,
|
|
23
23
|
children,
|
|
24
24
|
...restProps
|
|
25
|
-
}: VoronoiPolygonProps & Omit<SVGProps<SVGPathElement>, keyof VoronoiPolygonProps>) {
|
|
25
|
+
}: VoronoiPolygonProps & Omit<Octane.SVGProps<SVGPathElement>, keyof VoronoiPolygonProps>) {
|
|
26
26
|
if (!polygon) return null;
|
|
27
27
|
const path = `M${polygon.join('L')}Z`;
|
|
28
28
|
if (children) return <>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import type { OctaneNode } from 'octane';
|
|
4
4
|
export type VoronoiPolygonProps = {
|
|
5
5
|
/** Override render function which is provided polygon and generated path. */
|
|
@@ -12,4 +12,4 @@ export type VoronoiPolygonProps = {
|
|
|
12
12
|
/** Array of coordinate arrays for the polygon (e.g., [[x,y], [x1,y1], ...]), used to generate polygon path. */
|
|
13
13
|
polygon?: [number, number][];
|
|
14
14
|
};
|
|
15
|
-
export default function VoronoiPolygon({ polygon, className, children, ...restProps }: VoronoiPolygonProps & Omit<SVGProps<SVGPathElement>, keyof VoronoiPolygonProps>): import("react").JSX.Element | null;
|
|
15
|
+
export default function VoronoiPolygon({ polygon, className, children, ...restProps }: VoronoiPolygonProps & Omit<Octane.SVGProps<SVGPathElement>, keyof VoronoiPolygonProps>): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useRef } from 'octane';
|
|
2
|
-
import type { CSSProperties
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { OctaneNode } from 'octane';
|
|
4
5
|
import { useTooltipInPortal, defaultStyles } from '@octanejs/visx/tooltip';
|
|
5
6
|
import type {
|
|
@@ -27,7 +28,7 @@ export type RenderTooltipParams<Datum extends object> = TooltipContextType<Datum
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export interface RenderTooltipGlyphProps<Datum extends object> extends RenderGlyphProps<Datum> {
|
|
30
|
-
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
31
|
+
glyphStyle?: Octane.SVGProps<SVGCircleElement>;
|
|
31
32
|
isNearestDatum: boolean;
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -58,11 +59,11 @@ export type TooltipProps<Datum extends object> = {
|
|
|
58
59
|
/** Whether to show a glyph for the nearest Datum in each series. */
|
|
59
60
|
showSeriesGlyphs?: boolean;
|
|
60
61
|
/** Optional styles for the vertical crosshair, if visible. */
|
|
61
|
-
verticalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
62
|
+
verticalCrosshairStyle?: Octane.SVGProps<SVGLineElement>;
|
|
62
63
|
/** Optional styles for the vertical crosshair, if visible. */
|
|
63
|
-
horizontalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
64
|
+
horizontalCrosshairStyle?: Octane.SVGProps<SVGLineElement>;
|
|
64
65
|
/** Optional styles for the point, if visible. */
|
|
65
|
-
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
66
|
+
glyphStyle?: Octane.SVGProps<SVGCircleElement>;
|
|
66
67
|
/**
|
|
67
68
|
* Tooltip depends on ResizeObserver, which may be polyfilled globally,
|
|
68
69
|
* passed to XYChart, or injected into this component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import type { OctaneNode } from 'octane';
|
|
4
4
|
import type { TooltipProps as BaseTooltipProps, UseTooltipPortalOptions } from '@octanejs/visx/tooltip';
|
|
5
5
|
import type { PickD3Scale } from '@octanejs/visx/scale';
|
|
@@ -8,7 +8,7 @@ export type RenderTooltipParams<Datum extends object> = TooltipContextType<Datum
|
|
|
8
8
|
colorScale?: PickD3Scale<'ordinal', string, string>;
|
|
9
9
|
};
|
|
10
10
|
export interface RenderTooltipGlyphProps<Datum extends object> extends RenderGlyphProps<Datum> {
|
|
11
|
-
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
11
|
+
glyphStyle?: Octane.SVGProps<SVGCircleElement>;
|
|
12
12
|
isNearestDatum: boolean;
|
|
13
13
|
}
|
|
14
14
|
export type TooltipProps<Datum extends object> = {
|
|
@@ -38,11 +38,11 @@ export type TooltipProps<Datum extends object> = {
|
|
|
38
38
|
/** Whether to show a glyph for the nearest Datum in each series. */
|
|
39
39
|
showSeriesGlyphs?: boolean;
|
|
40
40
|
/** Optional styles for the vertical crosshair, if visible. */
|
|
41
|
-
verticalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
41
|
+
verticalCrosshairStyle?: Octane.SVGProps<SVGLineElement>;
|
|
42
42
|
/** Optional styles for the vertical crosshair, if visible. */
|
|
43
|
-
horizontalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
43
|
+
horizontalCrosshairStyle?: Octane.SVGProps<SVGLineElement>;
|
|
44
44
|
/** Optional styles for the point, if visible. */
|
|
45
|
-
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
45
|
+
glyphStyle?: Octane.SVGProps<SVGCircleElement>;
|
|
46
46
|
/**
|
|
47
47
|
* Tooltip depends on ResizeObserver, which may be polyfilled globally,
|
|
48
48
|
* passed to XYChart, or injected into this component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import { LineSubject as BaseLineSubject } from '@octanejs/visx/annotation';
|
|
4
4
|
import type { LineSubjectProps } from '@octanejs/visx/annotation';
|
|
5
5
|
import DataContext from '../../context/DataContext.tsrx';
|
|
@@ -14,7 +14,7 @@ export default function AnnotationLineSubject({
|
|
|
14
14
|
min,
|
|
15
15
|
max,
|
|
16
16
|
...props
|
|
17
|
-
}: AnnotationLineSubjectProps & Omit<SVGProps<SVGLineElement>, keyof AnnotationLineSubjectProps>) {
|
|
17
|
+
}: AnnotationLineSubjectProps & Omit<Octane.SVGProps<SVGLineElement>, keyof AnnotationLineSubjectProps>) {
|
|
18
18
|
const { theme, margin, innerHeight = 0, innerWidth = 0 } = useContext(DataContext);
|
|
19
19
|
return <BaseLineSubject
|
|
20
20
|
stroke={theme?.axisStyles.x.bottom.axisLine.stroke}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import type { LineSubjectProps } from '@octanejs/visx/annotation';
|
|
4
4
|
export type AnnotationLineSubjectProps = Omit<LineSubjectProps, 'min' | 'max'> & {
|
|
5
5
|
min?: number;
|
|
6
6
|
max?: number;
|
|
7
7
|
};
|
|
8
8
|
/** AnnotationLineSubject which provides color and dimensions from context. */
|
|
9
|
-
export default function AnnotationLineSubject({ min, max, ...props }: AnnotationLineSubjectProps & Omit<SVGProps<SVGLineElement>, keyof AnnotationLineSubjectProps>): import("react").JSX.Element;
|
|
9
|
+
export default function AnnotationLineSubject({ min, max, ...props }: AnnotationLineSubjectProps & Omit<Octane.SVGProps<SVGLineElement>, keyof AnnotationLineSubjectProps>): import("react").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { memo, useCallback, useRef } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
3
|
import { animated, useSpring } from '../../../../internal/spring.tsrx';
|
|
4
|
-
// @ts-expect-error no types
|
|
5
4
|
import { interpolatePath } from 'd3-interpolate-path';
|
|
6
5
|
import { debounce } from '@octanejs/visx/responsive';
|
|
7
6
|
|
|
@@ -10,7 +9,7 @@ function AnimatedPath({
|
|
|
10
9
|
stroke = 'transparent',
|
|
11
10
|
fill = 'transparent',
|
|
12
11
|
...lineProps
|
|
13
|
-
}: Omit<SVGProps<SVGPathElement>, 'ref'>) {
|
|
12
|
+
}: Omit<Octane.SVGProps<SVGPathElement>, 'ref'>) {
|
|
14
13
|
const previousD = useRef(d);
|
|
15
14
|
// updating d in quick succession will ruin the animation because startD === endD.
|
|
16
15
|
// debounce it slightly
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
3
|
-
declare const _default: import("octane").ComponentBody<Omit<SVGProps<SVGPathElement>, "ref">, any>;
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
|
+
declare const _default: import("octane").ComponentBody<Omit<Octane.SVGProps<SVGPathElement>, "ref">, any>;
|
|
4
4
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Fragment, useContext, useCallback, useMemo, useEffect } from 'octane';
|
|
2
|
-
import type { FC
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
5
|
import type { AreaProps, LinePathProps } from '@octanejs/visx/shape';
|
|
5
6
|
import { Area, LinePath } from '@octanejs/visx/shape';
|
|
@@ -24,14 +25,14 @@ export type BaseAreaSeriesProps<XScale extends AxisScale, YScale extends AxisSca
|
|
|
24
25
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
25
26
|
curve?: AreaProps<Datum>['curve'];
|
|
26
27
|
/** Props to be passed to the Line, if rendered. */
|
|
27
|
-
lineProps?: Omit<LinePathProps<Datum> & SVGProps<SVGPathElement>, | 'data'
|
|
28
|
+
lineProps?: Omit<LinePathProps<Datum> & Octane.SVGProps<SVGPathElement>, | 'data'
|
|
28
29
|
| 'x'
|
|
29
30
|
| 'y'
|
|
30
31
|
| 'children'
|
|
31
32
|
| 'defined'>;
|
|
32
33
|
/** Rendered component which is passed path props by BaseAreaSeries after processing. */
|
|
33
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
34
|
-
} & Omit<SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
34
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
35
|
+
} & Omit<Octane.SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
35
36
|
|
|
36
37
|
function BaseAreaSeries<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>({
|
|
37
38
|
PathComponent = 'path',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { FC
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
5
|
import type { AreaProps, LinePathProps } from '@octanejs/visx/shape';
|
|
5
6
|
import type { SeriesProps } from '../../../types';
|
|
@@ -13,8 +14,8 @@ export type BaseAreaSeriesProps<XScale extends AxisScale, YScale extends AxisSca
|
|
|
13
14
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
14
15
|
curve?: AreaProps<Datum>['curve'];
|
|
15
16
|
/** Props to be passed to the Line, if rendered. */
|
|
16
|
-
lineProps?: Omit<LinePathProps<Datum> & SVGProps<SVGPathElement>, 'data' | 'x' | 'y' | 'children' | 'defined'>;
|
|
17
|
+
lineProps?: Omit<LinePathProps<Datum> & Octane.SVGProps<SVGPathElement>, 'data' | 'x' | 'y' | 'children' | 'defined'>;
|
|
17
18
|
/** Rendered component which is passed path props by BaseAreaSeries after processing. */
|
|
18
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
19
|
-
} & Omit<SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
19
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
20
|
+
} & Omit<Octane.SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
20
21
|
export default function BaseAreaSeriesWithRegisteredData<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>(props: BaseAreaSeriesProps<XScale, YScale, Datum>): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Fragment, createElement, useCallback, useContext, useMemo } from 'octane';
|
|
2
|
-
import type { ReactElement, FC
|
|
2
|
+
import type { ReactElement, FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
5
|
import type { SeriesPoint } from 'd3-shape';
|
|
5
6
|
import type { StackPathConfig, AreaProps } from '@octanejs/visx/shape';
|
|
@@ -38,7 +39,7 @@ export type BaseAreaStackProps<XScale extends AxisScale, YScale extends AxisScal
|
|
|
38
39
|
children: | ReactElement<AreaStackChildProps<XScale, YScale, Datum>>
|
|
39
40
|
| ReactElement<AreaStackChildProps<XScale, YScale, Datum>>[];
|
|
40
41
|
/** Rendered component which is passed path props by BaseAreaStack after processing. */
|
|
41
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
42
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
42
43
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
43
44
|
curve?: AreaProps<Datum>['curve'];
|
|
44
45
|
/** Whether to render a Line along value of the Area shape (area is fill only). */
|
|
@@ -131,7 +132,7 @@ function BaseAreaStack<XScale extends AxisScale, YScale extends AxisScale, Datum
|
|
|
131
132
|
...svgPathProps
|
|
132
133
|
} = areaSeries?.props || {};
|
|
133
134
|
|
|
134
|
-
const areaProps: SVGProps<SVGPathElement> = {
|
|
135
|
+
const areaProps: Octane.SVGProps<SVGPathElement> = {
|
|
135
136
|
fill: colorScale?.(stack.key) ?? theme?.colors?.[0] ?? '#222',
|
|
136
137
|
...svgPathProps,
|
|
137
138
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { ReactElement, FC
|
|
2
|
+
import type { ReactElement, FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
5
|
import type { StackPathConfig, AreaProps } from '@octanejs/visx/shape';
|
|
5
6
|
import type { SeriesProps } from '../../../types';
|
|
@@ -9,7 +10,7 @@ export type BaseAreaStackProps<XScale extends AxisScale, YScale extends AxisScal
|
|
|
9
10
|
/** `AreaSeries` elements, note we can't strictly enforce this with TS yet. */
|
|
10
11
|
children: ReactElement<AreaStackChildProps<XScale, YScale, Datum>> | ReactElement<AreaStackChildProps<XScale, YScale, Datum>>[];
|
|
11
12
|
/** Rendered component which is passed path props by BaseAreaStack after processing. */
|
|
12
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
13
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
13
14
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
14
15
|
curve?: AreaProps<Datum>['curve'];
|
|
15
16
|
/** Whether to render a Line along value of the Area shape (area is fill only). */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Fragment, useContext, useCallback, useMemo, useEffect } from 'octane';
|
|
2
|
-
import type { FC
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { LinePathProps } from '@octanejs/visx/shape';
|
|
4
5
|
import { LinePath } from '@octanejs/visx/shape';
|
|
5
6
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
@@ -15,12 +16,12 @@ import useSeriesEvents from '../../../hooks/useSeriesEvents.tsrx';
|
|
|
15
16
|
export type BaseLineSeriesProps<XScale extends AxisScale, YScale extends AxisScale, Datum extends object> =
|
|
16
17
|
SeriesProps<XScale, YScale, Datum> & {
|
|
17
18
|
/** Rendered component which is passed path props by BaseLineSeries after processing. */
|
|
18
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
19
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
19
20
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
20
21
|
curve?: LinePathProps<Datum>['curve'];
|
|
21
22
|
/** Given a datakey, returns its color. Falls back to theme color if unspecified or if a null-ish value is returned. */
|
|
22
23
|
colorAccessor?: (dataKey: string) => string | undefined | null;
|
|
23
|
-
} & Omit<SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
24
|
+
} & Omit<Octane.SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
24
25
|
|
|
25
26
|
function BaseLineSeries<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>({
|
|
26
27
|
colorAccessor,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { FC
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
3
4
|
import type { LinePathProps } from '@octanejs/visx/shape';
|
|
4
5
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
5
6
|
import type { SeriesProps } from '../../../types';
|
|
6
7
|
export type BaseLineSeriesProps<XScale extends AxisScale, YScale extends AxisScale, Datum extends object> = SeriesProps<XScale, YScale, Datum> & {
|
|
7
8
|
/** Rendered component which is passed path props by BaseLineSeries after processing. */
|
|
8
|
-
PathComponent?: FC<Omit<SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
9
|
+
PathComponent?: FC<Omit<Octane.SVGProps<SVGPathElement>, 'ref'>> | 'path';
|
|
9
10
|
/** Sets the curve factory (from @octanejs/visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
|
|
10
11
|
curve?: LinePathProps<Datum>['curve'];
|
|
11
12
|
/** Given a datakey, returns its color. Falls back to theme color if unspecified or if a null-ish value is returned. */
|
|
12
13
|
colorAccessor?: (dataKey: string) => string | undefined | null;
|
|
13
|
-
} & Omit<SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
14
|
+
} & Omit<Octane.SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;
|
|
14
15
|
export default function BaseBaseLineSeriesWithRegisteredData<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>(props: BaseLineSeriesProps<XScale, YScale, Datum>): import("react").JSX.Element | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { PointerEvent, FocusEvent
|
|
1
|
+
import type { PointerEvent, FocusEvent } from 'react';
|
|
2
|
+
import type { Octane } from 'octane/jsx-runtime';
|
|
2
3
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
3
4
|
import type { ScaleInput } from '@octanejs/visx/scale';
|
|
4
5
|
import type { Series, SeriesPoint } from 'd3-shape';
|
|
@@ -151,7 +152,7 @@ export type BarsProps<XScale extends AxisScale, YScale extends AxisScale> = {
|
|
|
151
152
|
/** Whether to apply radius to left corners. */
|
|
152
153
|
radiusLeft?: boolean;
|
|
153
154
|
} & Omit<
|
|
154
|
-
SVGProps<SVGRectElement | SVGPathElement>,
|
|
155
|
+
Octane.SVGProps<SVGRectElement | SVGPathElement>,
|
|
155
156
|
'x' | 'y' | 'width' | 'height' | 'ref' | 'children'
|
|
156
157
|
>;
|
|
157
158
|
|