semiotic 3.8.0 → 3.8.1
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/CLAUDE.md +12 -9
- package/README.md +39 -39
- package/ai/dist/mcp-server.js +98 -17
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +3 -2
- package/ai/system-prompt.md +3 -2
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
- package/dist/components/AccessibleNavTree.d.ts +7 -1
- package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
- package/dist/components/ai/useNavigationSync.d.ts +17 -2
- package/dist/components/chartContainerMobile.d.ts +9 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
- package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
- package/dist/components/charts/geo/FlowMap.d.ts +10 -6
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
- package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
- package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
- package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
- package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
- package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
- package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
- package/dist/components/charts/shared/annotationRules.d.ts +2 -1
- package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
- package/dist/components/charts/shared/datumTypes.d.ts +2 -0
- package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
- package/dist/components/charts/shared/formatUtils.d.ts +3 -3
- package/dist/components/charts/shared/hatchFill.d.ts +87 -0
- package/dist/components/charts/shared/hooks.d.ts +7 -6
- package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
- package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
- package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
- package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
- package/dist/components/charts/shared/sparseArray.d.ts +1 -1
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
- package/dist/components/charts/shared/styleRules.d.ts +205 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
- package/dist/components/charts/shared/types.d.ts +9 -6
- package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
- package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
- package/dist/components/charts/shared/validateChartData.d.ts +7 -5
- package/dist/components/charts/shared/validationMap.d.ts +11 -2
- package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
- package/dist/components/charts/value/targetPresentation.d.ts +22 -0
- package/dist/components/charts/value/types.d.ts +5 -6
- package/dist/components/charts/xy/AreaChart.d.ts +8 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
- package/dist/components/charts/xy/Heatmap.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +11 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
- package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
- package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
- package/dist/components/controls/SentenceFilter.d.ts +97 -0
- package/dist/components/data/fromVegaLite.d.ts +19 -9
- package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
- package/dist/components/semiotic-ai.d.ts +3 -1
- package/dist/components/semiotic-controls.d.ts +2 -0
- package/dist/components/semiotic-geo.d.ts +4 -0
- package/dist/components/semiotic-network.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +6 -0
- package/dist/components/semiotic-physics.d.ts +4 -0
- package/dist/components/semiotic-rough.d.ts +4 -0
- package/dist/components/semiotic-utils-core.d.ts +4 -0
- package/dist/components/semiotic-xy.d.ts +4 -0
- package/dist/components/semiotic.d.ts +9 -1
- package/dist/components/server/optionalImageTypes.d.ts +37 -0
- package/dist/components/server/serverChartConfigShared.d.ts +9 -5
- package/dist/components/server/serverChartConfigs.d.ts +4 -4
- package/dist/components/server/staticAnnotations.d.ts +6 -3
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticNetwork.d.ts +4 -4
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/store/ObservationStore.d.ts +21 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
- package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
- package/dist/components/stream/CanvasHitTester.d.ts +4 -4
- package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
- package/dist/components/stream/FrameRuntime.d.ts +57 -0
- package/dist/components/stream/GeoParticlePool.d.ts +1 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
- package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
- package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
- package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
- package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
- package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
- package/dist/components/stream/ParticlePool.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +12 -16
- package/dist/components/stream/SVGOverlay.d.ts +6 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/accessorUtils.d.ts +2 -2
- package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
- package/dist/components/stream/frameGraphics.d.ts +4 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
- package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
- package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
- package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
- package/dist/components/stream/geoTypes.d.ts +48 -15
- package/dist/components/stream/hitTestUtils.d.ts +2 -2
- package/dist/components/stream/hoverUtils.d.ts +4 -2
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
- package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
- package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
- package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
- package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
- package/dist/components/stream/networkFrameObservations.d.ts +15 -0
- package/dist/components/stream/networkFramePaint.d.ts +11 -2
- package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
- package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
- package/dist/components/stream/networkTypes.d.ts +37 -56
- package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
- package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
- package/dist/components/stream/ordinalTypes.d.ts +30 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
- package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
- package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
- package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
- package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
- package/dist/components/stream/pipelineConfig.d.ts +4 -2
- package/dist/components/stream/pipelineDecay.d.ts +2 -2
- package/dist/components/stream/pipelinePulse.d.ts +2 -2
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
- package/dist/components/stream/pipelineTransitions.d.ts +1 -1
- package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
- package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
- package/dist/components/stream/renderBackend.d.ts +27 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
- package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
- package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
- package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
- package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
- package/dist/components/stream/streamThemeTypes.d.ts +14 -0
- package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
- package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
- package/dist/components/stream/titleLayout.d.ts +31 -0
- package/dist/components/stream/types.d.ts +30 -65
- package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
- package/dist/components/stream/useFrame.d.ts +23 -0
- package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
- package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
- package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
- package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -0
- package/dist/rough.module.min.js +1 -0
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +3 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-controls.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -0
- package/dist/semiotic-network.d.ts +4 -0
- package/dist/semiotic-ordinal.d.ts +6 -0
- package/dist/semiotic-physics.d.ts +4 -0
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-rough.d.ts +4 -0
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +4 -0
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -0
- package/dist/semiotic.d.ts +9 -1
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/test-utils/capturedFrameProps.d.ts +67 -0
- package/dist/test-utils/frameMock.d.ts +12 -9
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +26 -7
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { HoverData } from "../../realtime/types";
|
|
3
3
|
import type { Datum } from "./datumTypes";
|
|
4
|
+
export type TooltipValue = string | number | boolean | Date | Datum | Datum[] | null | undefined;
|
|
5
|
+
type TooltipAccessor = string | {
|
|
6
|
+
bivarianceHack(datum: Datum): TooltipValue;
|
|
7
|
+
}["bivarianceHack"];
|
|
8
|
+
type TooltipFormatter = {
|
|
9
|
+
bivarianceHack(value: TooltipValue, index?: number, allTicks?: number[]): React.ReactNode;
|
|
10
|
+
}["bivarianceHack"];
|
|
4
11
|
export interface TooltipFieldConfig {
|
|
5
12
|
label: string;
|
|
6
|
-
accessor:
|
|
13
|
+
accessor: TooltipAccessor;
|
|
7
14
|
role?: "title" | "x" | "y" | "color" | "size" | "group" | "value";
|
|
8
15
|
/** Per-field formatter. HOCs pass `xFormat`/`yFormat`/`valueFormat` here so
|
|
9
16
|
* the default tooltip renders values consistently with the axis. Typed
|
|
@@ -12,15 +19,15 @@ export interface TooltipFieldConfig {
|
|
|
12
19
|
* (`(d, index?, allTicks?) => ReactNode`). A ReactNode return renders
|
|
13
20
|
* as-is in the tooltip span. If the formatter throws, the tooltip
|
|
14
21
|
* falls back to the built-in `formatVal`. */
|
|
15
|
-
format?:
|
|
22
|
+
format?: TooltipFormatter;
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Extract a display name from an accessor.
|
|
19
26
|
* Strings return themselves; functions return "value".
|
|
20
27
|
*/
|
|
21
|
-
export declare function accessorName(acc:
|
|
28
|
+
export declare function accessorName(acc: TooltipAccessor): string;
|
|
22
29
|
export declare function formatVal(v: unknown): string;
|
|
23
|
-
export declare function resolveValue(d: Datum, acc:
|
|
30
|
+
export declare function resolveValue(d: Datum, acc: TooltipAccessor): TooltipValue;
|
|
24
31
|
export { smartTooltipEntries } from "./smartTooltip";
|
|
25
32
|
export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
|
|
26
33
|
/**
|
|
@@ -33,7 +40,13 @@ export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
|
|
|
33
40
|
* Returns an empty array when band is not configured, so the spread at
|
|
34
41
|
* the call site is a no-op for the common case.
|
|
35
42
|
*/
|
|
36
|
-
export declare function bandTooltipFields(band:
|
|
43
|
+
export declare function bandTooltipFields(band: {
|
|
44
|
+
y0Accessor?: TooltipAccessor;
|
|
45
|
+
y1Accessor?: TooltipAccessor;
|
|
46
|
+
} | Array<{
|
|
47
|
+
y0Accessor?: TooltipAccessor;
|
|
48
|
+
y1Accessor?: TooltipAccessor;
|
|
49
|
+
}> | null | undefined, valueFormat?: TooltipFormatter): TooltipFieldConfig[];
|
|
37
50
|
/**
|
|
38
51
|
* Build a default tooltipContent function for StreamXYFrame HOCs.
|
|
39
52
|
* Receives HoverData ({ data, time, value, x, y }) and renders
|
|
@@ -48,13 +61,13 @@ export declare function buildDefaultTooltip(fields: TooltipFieldConfig[]): (hove
|
|
|
48
61
|
* (PieChart/DonutChart wrap data in arrays). Default: `d.data || d`.
|
|
49
62
|
*/
|
|
50
63
|
export declare function buildOrdinalTooltip({ categoryAccessor, valueAccessor, groupAccessor, groupLabel, pieData, valueFormat, }: {
|
|
51
|
-
categoryAccessor:
|
|
52
|
-
valueAccessor:
|
|
53
|
-
groupAccessor?:
|
|
64
|
+
categoryAccessor: TooltipAccessor;
|
|
65
|
+
valueAccessor: TooltipAccessor;
|
|
66
|
+
groupAccessor?: TooltipAccessor;
|
|
54
67
|
groupLabel?: string;
|
|
55
68
|
pieData?: boolean;
|
|
56
69
|
/** Same formatter the HOC passes to the value axis. Threaded here so the
|
|
57
70
|
* default tooltip shows values consistently with the axis ("$450k", not
|
|
58
71
|
* "450000"). Override by passing a custom `tooltip` prop. */
|
|
59
|
-
valueFormat?:
|
|
72
|
+
valueFormat?: TooltipFormatter;
|
|
60
73
|
}): (d: Datum) => React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import type React from "react";
|
|
|
2
2
|
import type { PartialMargin } from "../../types/marginType";
|
|
3
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
4
4
|
import type { AnimateProp } from "../../stream/pipelineTransitionUtils";
|
|
5
|
-
import type { Datum } from "./datumTypes";
|
|
5
|
+
import type { Datum, DatumValue } from "./datumTypes";
|
|
6
6
|
import type { AutoPlaceAnnotations } from "../../recipes/annotationLayout";
|
|
7
7
|
import type { ResponsiveRule } from "./responsiveRules";
|
|
8
8
|
import type { MobileVisualizationContract } from "./auditMobileVisualization";
|
|
@@ -164,10 +164,7 @@ export interface BaseChartProps {
|
|
|
164
164
|
accessibleTable?: boolean;
|
|
165
165
|
/** Callback when a data element is clicked. Receives the original datum and pixel coordinates.
|
|
166
166
|
* For lines, receives the line data; for bars, the bar datum; for pie slices, the slice datum. */
|
|
167
|
-
onClick?:
|
|
168
|
-
x: number;
|
|
169
|
-
y: number;
|
|
170
|
-
}) => void;
|
|
167
|
+
onClick?: DatumClickHandler;
|
|
171
168
|
/** Dim non-hovered series when hovering a data mark. Requires `colorBy`. */
|
|
172
169
|
hoverHighlight?: HoverHighlightMode;
|
|
173
170
|
/** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
|
|
@@ -198,6 +195,12 @@ export interface BaseChartProps {
|
|
|
198
195
|
* - Network / geo / hierarchy charts: no-op (no continuous axis). */
|
|
199
196
|
axisExtent?: import("./axisExtent").AxisExtentMode;
|
|
200
197
|
}
|
|
198
|
+
export type DatumClickHandler = {
|
|
199
|
+
bivarianceHack(datum: Datum, event: {
|
|
200
|
+
x: number;
|
|
201
|
+
y: number;
|
|
202
|
+
}): void;
|
|
203
|
+
}["bivarianceHack"];
|
|
201
204
|
/**
|
|
202
205
|
* Axis configuration props
|
|
203
206
|
*/
|
|
@@ -220,7 +223,7 @@ export type CategoryFormatFn = (label: string, index?: number) => string | React
|
|
|
220
223
|
* Accessor type - can be a property name or a function
|
|
221
224
|
* @deprecated Use DataAccessor from generalTypes for generic type safety
|
|
222
225
|
*/
|
|
223
|
-
export type Accessor<T =
|
|
226
|
+
export type Accessor<T = DatumValue> = string | ((d: Datum, i?: number) => T);
|
|
224
227
|
/**
|
|
225
228
|
* Generic accessor type that provides autocomplete when TDatum is specified.
|
|
226
229
|
* Uses Datum in the function param so HOC charts can pass
|
|
@@ -3,6 +3,11 @@ import type { Datum } from "./datumTypes";
|
|
|
3
3
|
import type { Accessor, ChartAccessor } from "./types";
|
|
4
4
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
5
5
|
import type { HoverData } from "../../stream/types";
|
|
6
|
+
import type { BandConfig } from "../../stream/types";
|
|
7
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
8
|
+
import type { HatchFill } from "./hatchFill";
|
|
9
|
+
/** Values a resolved area/line style may carry (`fill` can be a HatchFill). */
|
|
10
|
+
type AreaStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
6
11
|
export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
7
12
|
/** Sparse-filtered data array (the HOC's `safeData`). */
|
|
8
13
|
safeData: TDatum[];
|
|
@@ -54,14 +59,22 @@ export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
|
54
59
|
groupField?: Accessor<string> | ChartAccessor<TDatum, string>;
|
|
55
60
|
/** Optional band prop — when set, the default tooltip surfaces a
|
|
56
61
|
* pair of rows per band (low + high). Threaded through verbatim. */
|
|
57
|
-
band?:
|
|
62
|
+
band?: BandConfig<TDatum> | Array<BandConfig<TDatum>>;
|
|
63
|
+
/**
|
|
64
|
+
* Declarative style rules, merged on top of the resolved area fill/stroke
|
|
65
|
+
* (last-applicable rule wins). Per-series: resolves against the series'
|
|
66
|
+
* sample datum. A rule `fill` may be a color or a HatchFill.
|
|
67
|
+
*/
|
|
68
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
69
|
+
/** Build the `StyleRuleContext` for a series sample datum. */
|
|
70
|
+
ruleContext?: (d: Datum) => StyleRuleContext;
|
|
58
71
|
}
|
|
59
72
|
export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
|
|
60
73
|
/** Flat data array ready for `<StreamXYFrame data={…} />`. Empty
|
|
61
74
|
* when the HOC is in push mode (no `data` prop). */
|
|
62
75
|
flattenedData: TDatum[];
|
|
63
76
|
/** Selection-aware line/area style fn. */
|
|
64
|
-
lineStyle: (d: Datum) => Record<string,
|
|
77
|
+
lineStyle: (d: Datum) => Record<string, AreaStyleValue>;
|
|
65
78
|
/** Selection-aware point style fn — `undefined` when `showPoints`
|
|
66
79
|
* is false so the HOC can spread it conditionally. */
|
|
67
80
|
pointStyle: ((d: Datum) => Record<string, string | number>) | undefined;
|
|
@@ -76,3 +89,4 @@ export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
|
|
|
76
89
|
* verbatim before extraction.
|
|
77
90
|
*/
|
|
78
91
|
export declare function useAreaSeriesSetup<TDatum extends Datum = Datum>(options: AreaSeriesSetupOptions<TDatum>): AreaSeriesSetupResult<TDatum>;
|
|
92
|
+
export {};
|
|
@@ -18,7 +18,7 @@ export interface ChartSetupInput {
|
|
|
18
18
|
/** The data array used for color scale and category extraction */
|
|
19
19
|
data: Array<Datum>;
|
|
20
20
|
/** The original data prop (may be undefined) — used for empty-state check */
|
|
21
|
-
rawData:
|
|
21
|
+
rawData: Array<Datum | null | undefined> | undefined;
|
|
22
22
|
/** The color-by accessor (may be an "actual" colorBy derived from stackBy/groupBy/categoryAccessor) */
|
|
23
23
|
colorBy: Accessor<string> | undefined;
|
|
24
24
|
/** Color scheme name or custom array — undefined lets useColorScale consult the theme */
|
|
@@ -53,7 +53,7 @@ export interface ChartSetupInput {
|
|
|
53
53
|
right: number;
|
|
54
54
|
};
|
|
55
55
|
/** onClick callback */
|
|
56
|
-
onClick?: (datum:
|
|
56
|
+
onClick?: (datum: Datum, event: {
|
|
57
57
|
x: number;
|
|
58
58
|
y: number;
|
|
59
59
|
}) => void;
|
|
@@ -28,6 +28,9 @@ interface ScaffoldOptions {
|
|
|
28
28
|
enableHover?: boolean;
|
|
29
29
|
showLegend?: boolean;
|
|
30
30
|
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
summary?: string;
|
|
33
|
+
accessibleTable?: boolean;
|
|
31
34
|
mobileInteraction?: MobileInteractionProp;
|
|
32
35
|
mobileSemantics?: MobileVisualizationContract;
|
|
33
36
|
responsiveRules?: ResponsiveRule[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref, RefObject
|
|
1
|
+
import type { Ref, RefObject } from "react";
|
|
2
2
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
3
3
|
type FrameVariant = "xy" | "network" | "geo-points" | "geo-lines";
|
|
4
4
|
interface Options {
|
|
@@ -15,7 +15,6 @@ interface Options {
|
|
|
15
15
|
variant: FrameVariant;
|
|
16
16
|
frameRef: RefObject<unknown>;
|
|
17
17
|
overrides?: Partial<RealtimeFrameHandle>;
|
|
18
|
-
deps?: DependencyList;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Wire up the HOC's exposed `ref` to the inner frame ref using the
|
|
@@ -30,11 +30,11 @@ export declare function resolveAccessorFn<T>(accessor: string | ((d: Datum) => T
|
|
|
30
30
|
* Interpolates from red → gray → blue for odd, red → blue for even.
|
|
31
31
|
*/
|
|
32
32
|
export declare function defaultDivergingScheme(n: number, themeDivergingSchemeName?: string): string[];
|
|
33
|
-
export declare function aggregateData(data:
|
|
33
|
+
export declare function aggregateData(data: Datum[], levels: string[], getCat: (d: Datum) => string, getScore: ((d: Datum) => number) | null, getLevel: ((d: Datum) => string) | null, getCount: ((d: Datum) => number) | null): AggregatedRow[];
|
|
34
34
|
export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
35
35
|
export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
36
36
|
interface UseLikertAggregationConfig {
|
|
37
|
-
data:
|
|
37
|
+
data: Datum[] | undefined;
|
|
38
38
|
levels: string[];
|
|
39
39
|
categoryAccessor?: string | ((d: Datum) => string);
|
|
40
40
|
valueAccessor?: string | ((d: Datum) => number);
|
|
@@ -47,9 +47,9 @@ interface UseLikertAggregationResult {
|
|
|
47
47
|
/** Pre-processed data for static mode */
|
|
48
48
|
processedData: AggregatedRow[];
|
|
49
49
|
/** Re-aggregate all accumulated data (call from push handlers) */
|
|
50
|
-
reAggregate: (rawData:
|
|
50
|
+
reAggregate: (rawData: Datum[]) => void;
|
|
51
51
|
/** Ref holding accumulated raw data for push mode */
|
|
52
|
-
accumulatorRef: MutableRefObject<
|
|
52
|
+
accumulatorRef: MutableRefObject<Datum[]>;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Encapsulates Likert-specific data aggregation:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChartAccessor } from "./types";
|
|
2
|
+
import type { Datum } from "./datumTypes";
|
|
2
3
|
export interface OrdinalBrushInput {
|
|
3
4
|
brushProp: boolean | undefined;
|
|
4
5
|
onBrushProp: ((extent: {
|
|
@@ -8,7 +9,7 @@ export interface OrdinalBrushInput {
|
|
|
8
9
|
name: string;
|
|
9
10
|
rField?: string;
|
|
10
11
|
} | undefined;
|
|
11
|
-
valueAccessor: ChartAccessor<
|
|
12
|
+
valueAccessor: ChartAccessor<Datum, number>;
|
|
12
13
|
}
|
|
13
14
|
export interface OrdinalBrushResult {
|
|
14
15
|
hasBrush: boolean;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule } from "./styleRules";
|
|
5
|
+
import type { HatchFill } from "./hatchFill";
|
|
6
|
+
/**
|
|
7
|
+
* Values a resolved piece style may carry. Wider than the axis-style
|
|
8
|
+
* `string | number` because `fill` can be a declarative {@link HatchFill}
|
|
9
|
+
* descriptor or a raw `CanvasPattern`.
|
|
10
|
+
*/
|
|
11
|
+
type PieceStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
12
|
+
type PieceStyleObject = Record<string, PieceStyleValue>;
|
|
4
13
|
export interface OrdinalPieceStyleOptions {
|
|
5
14
|
/** colorBy accessor — string field name or function */
|
|
6
15
|
colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
|
|
@@ -65,6 +74,19 @@ export interface OrdinalPieceStyleOptions {
|
|
|
65
74
|
effectiveSelectionHook: SelectionHookResult | null | undefined;
|
|
66
75
|
/** Resolved selection config (typically `setup.resolvedSelection`). */
|
|
67
76
|
resolvedSelection: import("./types").SelectionConfig | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Declarative, threshold-aware style rules. Evaluated per piece and merged
|
|
79
|
+
* on top of the resolved base fill (last-applicable rule wins per property).
|
|
80
|
+
* The user's `frameProps.pieceStyle` still overrides these, and top-level
|
|
81
|
+
* primitive props (`stroke`/`strokeWidth`/`opacity`) override everything.
|
|
82
|
+
*/
|
|
83
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the numeric value a threshold rule compares against for a datum
|
|
86
|
+
* (typically the chart's `valueAccessor` output). Lets `{ when: { gt: 10 } }`
|
|
87
|
+
* work with no `field` on the threshold.
|
|
88
|
+
*/
|
|
89
|
+
resolveRuleValue?: (d: Datum) => number | undefined;
|
|
68
90
|
}
|
|
69
91
|
/**
|
|
70
92
|
* Build a memoized `pieceStyle` function that the chart can pass
|
|
@@ -84,4 +106,5 @@ export interface OrdinalPieceStyleOptions {
|
|
|
84
106
|
* })
|
|
85
107
|
* ```
|
|
86
108
|
*/
|
|
87
|
-
export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) =>
|
|
109
|
+
export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) => PieceStyleObject;
|
|
110
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
|
|
|
37
37
|
legendPosition?: LegendPosition;
|
|
38
38
|
}): {
|
|
39
39
|
wrapPush: (originalPush: (d: Datum) => void) => (datum: Datum) => void;
|
|
40
|
-
wrapPushMany: (originalPushMany: (
|
|
40
|
+
wrapPushMany: (originalPushMany: (data: Datum[]) => void) => (data: Datum[]) => void;
|
|
41
41
|
resetCategories: () => void;
|
|
42
42
|
categories: string[];
|
|
43
43
|
categoryDomainProps: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult, SelectionStyleConfig } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
4
5
|
export interface XYLineStyleOptions {
|
|
5
6
|
/**
|
|
6
7
|
* Base stroke width. The top-level `strokeWidth` override below
|
|
@@ -33,6 +34,15 @@ export interface XYLineStyleOptions {
|
|
|
33
34
|
effectiveSelectionHook?: SelectionHookResult | null;
|
|
34
35
|
/** Resolved selection style config (matched/unmatched style overrides). */
|
|
35
36
|
resolvedSelection?: SelectionStyleConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Declarative style rules, merged on top of the resolved base stroke/fill
|
|
39
|
+
* (last-applicable rule wins). NOTE: line styles resolve per-SERIES against
|
|
40
|
+
* a representative sample datum (the series' first point), so a rule's
|
|
41
|
+
* `ctx.x`/`ctx.y` reflect that sample point, not every vertex.
|
|
42
|
+
*/
|
|
43
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
44
|
+
/** Build the `StyleRuleContext` for a series' sample datum + group key. */
|
|
45
|
+
ruleContext?: (d: Datum, group?: string) => StyleRuleContext;
|
|
36
46
|
}
|
|
37
47
|
/**
|
|
38
48
|
* Returns a memoized `lineStyle` callback that the XY frame's
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
5
|
+
import type { HatchFill } from "./hatchFill";
|
|
6
|
+
/** Values a resolved point style may carry (`fill` can be a HatchFill). */
|
|
7
|
+
type PointStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
8
|
+
type PointStyleObject = Record<string, PointStyleValue>;
|
|
4
9
|
export interface XYPointStyleOptions {
|
|
5
10
|
/** colorBy accessor — string field name or function. */
|
|
6
11
|
colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
|
|
@@ -46,6 +51,18 @@ export interface XYPointStyleOptions {
|
|
|
46
51
|
effectiveSelectionHook: SelectionHookResult | null | undefined;
|
|
47
52
|
/** Resolved selection config (typically `setup.resolvedSelection`). */
|
|
48
53
|
resolvedSelection: import("./types").SelectionConfig | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Declarative style rules, evaluated per point and merged on top of the
|
|
56
|
+
* resolved base fill (last-applicable rule wins). Same engine and precedence
|
|
57
|
+
* as the ordinal bar `styleRules`.
|
|
58
|
+
*/
|
|
59
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
60
|
+
/**
|
|
61
|
+
* Build the `StyleRuleContext` for a point — populate `value`/`x`/`y` from
|
|
62
|
+
* the chart's accessors so thresholds can target either axis
|
|
63
|
+
* (`{ axis: "x", gt: 5 }`). Called only when `styleRules` is set.
|
|
64
|
+
*/
|
|
65
|
+
ruleContext?: (d: Datum) => StyleRuleContext;
|
|
49
66
|
/**
|
|
50
67
|
* For ConnectedScatterplot-style charts whose color depends on the
|
|
51
68
|
* point's position in an ordered sequence, the resolver may need
|
|
@@ -84,4 +101,5 @@ export interface XYPointStyleOptions {
|
|
|
84
101
|
* })
|
|
85
102
|
* ```
|
|
86
103
|
*/
|
|
87
|
-
export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) =>
|
|
104
|
+
export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) => PointStyleObject;
|
|
105
|
+
export {};
|
|
@@ -9,22 +9,24 @@ import type { Datum } from "./datumTypes";
|
|
|
9
9
|
* Samples first, last, and a middle element to catch common mistakes
|
|
10
10
|
* (wrong field names, missing data) without iterating the entire dataset.
|
|
11
11
|
*/
|
|
12
|
-
type
|
|
12
|
+
type AccessorResult = string | number | boolean | Date | Datum | null | undefined;
|
|
13
|
+
type AccessorLike = string | ((datum: Datum, index?: number) => AccessorResult);
|
|
14
|
+
type ChartDataInput = ReadonlyArray<Datum> | Datum | string | number | boolean | null | undefined;
|
|
13
15
|
interface ArrayDataValidation {
|
|
14
16
|
componentName: string;
|
|
15
|
-
data:
|
|
17
|
+
data: ChartDataInput;
|
|
16
18
|
accessors?: Record<string, AccessorLike | undefined>;
|
|
17
19
|
requiredProps?: Datum;
|
|
18
20
|
}
|
|
19
21
|
interface ObjectDataValidation {
|
|
20
22
|
componentName: string;
|
|
21
|
-
data:
|
|
23
|
+
data: ChartDataInput;
|
|
22
24
|
dataLabel?: string;
|
|
23
25
|
}
|
|
24
26
|
interface NetworkDataValidation {
|
|
25
27
|
componentName: string;
|
|
26
|
-
nodes?:
|
|
27
|
-
edges?:
|
|
28
|
+
nodes?: ReadonlyArray<Datum> | null;
|
|
29
|
+
edges?: ReadonlyArray<Datum> | null;
|
|
28
30
|
nodesRequired?: boolean;
|
|
29
31
|
edgesRequired?: boolean;
|
|
30
32
|
accessors?: Record<string, AccessorLike | undefined>;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation map derived from the Chart Spec Registry.
|
|
3
|
+
*
|
|
4
|
+
* The generated module contains only the fields consumed by `validateProps`.
|
|
5
|
+
* Keeping the docs/schema-rich registry out of this runtime import path saves
|
|
6
|
+
* it from every AI and utility bundle while preserving VALIDATION_MAP's public
|
|
7
|
+
* object shape. Regenerate after chart-spec edits with:
|
|
8
|
+
*
|
|
9
|
+
* npm run docs:chart-specs:schema
|
|
10
|
+
*/
|
|
11
|
+
export { VALIDATION_MAP } from "./validationMap.generated";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { Datum, DatumValue } from "./datumTypes";
|
|
2
3
|
interface SafeRenderProps {
|
|
3
4
|
componentName: string;
|
|
4
5
|
width: number;
|
|
@@ -25,7 +26,7 @@ export declare function SafeRender({ componentName, width, height, children }: S
|
|
|
25
26
|
* Renders a "No data available" placeholder when data is empty.
|
|
26
27
|
* Returns null when data is present or emptyContent is `false`.
|
|
27
28
|
*/
|
|
28
|
-
export declare function renderEmptyState(data:
|
|
29
|
+
export declare function renderEmptyState(data: Datum[] | undefined | null, width: number, height: number, emptyContent?: React.ReactNode | false): React.ReactElement | null;
|
|
29
30
|
/**
|
|
30
31
|
* Renders a loading placeholder while `loading` is true.
|
|
31
32
|
*
|
|
@@ -39,7 +40,7 @@ export declare function renderEmptyState(data: any[] | undefined | null, width:
|
|
|
39
40
|
*/
|
|
40
41
|
export declare function renderLoadingState(loading: boolean | undefined, width: number, height: number, loadingContent?: React.ReactNode | false): React.ReactElement | null;
|
|
41
42
|
/** Warn if a string accessor isn't found in the first data element */
|
|
42
|
-
export declare function warnMissingField(componentName: string, data:
|
|
43
|
+
export declare function warnMissingField(componentName: string, data: Datum[] | undefined, accessorName: string, accessorValue: DatumValue): void;
|
|
43
44
|
/** Warn if data looks like the wrong shape for this chart type */
|
|
44
|
-
export declare function warnDataShape(componentName: string, data:
|
|
45
|
+
export declare function warnDataShape(componentName: string, data: Array<Datum | string | number | boolean | null | undefined> | undefined, expectedKeys: string[], hint: string): void;
|
|
45
46
|
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BigNumberFormat, BigNumberTarget } from "./types";
|
|
2
|
+
export interface TargetPresentation {
|
|
3
|
+
label: string | undefined;
|
|
4
|
+
percent: string | null;
|
|
5
|
+
formattedValue: string;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
interface UseTargetPresentationOptions {
|
|
9
|
+
target: BigNumberTarget | undefined;
|
|
10
|
+
value: number | null | undefined;
|
|
11
|
+
format: BigNumberFormat | undefined;
|
|
12
|
+
locale: string | undefined;
|
|
13
|
+
currency: string | undefined;
|
|
14
|
+
precision: number | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Format a finite target once for both visible chrome and the accessible
|
|
18
|
+
* sentence. Invalid target values are omitted rather than announcing NaN or
|
|
19
|
+
* infinity.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useTargetPresentation({ target, value, format, locale, currency, precision }: UseTargetPresentationOptions): TargetPresentation | null;
|
|
22
|
+
export {};
|
|
@@ -70,7 +70,7 @@ export interface BigNumberThreshold {
|
|
|
70
70
|
level: BigNumberLevel;
|
|
71
71
|
/** Explicit colour override; otherwise `var(--semiotic-{level})`. */
|
|
72
72
|
color?: string;
|
|
73
|
-
/** Optional label
|
|
73
|
+
/** Optional label appended to the generated ARIA sentence. */
|
|
74
74
|
label?: string;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
@@ -252,11 +252,10 @@ export interface BigNumberProps<_TDatum extends Datum = Datum> {
|
|
|
252
252
|
* full-width and stacks the chart at full card width under the delta
|
|
253
253
|
* row. */
|
|
254
254
|
trendSlot?: BigNumberSlot;
|
|
255
|
-
/** **Square** chart
|
|
256
|
-
* `PieChart` / `Scatterplot` / `Treemap`.
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* (square chart on the right, wide trend along the bottom). */
|
|
255
|
+
/** **Square** chart anchored as a top-right card decoration — e.g. a
|
|
256
|
+
* `DonutChart` / `PieChart` / `Scatterplot` / `Treemap`. The header
|
|
257
|
+
* reserves its corner; choose `chartSize` to leave room for large values
|
|
258
|
+
* or compose with `trendSlot` for a wide chart along the bottom. */
|
|
260
259
|
chartSlot?: BigNumberSlot;
|
|
261
260
|
/** Reserved pixel size (square) for `chartSlot`. Defaults are
|
|
262
261
|
* mode-keyed for sparkline scale — 44 px for `tile`, 80 px for
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
6
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
|
|
9
10
|
export interface SemanticGradientStop {
|
|
10
11
|
/** Percent from baseline to line/top. 0 = baseline, 100 = line/top. */
|
|
@@ -65,6 +66,13 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
65
66
|
* @default "category10"
|
|
66
67
|
*/
|
|
67
68
|
colorScheme?: string | string[] | Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Declarative, threshold-aware area styling. Ordered `{ when, style }`
|
|
71
|
+
* rules; last applicable rule wins. Per-SERIES (resolves against the series'
|
|
72
|
+
* sample datum). A rule `fill` may be a color or a HatchFill — hatch an
|
|
73
|
+
* "uncertain"/"projected" series. Layers over the resolved series color.
|
|
74
|
+
*/
|
|
75
|
+
styleRules?: StyleRule[];
|
|
68
76
|
/**
|
|
69
77
|
* Curve interpolation type
|
|
70
78
|
* @default "monotoneX"
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
6
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
import { type RegressionProp } from "../shared/regressionUtils";
|
|
9
10
|
/**
|
|
10
11
|
* BubbleChart component props
|
|
@@ -56,6 +57,14 @@ export interface BubbleChartProps<TDatum extends Datum = Datum> extends BaseChar
|
|
|
56
57
|
* @default "category10"
|
|
57
58
|
*/
|
|
58
59
|
colorScheme?: string | string[] | Record<string, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Declarative, threshold-aware bubble styling. Ordered `{ when, style }`
|
|
62
|
+
* rules; last applicable rule wins per property. `when` accepts a predicate
|
|
63
|
+
* (`ctx` = `{ value, x, y, size, category }`), a declarative threshold
|
|
64
|
+
* (`{ axis: "x"|"y", gt, … }`), or `true`. A rule's `fill` may be a color or
|
|
65
|
+
* a HatchFill. Layers over the resolved base color.
|
|
66
|
+
*/
|
|
67
|
+
styleRules?: StyleRule[];
|
|
59
68
|
/**
|
|
60
69
|
* Bubble opacity
|
|
61
70
|
* @default 0.6
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { LegendInteractionMode } from "../shared/hooks";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
import { type RegressionProp } from "../shared/regressionUtils";
|
|
9
10
|
import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
|
|
10
11
|
/**
|
|
@@ -25,6 +26,12 @@ export interface ConnectedScatterplotProps<TDatum extends Datum = Datum> extends
|
|
|
25
26
|
orderAccessor?: string | ((d: TDatum) => number | Date);
|
|
26
27
|
/** Label for the ordering metric in tooltips @default "Order" or the accessor field name */
|
|
27
28
|
orderLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Declarative, threshold-aware point styling (see Scatterplot). Ordered
|
|
31
|
+
* `{ when, style }` rules; last applicable rule wins. Layers over the
|
|
32
|
+
* order-derived base fill.
|
|
33
|
+
*/
|
|
34
|
+
styleRules?: StyleRule[];
|
|
28
35
|
/** Point radius @default 4 */
|
|
29
36
|
pointRadius?: number;
|
|
30
37
|
/** Enable hover annotations @default true */
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
6
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
|
+
export { computeDifferenceSegments } from "./differenceSegments";
|
|
8
9
|
/**
|
|
9
10
|
* DifferenceChart props
|
|
10
11
|
*/
|
|
@@ -75,57 +76,6 @@ export interface DifferenceChartProps<TDatum extends Datum = Datum> extends Base
|
|
|
75
76
|
/** Pass-through StreamXYFrame props. */
|
|
76
77
|
frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size">>;
|
|
77
78
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Crossover-segmented record used by the area pipeline. One row per
|
|
80
|
-
* vertex along either the upper or lower boundary; `__diffSegment` is a
|
|
81
|
-
* group key per segment so the area scene builder produces one polygon
|
|
82
|
-
* per id with the correct fill color.
|
|
83
|
-
*/
|
|
84
|
-
interface SegmentRow {
|
|
85
|
-
__x: number;
|
|
86
|
-
/** Upper boundary y value (max of A, B). The area pipeline reads this. */
|
|
87
|
-
__y: number;
|
|
88
|
-
/** Lower boundary y value (min of A, B) — picked up as per-datum y0. */
|
|
89
|
-
__y0: number;
|
|
90
|
-
/** Segment id. Format: `"seg-<index>-<winner>"`. */
|
|
91
|
-
__diffSegment: string;
|
|
92
|
-
/** Which series is on top in this segment ("A" or "B"). Drives fill. */
|
|
93
|
-
__diffWinner: "A" | "B";
|
|
94
|
-
/** Original A value at this x (or interpolated at crossovers). */
|
|
95
|
-
__valA: number;
|
|
96
|
-
/** Original B value at this x (or interpolated at crossovers). */
|
|
97
|
-
__valB: number;
|
|
98
|
-
/** Original datum (for tooltip lookup at non-crossover vertices). */
|
|
99
|
-
__sourceDatum?: Datum;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Walk sorted data, splitting at each A↔B crossover. Inserts an
|
|
103
|
-
* interpolated vertex on BOTH sides of every crossover so adjacent
|
|
104
|
-
* segments meet at a zero-width point (no jagged edges).
|
|
105
|
-
*
|
|
106
|
-
* Non-finite rows are skipped; the algorithm tracks the most recent
|
|
107
|
-
* VALID non-tie row (not the index neighbor) for crossover detection,
|
|
108
|
-
* so a non-finite gap doesn't drop a crossover that straddles it.
|
|
109
|
-
*
|
|
110
|
-
* Tie rows (a === b) are handled distinctly from non-tie rows:
|
|
111
|
-
*
|
|
112
|
-
* - When a tie row sits BETWEEN two non-tie rows with the SAME
|
|
113
|
-
* winner, the tie is emitted in that winner's segment as a
|
|
114
|
-
* zero-width vertex.
|
|
115
|
-
* - When a tie row sits between non-tie rows with DIFFERENT winners,
|
|
116
|
-
* the FIRST tie of the run becomes the crossover vertex. The old
|
|
117
|
-
* segment closes at the tie's x, the new segment opens at the same
|
|
118
|
-
* point, and any subsequent tie rows (multi-tie runs) carry into
|
|
119
|
-
* the new segment as zero-width vertices.
|
|
120
|
-
*
|
|
121
|
-
* This preserves the data's actual zero-difference point: if the user
|
|
122
|
-
* supplied a tie row explicitly, the fill switches color exactly at
|
|
123
|
-
* that x rather than at a linear-interpolated x that ignored the tie.
|
|
124
|
-
*
|
|
125
|
-
* Exported for direct unit-testing — the area pipeline depends on the
|
|
126
|
-
* exact crossover-vertex shape produced here.
|
|
127
|
-
*/
|
|
128
|
-
export declare function computeDifferenceSegments<TDatum extends Datum>(raw: TDatum[], getX: (d: TDatum) => number, getA: (d: TDatum) => number, getB: (d: TDatum) => number): SegmentRow[];
|
|
129
79
|
/**
|
|
130
80
|
* DifferenceChart — fills the area between two series with a color
|
|
131
81
|
* that switches based on which series is higher at each x. Crossover
|
|
@@ -169,4 +119,3 @@ export declare const DifferenceChart: {
|
|
|
169
119
|
<TDatum extends Datum = Datum>(props: DifferenceChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
170
120
|
displayName?: string;
|
|
171
121
|
};
|
|
172
|
-
export {};
|
|
@@ -43,7 +43,7 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
|
|
|
43
43
|
/**
|
|
44
44
|
* Format function for x-axis tick labels
|
|
45
45
|
*/
|
|
46
|
-
xFormat?: (d:
|
|
46
|
+
xFormat?: (d: string | number | Date, index?: number, allTicks?: number[]) => string;
|
|
47
47
|
/**
|
|
48
48
|
* Format function for y-axis tick labels
|
|
49
49
|
*/
|
|
@@ -64,7 +64,7 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
|
|
|
64
64
|
* customColorScale={scaleSequential(interpolatePlasma).domain([0, 100])}
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
customColorScale?:
|
|
67
|
+
customColorScale?: (value: number) => string;
|
|
68
68
|
/**
|
|
69
69
|
* Show values in cells
|
|
70
70
|
* @default false
|