@octanejs/visx 0.1.3 → 0.1.5
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 +5 -5
- package/src/a11y/components/ChartA11yAnnouncer.tsrx +4 -3
- package/src/a11y/components/ChartA11yAnnouncer.tsrx.d.ts +4 -3
- package/src/annotation/components/Annotation.tsrx +2 -2
- package/src/annotation/components/Annotation.tsrx.d.ts +2 -2
- package/src/annotation/components/EditableAnnotation.tsrx +3 -2
- package/src/annotation/components/EditableAnnotation.tsrx.d.ts +3 -2
- package/src/annotation/components/HtmlLabel.tsrx +3 -2
- package/src/annotation/components/HtmlLabel.tsrx.d.ts +3 -2
- package/src/axis/types.ts +5 -4
- package/src/brush/BaseBrush.tsrx +3 -2
- package/src/brush/BaseBrush.tsrx.d.ts +3 -2
- package/src/brush/Brush.tsrx +3 -2
- package/src/brush/Brush.tsrx.d.ts +3 -2
- package/src/brush/BrushHandle.tsrx +2 -2
- package/src/brush/BrushHandle.tsrx.d.ts +2 -2
- package/src/brush/utils.ts +0 -1
- package/src/chord/Chord.tsrx +2 -2
- package/src/chord/Chord.tsrx.d.ts +2 -2
- package/src/clip-path/clip-paths/ClipPath.tsrx +3 -2
- package/src/clip-path/clip-paths/ClipPath.tsrx.d.ts +3 -2
- package/src/delaunay/components/Polygon.tsrx +3 -2
- package/src/delaunay/components/Polygon.tsrx.d.ts +3 -2
- package/src/drag/Drag.tsrx +2 -2
- package/src/drag/Drag.tsrx.d.ts +2 -2
- package/src/drag/useDrag.tsrx +2 -7
- package/src/drag/useDrag.tsrx.d.ts +0 -1
- package/src/geo/graticule/Graticule.tsrx +3 -2
- package/src/geo/graticule/Graticule.tsrx.d.ts +3 -2
- package/src/geo/projections/Projection.tsrx +5 -4
- package/src/geo/projections/Projection.tsrx.d.ts +5 -4
- package/src/glyph/glyphs/Glyph.tsrx +2 -2
- package/src/glyph/glyphs/Glyph.tsrx.d.ts +2 -2
- package/src/glyph/glyphs/GlyphCircle.tsrx +3 -2
- package/src/glyph/glyphs/GlyphCircle.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphCross.tsrx +3 -2
- package/src/glyph/glyphs/GlyphCross.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphDiamond.tsrx +3 -2
- package/src/glyph/glyphs/GlyphDiamond.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphSquare.tsrx +3 -2
- package/src/glyph/glyphs/GlyphSquare.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphStar.tsrx +3 -2
- package/src/glyph/glyphs/GlyphStar.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphTriangle.tsrx +3 -2
- package/src/glyph/glyphs/GlyphTriangle.tsrx.d.ts +3 -2
- package/src/glyph/glyphs/GlyphWye.tsrx +3 -2
- package/src/glyph/glyphs/GlyphWye.tsrx.d.ts +3 -2
- package/src/gradient/gradients/LinearGradient.tsrx +3 -2
- package/src/gradient/gradients/LinearGradient.tsrx.d.ts +3 -2
- package/src/grid/grids/GridAngle.tsrx +2 -2
- package/src/grid/grids/GridAngle.tsrx.d.ts +2 -2
- package/src/grid/grids/GridColumns.tsrx +2 -2
- package/src/grid/grids/GridColumns.tsrx.d.ts +2 -2
- package/src/grid/grids/GridPolar.tsrx +4 -3
- package/src/grid/grids/GridPolar.tsrx.d.ts +4 -3
- package/src/grid/grids/GridRadial.tsrx +4 -3
- package/src/grid/grids/GridRadial.tsrx.d.ts +4 -3
- package/src/grid/grids/GridRows.tsrx +2 -2
- package/src/grid/grids/GridRows.tsrx.d.ts +2 -2
- package/src/grid/types.ts +3 -2
- package/src/group/Group.tsrx +5 -3
- package/src/group/Group.tsrx.d.ts +5 -3
- package/src/heatmap/heatmaps/HeatmapCircle.tsrx +3 -2
- package/src/heatmap/heatmaps/HeatmapCircle.tsrx.d.ts +3 -2
- package/src/heatmap/heatmaps/HeatmapRect.tsrx +3 -2
- package/src/heatmap/heatmaps/HeatmapRect.tsrx.d.ts +3 -2
- package/src/hierarchy/hierarchies/Cluster.tsrx +3 -2
- package/src/hierarchy/hierarchies/Cluster.tsrx.d.ts +3 -2
- package/src/hierarchy/hierarchies/Pack.tsrx +3 -2
- package/src/hierarchy/hierarchies/Pack.tsrx.d.ts +3 -2
- package/src/hierarchy/hierarchies/Partition.tsrx +3 -2
- package/src/hierarchy/hierarchies/Partition.tsrx.d.ts +3 -2
- package/src/hierarchy/hierarchies/Tree.tsrx +3 -2
- package/src/hierarchy/hierarchies/Tree.tsrx.d.ts +3 -2
- package/src/hierarchy/hierarchies/Treemap.tsrx +3 -2
- package/src/hierarchy/hierarchies/Treemap.tsrx.d.ts +3 -2
- package/src/legend/legends/Legend/LegendItem.tsrx +3 -2
- package/src/legend/legends/Legend/LegendItem.tsrx.d.ts +3 -2
- package/src/legend/legends/Legend/LegendLabel.tsrx +4 -3
- package/src/legend/legends/Legend/LegendLabel.tsrx.d.ts +4 -3
- package/src/legend/legends/Legend/index.tsrx +3 -2
- package/src/legend/legends/Legend/index.tsrx.d.ts +3 -2
- package/src/marker/markers/Marker.tsrx +3 -2
- package/src/marker/markers/Marker.tsrx.d.ts +3 -2
- package/src/pattern/patterns/Pattern.tsrx +2 -2
- package/src/pattern/patterns/Pattern.tsrx.d.ts +2 -2
- package/src/responsive/components/ParentSize.tsrx +10 -4
- package/src/responsive/components/ParentSize.tsrx.d.ts +9 -4
- package/src/responsive/components/ScaleSVG.tsrx +3 -2
- package/src/responsive/components/ScaleSVG.tsrx.d.ts +3 -2
- package/src/sankey/Sankey.tsrx +3 -2
- package/src/sankey/Sankey.tsrx.d.ts +3 -2
- package/src/shape/shapes/Arc.tsrx +3 -2
- package/src/shape/shapes/Arc.tsrx.d.ts +3 -2
- package/src/shape/shapes/BarGroup.tsrx +2 -2
- package/src/shape/shapes/BarGroup.tsrx.d.ts +2 -2
- package/src/shape/shapes/BarGroupHorizontal.tsrx +2 -2
- package/src/shape/shapes/BarGroupHorizontal.tsrx.d.ts +2 -2
- package/src/shape/shapes/BarRounded.tsrx +3 -2
- package/src/shape/shapes/BarRounded.tsrx.d.ts +3 -2
- package/src/shape/shapes/LinePath.tsrx +3 -2
- package/src/shape/shapes/LinePath.tsrx.d.ts +3 -2
- package/src/shape/shapes/LineRadial.tsrx +2 -2
- package/src/shape/shapes/LineRadial.tsrx.d.ts +2 -2
- package/src/shape/shapes/Pie.tsrx +3 -3
- package/src/shape/shapes/Pie.tsrx.d.ts +3 -3
- package/src/shape/shapes/Polygon.tsrx +3 -2
- package/src/shape/shapes/Polygon.tsrx.d.ts +3 -2
- package/src/shape/shapes/SplitLinePath.tsrx +15 -4
- package/src/shape/shapes/SplitLinePath.tsrx.d.ts +14 -4
- package/src/shape/shapes/Stack.tsrx +2 -2
- package/src/shape/shapes/Stack.tsrx.d.ts +2 -2
- package/src/shape/types/area.ts +3 -2
- package/src/shape/types/barStack.ts +2 -2
- package/src/shape/types/base.ts +8 -5
- package/src/shape/types/link.ts +3 -2
- package/src/stats/BoxPlot.tsrx +3 -2
- package/src/stats/BoxPlot.tsrx.d.ts +3 -2
- package/src/stats/ViolinPlot.tsrx +3 -2
- package/src/stats/ViolinPlot.tsrx.d.ts +3 -2
- package/src/theme/provider/ThemeScope.tsrx +3 -2
- package/src/theme/provider/ThemeScope.tsrx.d.ts +3 -2
- package/src/tooltip/Portal.tsrx +2 -2
- package/src/tooltip/Portal.tsrx.d.ts +2 -2
- package/src/tooltip/floating/ChartTooltip.tsrx +3 -2
- package/src/tooltip/floating/ChartTooltip.tsrx.d.ts +3 -2
- package/src/tooltip/floating/ChartTooltipContent.tsrx +13 -12
- package/src/tooltip/floating/ChartTooltipContent.tsrx.d.ts +13 -12
- package/src/tooltip/floating/FloatingTooltip.tsrx.d.ts +1 -1
- package/src/tooltip/floating/context.tsrx +2 -1
- package/src/tooltip/floating/context.tsrx.d.ts +2 -1
- package/src/tooltip/floating/types.ts +4 -3
- package/src/tooltip/tooltips/Tooltip.tsrx +3 -2
- package/src/tooltip/tooltips/Tooltip.tsrx.d.ts +3 -2
- package/src/voronoi/components/VoronoiPolygon.tsrx +3 -2
- package/src/voronoi/components/VoronoiPolygon.tsrx.d.ts +3 -2
- package/src/wordcloud/Wordcloud.tsrx +2 -2
- package/src/wordcloud/Wordcloud.tsrx.d.ts +2 -2
- package/src/xychart/components/Tooltip.tsrx +4 -3
- package/src/xychart/components/Tooltip.tsrx.d.ts +4 -3
- package/src/xychart/components/XYChart.tsrx +3 -2
- package/src/xychart/components/XYChart.tsrx.d.ts +3 -2
- package/src/xychart/components/series/GlyphSeries.tsrx +3 -2
- package/src/xychart/components/series/private/AnimatedGlyphs.tsrx +3 -2
- package/src/xychart/components/series/private/BaseBarGroup.tsrx +3 -2
- package/src/xychart/components/series/private/BaseBarGroup.tsrx.d.ts +3 -2
- package/src/xychart/components/series/private/BaseGlyphSeries.tsrx +2 -2
- package/src/xychart/components/series/private/BaseGlyphSeries.tsrx.d.ts +2 -2
- package/src/xychart/hooks/useStackedData.tsrx +2 -2
- package/src/xychart/hooks/useStackedData.tsrx.d.ts +2 -2
- package/src/xychart/providers/DataProvider.tsrx +2 -2
- package/src/xychart/providers/DataProvider.tsrx.d.ts +2 -2
- package/src/xychart/providers/EventEmitterProvider.tsrx +2 -2
- package/src/xychart/providers/EventEmitterProvider.tsrx.d.ts +2 -2
- package/src/xychart/providers/ThemeProvider.tsrx +2 -2
- package/src/xychart/providers/ThemeProvider.tsrx.d.ts +2 -2
- package/src/xychart/providers/TooltipProvider.tsrx +2 -2
- package/src/xychart/providers/TooltipProvider.tsrx.d.ts +2 -2
- package/src/xychart/utils/collectDataRegistryEntries.ts +2 -2
- package/src/xychart/utils/getChildrenAndGrandchildrenWithProps.ts +6 -5
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
|
|
4
5
|
export type TooltipProps = {
|
|
5
6
|
/** Tooltip content. */
|
|
6
|
-
children?:
|
|
7
|
+
children?: OctaneNode;
|
|
7
8
|
/** Optional className to apply to the Tooltip in addition to `visx-tooltip`. */
|
|
8
9
|
className?: string;
|
|
9
10
|
/** The `left` position of the Tooltip. */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSProperties, HTMLAttributes, Ref } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
export type TooltipProps = {
|
|
4
5
|
/** Tooltip content. */
|
|
5
|
-
children?:
|
|
6
|
+
children?: OctaneNode;
|
|
6
7
|
/** Optional className to apply to the Tooltip in addition to `visx-tooltip`. */
|
|
7
8
|
className?: string;
|
|
8
9
|
/** The `left` position of the Tooltip. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
|
|
4
5
|
export type VoronoiPolygonProps = {
|
|
@@ -9,7 +10,7 @@ export type VoronoiPolygonProps = {
|
|
|
9
10
|
}: {
|
|
10
11
|
path: string;
|
|
11
12
|
polygon: [number, number][];
|
|
12
|
-
}) =>
|
|
13
|
+
}) => OctaneNode;
|
|
13
14
|
/** className to apply to path element. */
|
|
14
15
|
className?: string;
|
|
15
16
|
/** Array of coordinate arrays for the polygon (e.g., [[x,y], [x1,y1], ...]), used to generate polygon path. */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { SVGProps } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
export type VoronoiPolygonProps = {
|
|
4
5
|
/** Override render function which is provided polygon and generated path. */
|
|
5
6
|
children?: ({ path, polygon, }: {
|
|
6
7
|
path: string;
|
|
7
8
|
polygon: [number, number][];
|
|
8
|
-
}) =>
|
|
9
|
+
}) => OctaneNode;
|
|
9
10
|
/** className to apply to path element. */
|
|
10
11
|
className?: string;
|
|
11
12
|
/** Array of coordinate arrays for the polygon (e.g., [[x,y], [x1,y1], ...]), used to generate polygon path. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OctaneNode } from 'octane';
|
|
2
2
|
import { Group } from '@octanejs/visx/group';
|
|
3
3
|
import type { BaseDatum, CloudWord, WordcloudConfig } from './types';
|
|
4
4
|
import useWordcloud from './useWordcloud.tsrx';
|
|
5
5
|
|
|
6
6
|
export interface WordcloudProps<Datum extends BaseDatum> extends WordcloudConfig<Datum> {
|
|
7
|
-
children: (words: CloudWord[]) =>
|
|
7
|
+
children: (words: CloudWord[]) => OctaneNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export default function Wordcloud<Datum extends BaseDatum>(props: WordcloudProps<Datum>) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { BaseDatum, CloudWord, WordcloudConfig } from './types';
|
|
4
4
|
export interface WordcloudProps<Datum extends BaseDatum> extends WordcloudConfig<Datum> {
|
|
5
|
-
children: (words: CloudWord[]) =>
|
|
5
|
+
children: (words: CloudWord[]) => OctaneNode;
|
|
6
6
|
}
|
|
7
7
|
export default function Wordcloud<Datum extends BaseDatum>(props: WordcloudProps<Datum>): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useRef } from 'octane';
|
|
2
|
-
import type { CSSProperties, SVGProps
|
|
2
|
+
import type { CSSProperties, SVGProps } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import { useTooltipInPortal, defaultStyles } from '@octanejs/visx/tooltip';
|
|
4
5
|
import type {
|
|
5
6
|
TooltipProps as BaseTooltipProps,
|
|
@@ -41,9 +42,9 @@ export type TooltipProps<Datum extends object> = {
|
|
|
41
42
|
* return value is non-null, its content is rendered inside the tooltip container.
|
|
42
43
|
* Content will be rendered in an HTML parent.
|
|
43
44
|
*/
|
|
44
|
-
renderTooltip: (params: RenderTooltipParams<Datum>) =>
|
|
45
|
+
renderTooltip: (params: RenderTooltipParams<Datum>) => OctaneNode;
|
|
45
46
|
/** Function which handles rendering glyphs. */
|
|
46
|
-
renderGlyph?: (params: RenderTooltipGlyphProps<Datum>) =>
|
|
47
|
+
renderGlyph?: (params: RenderTooltipGlyphProps<Datum>) => OctaneNode;
|
|
47
48
|
/** Whether to snap tooltip + crosshair x-coord to the nearest Datum x-coord instead of the event x-coord. */
|
|
48
49
|
snapTooltipToDatumX?: boolean;
|
|
49
50
|
/** Whether to snap tooltip + crosshair y-coord to the nearest Datum y-coord instead of the event y-coord. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { SVGProps
|
|
2
|
+
import type { SVGProps } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { TooltipProps as BaseTooltipProps, UseTooltipPortalOptions } from '@octanejs/visx/tooltip';
|
|
4
5
|
import type { PickD3Scale } from '@octanejs/visx/scale';
|
|
5
6
|
import type { GlyphProps as RenderGlyphProps, TooltipContextType } from '../types';
|
|
@@ -21,9 +22,9 @@ export type TooltipProps<Datum extends object> = {
|
|
|
21
22
|
* return value is non-null, its content is rendered inside the tooltip container.
|
|
22
23
|
* Content will be rendered in an HTML parent.
|
|
23
24
|
*/
|
|
24
|
-
renderTooltip: (params: RenderTooltipParams<Datum>) =>
|
|
25
|
+
renderTooltip: (params: RenderTooltipParams<Datum>) => OctaneNode;
|
|
25
26
|
/** Function which handles rendering glyphs. */
|
|
26
|
-
renderGlyph?: (params: RenderTooltipGlyphProps<Datum>) =>
|
|
27
|
+
renderGlyph?: (params: RenderTooltipGlyphProps<Datum>) => OctaneNode;
|
|
27
28
|
/** Whether to snap tooltip + crosshair x-coord to the nearest Datum x-coord instead of the event x-coord. */
|
|
28
29
|
snapTooltipToDatumX?: boolean;
|
|
29
30
|
/** Whether to snap tooltip + crosshair y-coord to the nearest Datum y-coord instead of the event y-coord. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint jsx-a11y/mouse-events-have-key-events: 'off', @typescript-eslint/no-explicit-any: 'off' */
|
|
2
2
|
import { useContext, useEffect } from 'octane';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PointerEvent } from 'react';
|
|
4
|
+
import type { OctaneNode } from 'octane';
|
|
4
5
|
import { ParentSize } from '@octanejs/visx/responsive';
|
|
5
6
|
import type { ResizeObserverPolyfill } from '@octanejs/visx/responsive';
|
|
6
7
|
import type { AxisScaleOutput } from '@octanejs/visx/axis';
|
|
@@ -35,7 +36,7 @@ export type XYChartProps<XScaleConfig extends ScaleConfig<AxisScaleOutput, any,
|
|
|
35
36
|
/** Margin to apply around the outside. */
|
|
36
37
|
margin?: Margin;
|
|
37
38
|
/** XYChart children (Series, Tooltip, etc.). */
|
|
38
|
-
children:
|
|
39
|
+
children: OctaneNode;
|
|
39
40
|
/** If DataContext is not available, XYChart will wrap itself in a DataProvider and set this as the theme. */
|
|
40
41
|
theme?: DataProviderProps<XScaleConfig, YScaleConfig>['theme'];
|
|
41
42
|
/** If DataContext is not available, XYChart will wrap itself in a DataProvider and set this as the xScale config. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { PointerEvent } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { ResizeObserverPolyfill } from '@octanejs/visx/responsive';
|
|
4
5
|
import type { AxisScaleOutput } from '@octanejs/visx/axis';
|
|
5
6
|
import type { ScaleConfig } from '@octanejs/visx/scale';
|
|
@@ -17,7 +18,7 @@ export type XYChartProps<XScaleConfig extends ScaleConfig<AxisScaleOutput, any,
|
|
|
17
18
|
/** Margin to apply around the outside. */
|
|
18
19
|
margin?: Margin;
|
|
19
20
|
/** XYChart children (Series, Tooltip, etc.). */
|
|
20
|
-
children:
|
|
21
|
+
children: OctaneNode;
|
|
21
22
|
/** If DataContext is not available, XYChart will wrap itself in a DataProvider and set this as the theme. */
|
|
22
23
|
theme?: DataProviderProps<XScaleConfig, YScaleConfig>['theme'];
|
|
23
24
|
/** If DataContext is not available, XYChart will wrap itself in a DataProvider and set this as the xScale config. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
2
2
|
import { Fragment, useCallback } from 'octane';
|
|
3
|
-
import type { FC
|
|
3
|
+
import type { FC } from 'react';
|
|
4
|
+
import type { OctaneNode } from 'octane';
|
|
4
5
|
import type { GlyphProps, GlyphsProps } from '../../types';
|
|
5
6
|
import type { BaseGlyphSeriesProps } from './private/BaseGlyphSeries.tsrx';
|
|
6
7
|
import BaseGlyphSeries from './private/BaseGlyphSeries.tsrx';
|
|
@@ -29,7 +30,7 @@ export default function GlyphSeries<XScale extends AxisScale, YScale extends Axi
|
|
|
29
30
|
onPointerUp,
|
|
30
31
|
onFocus,
|
|
31
32
|
onBlur,
|
|
32
|
-
}) as
|
|
33
|
+
}) as OctaneNode}
|
|
33
34
|
</Fragment>,
|
|
34
35
|
),
|
|
35
36
|
[renderGlyph],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
2
2
|
import { useMemo } from 'octane';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FC } from 'react';
|
|
4
|
+
import type { OctaneNode } from 'octane';
|
|
4
5
|
import {
|
|
5
6
|
useTransition as useSpringTransition,
|
|
6
7
|
animated,
|
|
@@ -101,7 +102,7 @@ export default function AnimatedGlyphs<XScale extends AxisScale, YScale extends
|
|
|
101
102
|
onPointerMove,
|
|
102
103
|
onPointerOut,
|
|
103
104
|
onPointerUp,
|
|
104
|
-
}) as
|
|
105
|
+
}) as OctaneNode}
|
|
105
106
|
</animated.g>,
|
|
106
107
|
)}
|
|
107
108
|
</>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useContext, useMemo, useEffect, useCallback } from 'octane';
|
|
2
|
-
import type { ReactElement,
|
|
2
|
+
import type { ReactElement, FC } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { PositionScale } from '@octanejs/visx/shape';
|
|
4
5
|
import { scaleBand } from '@octanejs/visx/scale';
|
|
5
6
|
import type { BaseBarSeriesProps } from './BaseBarSeries.tsrx';
|
|
@@ -23,7 +24,7 @@ import getChildrenAndGrandchildrenWithProps from '../../../utils/getChildrenAndG
|
|
|
23
24
|
export type BaseBarGroupProps<XScale extends PositionScale, YScale extends PositionScale, Datum extends object> =
|
|
24
25
|
{
|
|
25
26
|
/** `BarSeries` elements */
|
|
26
|
-
children:
|
|
27
|
+
children: OctaneNode;
|
|
27
28
|
/** Group band scale padding, [0, 1] where 0 = no padding, 1 = no bar. */
|
|
28
29
|
padding?: number;
|
|
29
30
|
/** Comparator function to sort `dataKeys` within a bar group. By default the DOM rendering order of `BarGroup`s `children` is used. */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { PositionScale } from '@octanejs/visx/shape';
|
|
4
5
|
import type { BarsProps, SeriesProps } from '../../../types';
|
|
5
6
|
export type BaseBarGroupProps<XScale extends PositionScale, YScale extends PositionScale, Datum extends object> = {
|
|
6
7
|
/** `BarSeries` elements */
|
|
7
|
-
children:
|
|
8
|
+
children: OctaneNode;
|
|
8
9
|
/** Group band scale padding, [0, 1] where 0 = no padding, 1 = no bar. */
|
|
9
10
|
padding?: number;
|
|
10
11
|
/** Comparator function to sort `dataKeys` within a bar group. By default the DOM rendering order of `BarGroup`s `children` is used. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useEffect, useMemo } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
4
|
import DataContext from '../../../context/DataContext.tsrx';
|
|
5
5
|
import type { DataContextType, GlyphProps, GlyphsProps, SeriesProps } from '../../../types';
|
|
@@ -15,7 +15,7 @@ export type BaseGlyphSeriesProps<XScale extends AxisScale, YScale extends AxisSc
|
|
|
15
15
|
/** The size of a `Glyph`, a `number` or a function which takes a `Datum` and returns a `number`. */
|
|
16
16
|
size?: number | ((d: Datum) => number);
|
|
17
17
|
/** Function which handles rendering glyphs. */
|
|
18
|
-
renderGlyphs: (glyphsProps: GlyphsProps<XScale, YScale, Datum>) =>
|
|
18
|
+
renderGlyphs: (glyphsProps: GlyphsProps<XScale, YScale, Datum>) => OctaneNode;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export function BaseGlyphSeries<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
4
|
import type { DataContextType, GlyphsProps, SeriesProps } from '../../../types';
|
|
5
5
|
export type BaseGlyphSeriesProps<XScale extends AxisScale, YScale extends AxisScale, Datum extends object> = SeriesProps<XScale, YScale, Datum> & {
|
|
@@ -8,7 +8,7 @@ export type BaseGlyphSeriesProps<XScale extends AxisScale, YScale extends AxisSc
|
|
|
8
8
|
/** The size of a `Glyph`, a `number` or a function which takes a `Datum` and returns a `number`. */
|
|
9
9
|
size?: number | ((d: Datum) => number);
|
|
10
10
|
/** Function which handles rendering glyphs. */
|
|
11
|
-
renderGlyphs: (glyphsProps: GlyphsProps<XScale, YScale, Datum>) =>
|
|
11
|
+
renderGlyphs: (glyphsProps: GlyphsProps<XScale, YScale, Datum>) => OctaneNode;
|
|
12
12
|
};
|
|
13
13
|
export declare function BaseGlyphSeries<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>({ colorAccessor, data, dataKey, onBlur, onFocus, onPointerMove, onPointerOut, onPointerUp, onPointerDown, enableEvents, renderGlyphs, size, xAccessor, xScale, yAccessor, yScale, }: BaseGlyphSeriesProps<XScale, YScale, Datum> & Pick<DataContextType<XScale, YScale, Datum>, 'xScale' | 'yScale'>): import("react").JSX.Element;
|
|
14
14
|
export default function BaseGlyphSeriesWithRegisteredData<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>(props: BaseGlyphSeriesProps<XScale, YScale, Datum>): import("react").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OctaneNode } from 'octane';
|
|
2
2
|
import { useContext, useEffect, useMemo } from 'octane';
|
|
3
3
|
import type { SeriesPoint } from 'd3-shape';
|
|
4
4
|
import { stack as d3stack } from 'd3-shape';
|
|
@@ -13,7 +13,7 @@ import combineBarStackData from '../utils/combineBarStackData';
|
|
|
13
13
|
import getChildrenAndGrandchildrenWithProps from '../utils/getChildrenAndGrandchildrenWithProps';
|
|
14
14
|
|
|
15
15
|
type UseStackedData<Datum extends object> = {
|
|
16
|
-
children:
|
|
16
|
+
children: OctaneNode;
|
|
17
17
|
} & Pick<StackPathConfig<Datum, string>, 'offset' | 'order'>;
|
|
18
18
|
|
|
19
19
|
export default function useStackedData<XScale extends AxisScale, YScale extends AxisScale, Datum extends object, ChildrenProps extends SeriesProps<XScale, YScale, Datum>>({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { StackPathConfig } from '@octanejs/visx/shape';
|
|
4
4
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
5
5
|
import type { CombinedStackData, SeriesProps } from '../types';
|
|
6
6
|
type UseStackedData<Datum extends object> = {
|
|
7
|
-
children:
|
|
7
|
+
children: OctaneNode;
|
|
8
8
|
} & Pick<StackPathConfig<Datum, string>, 'offset' | 'order'>;
|
|
9
9
|
export default function useStackedData<XScale extends AxisScale, YScale extends AxisScale, Datum extends object, ChildrenProps extends SeriesProps<XScale, YScale, Datum>>({ children, order, offset, }: UseStackedData<Datum>): {
|
|
10
10
|
seriesChildren: import("react").ReactElement<ChildrenProps, string | import("react").JSXElementConstructor<any>>[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ScaleConfig, ScaleConfigToD3Scale } from '@octanejs/visx/scale';
|
|
3
3
|
import { scaleLinear, scaleOrdinal as createOrdinalScale } from '@octanejs/visx/scale';
|
|
4
4
|
import { useContext, useMemo } from 'octane';
|
|
5
|
-
import type {
|
|
5
|
+
import type { OctaneNode } from 'octane';
|
|
6
6
|
import type { AxisScaleOutput } from '@octanejs/visx/axis';
|
|
7
7
|
import type { ResizeObserverPolyfill } from '@octanejs/visx/responsive';
|
|
8
8
|
|
|
@@ -33,7 +33,7 @@ export type DataProviderProps<XScaleConfig extends ScaleConfig<AxisScaleOutput,
|
|
|
33
33
|
/* y-scale configuration whose shape depends on scale type. */
|
|
34
34
|
yScale: YScaleConfig;
|
|
35
35
|
/* Any React children. */
|
|
36
|
-
children:
|
|
36
|
+
children: OctaneNode;
|
|
37
37
|
/* Determines whether Series will be plotted horizontally (e.g., horizontal bars). By default this will try to be inferred based on scale types. */
|
|
38
38
|
horizontal?: boolean | 'auto';
|
|
39
39
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
2
|
import type { ScaleConfig } from '@octanejs/visx/scale';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
4
4
|
import type { AxisScaleOutput } from '@octanejs/visx/axis';
|
|
5
5
|
import type { ResizeObserverPolyfill } from '@octanejs/visx/responsive';
|
|
6
6
|
import type { XYChartTheme } from '../types';
|
|
@@ -11,7 +11,7 @@ export type DataProviderProps<XScaleConfig extends ScaleConfig<AxisScaleOutput,
|
|
|
11
11
|
theme?: XYChartTheme;
|
|
12
12
|
xScale: XScaleConfig;
|
|
13
13
|
yScale: YScaleConfig;
|
|
14
|
-
children:
|
|
14
|
+
children: OctaneNode;
|
|
15
15
|
horizontal?: boolean | 'auto';
|
|
16
16
|
/**
|
|
17
17
|
* Optionally set the resizeObserverPolyfill context, which will be available to
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMemo } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import mitt from 'mitt';
|
|
4
4
|
import EventEmitterContext from '../context/EventEmitterContext.tsrx';
|
|
5
5
|
|
|
6
6
|
/** Provider for EventEmitterContext. */
|
|
7
|
-
export default function EventEmitterProvider({ children }: { children:
|
|
7
|
+
export default function EventEmitterProvider({ children }: { children: OctaneNode }) {
|
|
8
8
|
const emitter = useMemo(() => mitt(), []);
|
|
9
9
|
return <EventEmitterContext.Provider value={emitter}>{children}</EventEmitterContext.Provider>;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
/** Provider for EventEmitterContext. */
|
|
4
4
|
export default function EventEmitterProvider({ children }: {
|
|
5
|
-
children:
|
|
5
|
+
children: OctaneNode;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OctaneNode } from 'octane';
|
|
2
2
|
import ThemeContext from '../context/ThemeContext.tsrx';
|
|
3
3
|
import type { XYChartTheme } from '../types';
|
|
4
4
|
import lightTheme from '../theme/themes/light';
|
|
5
5
|
|
|
6
6
|
export type ThemeProviderProps = {
|
|
7
7
|
theme?: XYChartTheme;
|
|
8
|
-
children:
|
|
8
|
+
children: OctaneNode;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default function ThemeProvider({ theme = lightTheme, children }: ThemeProviderProps) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { XYChartTheme } from '../types';
|
|
4
4
|
export type ThemeProviderProps = {
|
|
5
5
|
theme?: XYChartTheme;
|
|
6
|
-
children:
|
|
6
|
+
children: OctaneNode;
|
|
7
7
|
};
|
|
8
8
|
export default function ThemeProvider({ theme, children }: ThemeProviderProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import { debounce } from '@octanejs/visx/responsive';
|
|
4
4
|
import type { DebouncedFunction } from '@octanejs/visx/responsive';
|
|
5
5
|
import { useTooltip } from '@octanejs/visx/tooltip';
|
|
@@ -10,7 +10,7 @@ import isValidNumber from '../typeguards/isValidNumber';
|
|
|
10
10
|
type TooltipProviderProps = {
|
|
11
11
|
/** Debounce time for when `hideTooltip` is invoked. */
|
|
12
12
|
hideTooltipDebounceMs?: number;
|
|
13
|
-
children:
|
|
13
|
+
children: OctaneNode;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/** Simple wrapper around useTooltip, to provide tooltip data via context. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
type TooltipProviderProps = {
|
|
4
4
|
/** Debounce time for when `hideTooltip` is invoked. */
|
|
5
5
|
hideTooltipDebounceMs?: number;
|
|
6
|
-
children:
|
|
6
|
+
children: OctaneNode;
|
|
7
7
|
};
|
|
8
8
|
/** Simple wrapper around useTooltip, to provide tooltip data via context. */
|
|
9
9
|
export default function TooltipProvider<Datum extends object>({ hideTooltipDebounceMs, children, }: TooltipProviderProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Children } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { AxisScale } from '@octanejs/visx/axis';
|
|
4
4
|
import type { DataRegistryEntry } from '../types';
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ export default function collectDataRegistryEntries<
|
|
|
18
18
|
XScale extends AxisScale,
|
|
19
19
|
YScale extends AxisScale,
|
|
20
20
|
Datum extends object,
|
|
21
|
-
>(children:
|
|
21
|
+
>(children: OctaneNode): DataRegistryEntry<XScale, YScale, Datum>[] {
|
|
22
22
|
const entries = new Map<string, DataRegistryEntry<XScale, YScale, Datum>>();
|
|
23
23
|
|
|
24
24
|
function visit(value: unknown): void {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import { Children } from 'octane';
|
|
3
4
|
|
|
4
|
-
/** Returns whether the
|
|
5
|
-
function isChildWithProps<P extends object>(child:
|
|
5
|
+
/** Returns whether the OctaneNode has props (and therefore is an `Element` versus primitive type) */
|
|
6
|
+
function isChildWithProps<P extends object>(child: OctaneNode): child is ReactElement<P> {
|
|
6
7
|
return !!child && typeof child === 'object' && 'props' in child && child.props != null;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* Returns children and grandchildren of type
|
|
11
|
+
* Returns children and grandchildren of type OctaneNode.
|
|
11
12
|
* Flattens children one level to support Fragments and Array type children.
|
|
12
13
|
*/
|
|
13
14
|
export default function getChildrenAndGrandchildrenWithProps<P extends object>(
|
|
14
|
-
children:
|
|
15
|
+
children: OctaneNode,
|
|
15
16
|
): ReactElement<P>[] {
|
|
16
17
|
return Children.toArray(children)
|
|
17
18
|
.flatMap((child) => {
|