@octanejs/visx 0.1.4 → 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/visx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -123,15 +123,15 @@
|
|
|
123
123
|
"mitt": "^2.1.0",
|
|
124
124
|
"reduce-css-calc": "^1.3.0",
|
|
125
125
|
"svg-path-properties": "2.0.2",
|
|
126
|
-
"@octanejs/floating-ui": "0.1.
|
|
126
|
+
"@octanejs/floating-ui": "0.1.10"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"octane": "0.1.
|
|
129
|
+
"octane": "0.1.11"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@juggle/resize-observer": "^3.4.0",
|
|
133
133
|
"@react-spring/web": "^10.0.0",
|
|
134
|
-
"@tsrx/react": "^0.2.
|
|
134
|
+
"@tsrx/react": "^0.2.44",
|
|
135
135
|
"@visx/chord": "4.0.0",
|
|
136
136
|
"@visx/annotation": "4.0.0",
|
|
137
137
|
"@visx/brush": "4.0.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"react-dom": "^19.2.0",
|
|
150
150
|
"typescript": "^5.9.3",
|
|
151
151
|
"vitest": "^4.1.9",
|
|
152
|
-
"octane": "0.1.
|
|
152
|
+
"octane": "0.1.11"
|
|
153
153
|
},
|
|
154
154
|
"scripts": {
|
|
155
155
|
"compile:check": "node scripts/check-tsrx-compile.mjs",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CSSProperties
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
|
|
3
4
|
import { VISUALLY_HIDDEN_STYLE } from '../utils/table';
|
|
4
5
|
|
|
@@ -6,8 +7,8 @@ export type ChartA11yLivePoliteness = 'polite' | 'assertive';
|
|
|
6
7
|
|
|
7
8
|
export type ChartA11yAnnouncerProps = {
|
|
8
9
|
id?: string;
|
|
9
|
-
message?:
|
|
10
|
-
children?:
|
|
10
|
+
message?: OctaneNode;
|
|
11
|
+
children?: OctaneNode;
|
|
11
12
|
politeness?: ChartA11yLivePoliteness;
|
|
12
13
|
atomic?: boolean;
|
|
13
14
|
visible?: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { CSSProperties
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
export type ChartA11yLivePoliteness = 'polite' | 'assertive';
|
|
4
5
|
export type ChartA11yAnnouncerProps = {
|
|
5
6
|
id?: string;
|
|
6
|
-
message?:
|
|
7
|
-
children?:
|
|
7
|
+
message?: OctaneNode;
|
|
8
|
+
children?: OctaneNode;
|
|
8
9
|
politeness?: ChartA11yLivePoliteness;
|
|
9
10
|
atomic?: boolean;
|
|
10
11
|
visible?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import AnnotationContext from '../context/AnnotationContext.tsrx';
|
|
4
4
|
import type { AnnotationContextType } from '../types';
|
|
5
5
|
|
|
6
6
|
export type AnnotationProps = Pick<AnnotationContextType, 'x' | 'y' | 'dx' | 'dy'> & {
|
|
7
7
|
/** Annotation children (Subject, Label, Connector) */
|
|
8
|
-
children:
|
|
8
|
+
children: OctaneNode;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default function Annotation({ x, y, dx, dy, children }: AnnotationProps) {
|
|
@@ -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 { AnnotationContextType } from '../types';
|
|
4
4
|
export type AnnotationProps = Pick<AnnotationContextType, 'x' | 'y' | 'dx' | 'dy'> & {
|
|
5
5
|
/** Annotation children (Subject, Label, Connector) */
|
|
6
|
-
children:
|
|
6
|
+
children: OctaneNode;
|
|
7
7
|
};
|
|
8
8
|
export default function Annotation({ x, y, dx, dy, children }: AnnotationProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-handler-names */
|
|
2
2
|
import { useCallback, useRef } from 'octane';
|
|
3
|
-
import type { SVGProps,
|
|
3
|
+
import type { SVGProps, MouseEvent, TouchEvent } from 'react';
|
|
4
|
+
import type { OctaneNode } from 'octane';
|
|
4
5
|
import type { UseDrag, HandlerArgs as DragHandlerArgs } from '@octanejs/visx/drag';
|
|
5
6
|
import { useDrag } from '@octanejs/visx/drag';
|
|
6
7
|
import type { AnnotationContextType } from '../types';
|
|
@@ -12,7 +13,7 @@ export type EditableAnnotationProps = Pick<AnnotationContextType, 'x' | 'y' | 'd
|
|
|
12
13
|
/** Height of the possible drag canvas (e.g., SVG container). */
|
|
13
14
|
height: number;
|
|
14
15
|
/** Annotation children (Subject, Label, Connector) */
|
|
15
|
-
children:
|
|
16
|
+
children: OctaneNode;
|
|
16
17
|
/** Whether the Label position (dx, dy) is editable. */
|
|
17
18
|
canEditLabel?: boolean;
|
|
18
19
|
/** Whether the Subject position (x, y) is editable. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { SVGProps,
|
|
2
|
+
import type { SVGProps, MouseEvent, TouchEvent } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { AnnotationContextType } from '../types';
|
|
4
5
|
export type EditableAnnotationProps = Pick<AnnotationContextType, 'x' | 'y' | 'dx' | 'dy'> & {
|
|
5
6
|
/** Width of the possible drag canvas (e.g., SVG container). */
|
|
@@ -7,7 +8,7 @@ export type EditableAnnotationProps = Pick<AnnotationContextType, 'x' | 'y' | 'd
|
|
|
7
8
|
/** Height of the possible drag canvas (e.g., SVG container). */
|
|
8
9
|
height: number;
|
|
9
10
|
/** Annotation children (Subject, Label, Connector) */
|
|
10
|
-
children:
|
|
11
|
+
children: OctaneNode;
|
|
11
12
|
/** Whether the Label position (dx, dy) is editable. */
|
|
12
13
|
canEditLabel?: boolean;
|
|
13
14
|
/** Whether the Subject position (x, y) is editable. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'octane';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import { Group } from '@octanejs/visx/group';
|
|
5
6
|
import AnnotationContext from '../context/AnnotationContext.tsrx';
|
|
@@ -18,7 +19,7 @@ export type HtmlLabelProps =
|
|
|
18
19
|
| 'x'
|
|
19
20
|
| 'y'> & {
|
|
20
21
|
/** Pass in a custom element as the label to style as you like. Renders inside a <foreignObject>, be aware that most non-browser SVG renderers will not render HTML <foreignObject>s. See: https://github.com/airbnb/visx/issues/1173#issuecomment-1014380545. */
|
|
21
|
-
children?:
|
|
22
|
+
children?: OctaneNode;
|
|
22
23
|
/** Optional styles to apply to the HTML container. */
|
|
23
24
|
containerStyle?: CSSProperties;
|
|
24
25
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { LabelProps } from './Label.tsrx';
|
|
4
5
|
export type HtmlLabelProps = Pick<LabelProps, 'anchorLineStroke' | 'className' | 'horizontalAnchor' | 'resizeObserverPolyfill' | 'showAnchorLine' | 'verticalAnchor' | 'x' | 'y'> & {
|
|
5
6
|
/** Pass in a custom element as the label to style as you like. Renders inside a <foreignObject>, be aware that most non-browser SVG renderers will not render HTML <foreignObject>s. See: https://github.com/airbnb/visx/issues/1173#issuecomment-1014380545. */
|
|
6
|
-
children?:
|
|
7
|
+
children?: OctaneNode;
|
|
7
8
|
/** Optional styles to apply to the HTML container. */
|
|
8
9
|
containerStyle?: CSSProperties;
|
|
9
10
|
};
|
package/src/axis/types.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { D3Scale, NumberLike, ScaleInput, ValueOf } from '@octanejs/visx/scale';
|
|
2
2
|
import type { TextProps } from '@octanejs/visx/text';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Ref, SVGProps } from 'react';
|
|
4
|
+
import type { OctaneNode } from 'octane';
|
|
4
5
|
import type Orientation from './constants/orientation';
|
|
5
6
|
|
|
6
7
|
// In order to plot values on an axis, output of the scale must be number.
|
|
@@ -82,9 +83,9 @@ export type CommonProps<Scale extends AxisScale> = {
|
|
|
82
83
|
/** The class name applied to each tick group. */
|
|
83
84
|
tickClassName?: string;
|
|
84
85
|
/** Override the component used to render tick labels (instead of <Text /> from @octanejs/visx/text). */
|
|
85
|
-
tickComponent?: (tickRendererProps: TickRendererProps) =>
|
|
86
|
+
tickComponent?: (tickRendererProps: TickRendererProps) => OctaneNode;
|
|
86
87
|
/** Override the component used to render all tick lines and labels. */
|
|
87
|
-
ticksComponent?: (tickRendererProps: TicksRendererProps<Scale>) =>
|
|
88
|
+
ticksComponent?: (tickRendererProps: TicksRendererProps<Scale>) => OctaneNode;
|
|
88
89
|
/** A [d3 formatter](https://github.com/d3/d3-scale/blob/master/README.md#continuous_tickFormat) for the tick text. */
|
|
89
90
|
tickFormat?: TickFormatter<ScaleInput<Scale>>;
|
|
90
91
|
/** Either an object with the props for all tick labels or a function that returns props for a given tick label. */
|
|
@@ -141,5 +142,5 @@ export type SharedAxisProps<Scale extends AxisScale> = CommonProps<Scale> & {
|
|
|
141
142
|
/** A top pixel offset applied to the entire axis. */
|
|
142
143
|
top?: number;
|
|
143
144
|
/** For more control over rendering or to add event handlers to datum, pass a function as children. */
|
|
144
|
-
children?: (renderProps: AxisRendererProps<Scale>) =>
|
|
145
|
+
children?: (renderProps: AxisRendererProps<Scale>) => OctaneNode;
|
|
145
146
|
};
|
package/src/brush/BaseBrush.tsrx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'octane';
|
|
2
|
-
import type { PointerEvent, SVGProps
|
|
2
|
+
import type { PointerEvent, SVGProps } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import { Group } from '@octanejs/visx/group';
|
|
4
5
|
import type { HandlerArgs as DragArgs } from '@octanejs/visx/drag';
|
|
5
6
|
import { Drag } from '@octanejs/visx/drag';
|
|
@@ -48,7 +49,7 @@ export type BaseBrushProps = {
|
|
|
48
49
|
disableDraggingOverlay?: boolean;
|
|
49
50
|
resetOnEnd?: boolean;
|
|
50
51
|
useWindowMoveEvents?: boolean;
|
|
51
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
52
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
export type BaseBrushState = BrushShape & {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type { PointerEvent, SVGProps
|
|
2
|
+
import type { PointerEvent, SVGProps } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { BrushHandleRenderProps } from './BrushHandle.tsrx';
|
|
4
5
|
import type { MarginShape, BrushShape, ResizeTriggerAreas, PartialBrushStartEnd, BrushingType, BrushPageOffset } from './types';
|
|
5
6
|
type PointerHandlerEvent = PointerEvent<SVGRectElement>;
|
|
@@ -26,7 +27,7 @@ export type BaseBrushProps = {
|
|
|
26
27
|
disableDraggingOverlay?: boolean;
|
|
27
28
|
resetOnEnd?: boolean;
|
|
28
29
|
useWindowMoveEvents?: boolean;
|
|
29
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
30
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
30
31
|
};
|
|
31
32
|
export type BaseBrushState = BrushShape & {
|
|
32
33
|
activeHandle: ResizeTriggerAreas | null;
|
package/src/brush/Brush.tsrx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import BaseBrush from './BaseBrush.tsrx';
|
|
3
4
|
import type { BaseBrushProps, BaseBrushState } from './BaseBrush.tsrx';
|
|
4
5
|
import type { BrushHandleRenderProps } from './BrushHandle.tsrx';
|
|
@@ -72,7 +73,7 @@ export type BrushProps = {
|
|
|
72
73
|
/** Prevent drag end on mouse leaving from brush stage. */
|
|
73
74
|
useWindowMoveEvents?: boolean;
|
|
74
75
|
/** Render function for custom brush handles. */
|
|
75
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
76
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
export default function Brush({
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
import type { BaseBrushProps } from './BaseBrush.tsrx';
|
|
4
5
|
import type { BrushHandleRenderProps } from './BrushHandle.tsrx';
|
|
5
6
|
import type { Bounds, PartialBrushStartEnd, MarginShape, ResizeTriggerAreas, Scale } from './types';
|
|
@@ -51,6 +52,6 @@ export type BrushProps = {
|
|
|
51
52
|
/** Prevent drag end on mouse leaving from brush stage. */
|
|
52
53
|
useWindowMoveEvents?: boolean;
|
|
53
54
|
/** Render function for custom brush handles. */
|
|
54
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
55
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
55
56
|
};
|
|
56
57
|
export default function Brush({ xScale, yScale, height, width, onChange, onBrushStart, onBrushEnd, onMouseMove, onMouseLeave, onClick, margin, brushDirection, initialBrushPosition, resizeTriggerAreas, brushRegion, yAxisOrientation, xAxisOrientation, disableDraggingSelection, disableDraggingOverlay, resetOnEnd, handleSize, selectedBoxStyle, useWindowMoveEvents, renderBrushHandle, }: BrushProps): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint react/jsx-handler-names: 0 */
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { HandlerArgs as DragArgs } from '@octanejs/visx/drag';
|
|
4
4
|
import { Drag } from '@octanejs/visx/drag';
|
|
5
5
|
import type { BaseBrushState as BrushState, UpdateBrush } from './BaseBrush.tsrx';
|
|
@@ -25,7 +25,7 @@ export type BrushHandleProps = {
|
|
|
25
25
|
isControlled?: boolean;
|
|
26
26
|
isDragInProgress?: boolean;
|
|
27
27
|
onBrushHandleChange?: (type?: BrushingType, options?: BrushPageOffset) => void;
|
|
28
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
28
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export type BrushHandleRenderProps = HandleProps & {
|
|
@@ -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 { HandlerArgs as DragArgs } from '@octanejs/visx/drag';
|
|
4
4
|
import type { BaseBrushState as BrushState, UpdateBrush } from './BaseBrush.tsrx';
|
|
5
5
|
import type { BrushPageOffset, BrushingType, ResizeTriggerAreas } from './types';
|
|
@@ -21,7 +21,7 @@ export type BrushHandleProps = {
|
|
|
21
21
|
isControlled?: boolean;
|
|
22
22
|
isDragInProgress?: boolean;
|
|
23
23
|
onBrushHandleChange?: (type?: BrushingType, options?: BrushPageOffset) => void;
|
|
24
|
-
renderBrushHandle?: (props: BrushHandleRenderProps) =>
|
|
24
|
+
renderBrushHandle?: (props: BrushHandleRenderProps) => OctaneNode;
|
|
25
25
|
};
|
|
26
26
|
export type BrushHandleRenderProps = HandleProps & {
|
|
27
27
|
/** if brush extent is not active this prop is set to false */
|
package/src/brush/utils.ts
CHANGED
package/src/chord/Chord.tsrx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OctaneNode } from 'octane';
|
|
2
2
|
import type { Chords } from 'd3-chord';
|
|
3
3
|
import { chord as d3chord } from 'd3-chord';
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export type ChordProps = {
|
|
|
16
16
|
/** Comparator used to sort the chords by their combined flow; this only affects the `z-order` of the chords. */
|
|
17
17
|
sortChords?: DefaultSortComporator | null;
|
|
18
18
|
/** Child render function, passed the configured chords. */
|
|
19
|
-
children: (chords: { chords: Chords }) =>
|
|
19
|
+
children: (chords: { chords: Chords }) => OctaneNode;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export default function Chord({
|
|
@@ -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 { Chords } from 'd3-chord';
|
|
4
4
|
type DefaultSortComporator = (a: number, b: number) => number;
|
|
5
5
|
export type ChordProps = {
|
|
@@ -16,7 +16,7 @@ export type ChordProps = {
|
|
|
16
16
|
/** Child render function, passed the configured chords. */
|
|
17
17
|
children: (chords: {
|
|
18
18
|
chords: Chords;
|
|
19
|
-
}) =>
|
|
19
|
+
}) => OctaneNode;
|
|
20
20
|
};
|
|
21
21
|
export default function Chord({ matrix, padAngle, sortGroups, sortSubgroups, sortChords, children, }: ChordProps): import("react").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { SVGProps
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import useStableId from '../../kernel/ids/useStableId.tsrx';
|
|
3
4
|
|
|
4
5
|
export type ClipPathProps = {
|
|
5
6
|
/** Unique id for the clipPath. */
|
|
6
7
|
id?: string;
|
|
7
8
|
/** clipPath children. */
|
|
8
|
-
children?:
|
|
9
|
+
children?: OctaneNode;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
/** Handles rendering of <defs> and <clipPath> elements for you, with any children you want. */
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
export type ClipPathProps = {
|
|
4
5
|
/** Unique id for the clipPath. */
|
|
5
6
|
id?: string;
|
|
6
7
|
/** clipPath children. */
|
|
7
|
-
children?:
|
|
8
|
+
children?: OctaneNode;
|
|
8
9
|
};
|
|
9
10
|
/** Handles rendering of <defs> and <clipPath> elements for you, with any children you want. */
|
|
10
11
|
export default function ClipPath({ id, children, ...restProps }: ClipPathProps & Omit<SVGProps<SVGClipPathElement>, keyof ClipPathProps>): import("react").JSX.Element;
|
|
@@ -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 PolygonProps = {
|
|
@@ -9,7 +10,7 @@ export type PolygonProps = {
|
|
|
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 PolygonProps = {
|
|
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. */
|
package/src/drag/Drag.tsrx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-handler-names */
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { UseDrag, UseDragOptions, HandlerArgs as HandlerArgsType } from './useDrag.tsrx';
|
|
4
4
|
import useDrag from './useDrag.tsrx';
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ export type HandlerArgs = HandlerArgsType;
|
|
|
7
7
|
|
|
8
8
|
export type DragProps = UseDragOptions & {
|
|
9
9
|
/** Children render function which is passed the state of dragging and callbacks for drag start/end/move. */
|
|
10
|
-
children: (args: UseDrag) =>
|
|
10
|
+
children: (args: UseDrag) => OctaneNode;
|
|
11
11
|
/** Width of the drag container. */
|
|
12
12
|
width: number;
|
|
13
13
|
/** Height of the drag container. */
|
package/src/drag/Drag.tsrx.d.ts
CHANGED
|
@@ -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 { UseDrag, UseDragOptions, HandlerArgs as HandlerArgsType } from './useDrag.tsrx';
|
|
4
4
|
export type HandlerArgs = HandlerArgsType;
|
|
5
5
|
export type DragProps = UseDragOptions & {
|
|
6
6
|
/** Children render function which is passed the state of dragging and callbacks for drag start/end/move. */
|
|
7
|
-
children: (args: UseDrag) =>
|
|
7
|
+
children: (args: UseDrag) => OctaneNode;
|
|
8
8
|
/** Width of the drag container. */
|
|
9
9
|
width: number;
|
|
10
10
|
/** Height of the drag container. */
|
package/src/drag/useDrag.tsrx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MouseEvent, TouchEvent, PointerEvent } from 'react';
|
|
2
1
|
import { useCallback, useEffect, useRef, useState } from 'octane';
|
|
3
2
|
import { Point, subtractPoints, sumPoints } from '@octanejs/visx/point';
|
|
4
3
|
import { localPoint } from '@octanejs/visx/event';
|
|
@@ -6,6 +5,8 @@ import useStateWithCallback from './util/useStateWithCallback.tsrx';
|
|
|
6
5
|
import restrictPoint from './util/restrictPoint';
|
|
7
6
|
import useSamplesAlongPath from './util/useSamplesAlongPath.tsrx';
|
|
8
7
|
|
|
8
|
+
// Native DOM events — octane delivers native, delegated events (no synthetic
|
|
9
|
+
// layer), so the drag handlers accept the platform types directly.
|
|
9
10
|
export type MouseTouchOrPointerEvent = MouseEvent | TouchEvent | PointerEvent;
|
|
10
11
|
|
|
11
12
|
export type HandlerArgs = DragState & {
|
|
@@ -129,8 +130,6 @@ export default function useDrag(
|
|
|
129
130
|
const restrictToPathSamples = useSamplesAlongPath(restrictToPath);
|
|
130
131
|
|
|
131
132
|
const handleDragStart = useCallback((event: MouseTouchOrPointerEvent) => {
|
|
132
|
-
event.persist?.();
|
|
133
|
-
|
|
134
133
|
setDragStateWithCallback((currState) => {
|
|
135
134
|
// eslint-disable-next-line no-shadow
|
|
136
135
|
const { x = 0, y = 0, dx, dy } = currState;
|
|
@@ -165,8 +164,6 @@ export default function useDrag(
|
|
|
165
164
|
]);
|
|
166
165
|
|
|
167
166
|
const handleDragMove = useCallback((event: MouseTouchOrPointerEvent) => {
|
|
168
|
-
event.persist?.();
|
|
169
|
-
|
|
170
167
|
setDragStateWithCallback((currState) => {
|
|
171
168
|
if (!currState.isDragging) return currState;
|
|
172
169
|
// eslint-disable-next-line no-shadow
|
|
@@ -194,8 +191,6 @@ export default function useDrag(
|
|
|
194
191
|
]);
|
|
195
192
|
|
|
196
193
|
const handleDragEnd = useCallback((event: MouseTouchOrPointerEvent) => {
|
|
197
|
-
event.persist?.();
|
|
198
|
-
|
|
199
194
|
setDragStateWithCallback(
|
|
200
195
|
(currState) => ({ ...currState, isDragging: false }),
|
|
201
196
|
onDragEnd &&
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import { Group } from '@octanejs/visx/group';
|
|
3
4
|
import type { GeoGraticuleGenerator } from 'd3-geo';
|
|
4
5
|
import { geoGraticule } from 'd3-geo';
|
|
@@ -38,7 +39,7 @@ export type GraticuleProps = {
|
|
|
38
39
|
graticule,
|
|
39
40
|
}: {
|
|
40
41
|
graticule: GeoGraticuleGenerator;
|
|
41
|
-
}) =>
|
|
42
|
+
}) => OctaneNode;
|
|
42
43
|
/** Sets the major and minor extents of the graticule generator, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩. */
|
|
43
44
|
extent?: [[number, number], [number, number]];
|
|
44
45
|
/** Sets the major extent of the graticule generator, which defaults to ⟨⟨-180°, -90° + ε⟩, ⟨180°, 90° - ε⟩⟩. */
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
import type { GeoGraticuleGenerator } from 'd3-geo';
|
|
4
5
|
import type { LineString, MultiLineString, Polygon } from 'geojson';
|
|
5
6
|
export type GraticuleProps = {
|
|
@@ -33,7 +34,7 @@ export type GraticuleProps = {
|
|
|
33
34
|
/** Override render function, which is passed the configured graticule generator. */
|
|
34
35
|
children?: ({ graticule, }: {
|
|
35
36
|
graticule: GeoGraticuleGenerator;
|
|
36
|
-
}) =>
|
|
37
|
+
}) => OctaneNode;
|
|
37
38
|
/** Sets the major and minor extents of the graticule generator, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩. */
|
|
38
39
|
extent?: [[number, number], [number, number]];
|
|
39
40
|
/** Sets the major extent of the graticule generator, which defaults to ⟨⟨-180°, -90° + ε⟩, ⟨180°, 90° - ε⟩⟩. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SVGProps, Ref } from 'react';
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import { Group } from '@octanejs/visx/group';
|
|
4
5
|
import type { GeoPath, GeoProjection, ExtendedFeature } from 'd3-geo';
|
|
@@ -38,7 +39,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
38
39
|
/** Preset projection name, or custom projection function which returns a GeoProjection. */
|
|
39
40
|
projection?: ProjectionShape;
|
|
40
41
|
/** Hook to render above features, passed the configured projectionFunc. */
|
|
41
|
-
projectionFunc?: (projection: GeoProjection) =>
|
|
42
|
+
projectionFunc?: (projection: GeoProjection) => OctaneNode;
|
|
42
43
|
/** Sets the projection’s clipping circle radius to the specified angle in degree. */
|
|
43
44
|
clipAngle?: number;
|
|
44
45
|
/**
|
|
@@ -73,7 +74,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
73
74
|
/** Convenience prop for props.fitExtent where the top-left corner of the extent is [0, 0]. */
|
|
74
75
|
fitSize?: [[number, number], ExtendedFeature]; // ExtendedFeature | ExtendedFeatureCollection | GeoGeometryObjects
|
|
75
76
|
/** Hook to render anything at the centroid of a feature. */
|
|
76
|
-
centroid?: (centroid: [number, number], feature: ParsedFeature<Datum>) =>
|
|
77
|
+
centroid?: (centroid: [number, number], feature: ParsedFeature<Datum>) => OctaneNode;
|
|
77
78
|
/** className to apply to feature path elements. */
|
|
78
79
|
className?: string;
|
|
79
80
|
/** Override render function which is passed path data and a copy of the constructed projection. */
|
|
@@ -81,7 +82,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
81
82
|
path: GeoPath<unknown, GeoPermissibleObjects>;
|
|
82
83
|
features: ParsedFeature<Datum>[];
|
|
83
84
|
projection: GeoProjection;
|
|
84
|
-
}) =>
|
|
85
|
+
}) => OctaneNode;
|
|
85
86
|
/** Function invoked for each feature which returns a Ref to the projection path element for that feature. */
|
|
86
87
|
innerRef?: (feature: ParsedFeature<Datum>, index: number) => Ref<SVGPathElement>;
|
|
87
88
|
/** If specified, renders a Graticule with the specified props. Specify `graticule.foreground = true` to be rendered on top of features. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { SVGProps, Ref } from 'react';
|
|
3
|
+
import type { OctaneNode } from 'octane';
|
|
3
4
|
import type { GeoPath, GeoProjection, ExtendedFeature } from 'd3-geo';
|
|
4
5
|
import type { GraticuleProps } from '../graticule/Graticule.tsrx';
|
|
5
6
|
import type { GeoPermissibleObjects, Projection as ProjectionShape } from '../types';
|
|
@@ -9,7 +10,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
9
10
|
/** Preset projection name, or custom projection function which returns a GeoProjection. */
|
|
10
11
|
projection?: ProjectionShape;
|
|
11
12
|
/** Hook to render above features, passed the configured projectionFunc. */
|
|
12
|
-
projectionFunc?: (projection: GeoProjection) =>
|
|
13
|
+
projectionFunc?: (projection: GeoProjection) => OctaneNode;
|
|
13
14
|
/** Sets the projection’s clipping circle radius to the specified angle in degree. */
|
|
14
15
|
clipAngle?: number;
|
|
15
16
|
/**
|
|
@@ -44,7 +45,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
44
45
|
/** Convenience prop for props.fitExtent where the top-left corner of the extent is [0, 0]. */
|
|
45
46
|
fitSize?: [[number, number], ExtendedFeature];
|
|
46
47
|
/** Hook to render anything at the centroid of a feature. */
|
|
47
|
-
centroid?: (centroid: [number, number], feature: ParsedFeature<Datum>) =>
|
|
48
|
+
centroid?: (centroid: [number, number], feature: ParsedFeature<Datum>) => OctaneNode;
|
|
48
49
|
/** className to apply to feature path elements. */
|
|
49
50
|
className?: string;
|
|
50
51
|
/** Override render function which is passed path data and a copy of the constructed projection. */
|
|
@@ -52,7 +53,7 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects = GeoPermissible
|
|
|
52
53
|
path: GeoPath<unknown, GeoPermissibleObjects>;
|
|
53
54
|
features: ParsedFeature<Datum>[];
|
|
54
55
|
projection: GeoProjection;
|
|
55
|
-
}) =>
|
|
56
|
+
}) => OctaneNode;
|
|
56
57
|
/** Function invoked for each feature which returns a Ref to the projection path element for that feature. */
|
|
57
58
|
innerRef?: (feature: ParsedFeature<Datum>, index: number) => Ref<SVGPathElement>;
|
|
58
59
|
/** If specified, renders a Graticule with the specified props. Specify `graticule.foreground = true` to be rendered on top of features. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OctaneNode } from 'octane';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { Group } from '@octanejs/visx/group';
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ export type GlyphProps = {
|
|
|
10
10
|
/** classname to apply to glyph g element container. */
|
|
11
11
|
className?: string;
|
|
12
12
|
/** Children to render. */
|
|
13
|
-
children?:
|
|
13
|
+
children?: OctaneNode;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default function Glyph({ top = 0, left = 0, className, children }: GlyphProps) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/generate-tsrx-types.mjs.
|
|
2
|
-
import type {
|
|
2
|
+
import type { OctaneNode } from 'octane';
|
|
3
3
|
export type GlyphProps = {
|
|
4
4
|
/** Top offset to apply to glyph g element container. */
|
|
5
5
|
top?: number;
|
|
@@ -8,6 +8,6 @@ export type GlyphProps = {
|
|
|
8
8
|
/** classname to apply to glyph g element container. */
|
|
9
9
|
className?: string;
|
|
10
10
|
/** Children to render. */
|
|
11
|
-
children?:
|
|
11
|
+
children?: OctaneNode;
|
|
12
12
|
};
|
|
13
13
|
export default function Glyph({ top, left, className, children }: GlyphProps): import("react").JSX.Element;
|
|
@@ -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
|
import type { Symbol } from 'd3-shape';
|
|
4
5
|
import { symbol, symbolCircle } from 'd3-shape';
|
|
@@ -10,7 +11,7 @@ export type GlyphCircleProps<Datum> = {
|
|
|
10
11
|
path,
|
|
11
12
|
}: {
|
|
12
13
|
path: Symbol<unknown, Datum>;
|
|
13
|
-
}) =>
|
|
14
|
+
}) => OctaneNode;
|
|
14
15
|
/** classname to apply to glyph path element. */
|
|
15
16
|
className?: string;
|
|
16
17
|
/** Top offset to apply to glyph g element container. */
|