semiotic 3.8.1 → 3.8.3
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 +3 -1
- package/README.md +54 -52
- package/ai/behaviorContracts.cjs +9 -0
- package/ai/dist/mcp-server.js +142 -13
- package/ai/schema.json +616 -42
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +5 -2
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
- package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
- package/dist/chunk-chunk-2CCFBTQC.module.min.js +2 -0
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
- package/dist/chunk-chunk-2RXP3FS3.module.min.js +1 -0
- package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
- package/dist/chunk-chunk-4TMZXLCR.module.min.js +1 -0
- package/dist/chunk-chunk-5APBQXZA.module.min.js +1 -0
- package/dist/chunk-chunk-5RKXZQ2P.module.min.js +1 -0
- package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
- package/dist/chunk-chunk-6HSGDMTA.module.min.js +2 -0
- package/dist/chunk-chunk-7FW6EGLP.module.min.js +2 -0
- package/dist/chunk-chunk-7OEOSCBP.module.min.js +1 -0
- package/dist/chunk-chunk-A63CTACR.module.min.js +2 -0
- package/dist/chunk-chunk-ANYDWOZF.module.min.js +1 -0
- package/dist/chunk-chunk-AZJUDQRM.module.min.js +2 -0
- package/dist/chunk-chunk-B6V35LMY.module.min.js +2 -0
- package/dist/chunk-chunk-BOSVL645.module.min.js +2 -0
- package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
- package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
- package/dist/chunk-chunk-EMO5NUGE.module.min.js +2 -0
- package/dist/chunk-chunk-F25UA5HT.module.min.js +1 -0
- package/dist/chunk-chunk-FRIO6MCV.module.min.js +1 -0
- package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
- package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
- package/dist/chunk-chunk-GWSWSPXN.module.min.js +1 -0
- package/dist/chunk-chunk-I6C3KR5H.module.min.js +2 -0
- package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
- package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
- package/dist/chunk-chunk-J5RL6GXU.module.min.js +2 -0
- package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
- package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
- package/dist/chunk-chunk-JNCHKRIR.module.min.js +2 -0
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
- package/dist/chunk-chunk-L3H6DQCR.module.min.js +2 -0
- package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
- package/dist/chunk-chunk-M7VYYHCE.module.min.js +2 -0
- package/dist/chunk-chunk-MC35ILYP.module.min.js +2 -0
- package/dist/chunk-chunk-N72SWNBV.module.min.js +1 -0
- package/dist/chunk-chunk-OBQRFTIL.module.min.js +2 -0
- package/dist/chunk-chunk-OQTLSTGI.module.min.js +2 -0
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
- package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
- package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
- package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
- package/dist/chunk-chunk-SA3D43RA.module.min.js +2 -0
- package/dist/chunk-chunk-SANERMIZ.module.min.js +2 -0
- package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
- package/dist/chunk-chunk-UHSZEB74.module.min.js +1 -0
- package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
- package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
- package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
- package/dist/chunk-chunk-XQYVEKEJ.module.min.js +2 -0
- package/dist/chunk-chunk-Y6AXCRVO.module.min.js +1 -0
- package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
- package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
- package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -6
- package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +11 -0
- package/dist/components/charts/shared/areaSeriesData.d.ts +15 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
- package/dist/components/charts/shared/chartMode.d.ts +67 -0
- package/dist/components/charts/shared/colorUtils.d.ts +8 -0
- package/dist/components/charts/shared/geoStyleDefaults.d.ts +3 -0
- package/dist/components/charts/shared/hooks.d.ts +13 -80
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useXYLineStyle.d.ts +3 -2
- package/dist/components/charts/shared/xyLineStyle.d.ts +21 -0
- package/dist/components/charts/xy/LineChart.d.ts +3 -0
- package/dist/components/legendLayout.d.ts +31 -0
- package/dist/components/server/serverChartConfigShared.d.ts +29 -0
- package/dist/components/server/serverChartConfigs.d.ts +2 -13
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -0
- package/dist/components/server/serverGaugeOverlay.d.ts +28 -0
- package/dist/components/server/staticLegend.d.ts +7 -1
- package/dist/components/server/staticSVGChrome.d.ts +60 -2
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +2 -0
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
- package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
- package/dist/components/stream/SceneToSVG.d.ts +8 -6
- package/dist/components/stream/SceneToSVGGeo.d.ts +10 -0
- package/dist/components/stream/SceneToSVGNetwork.d.ts +12 -0
- package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
- package/dist/components/stream/canvasBackground.d.ts +7 -0
- package/dist/components/stream/networkTypes.d.ts +2 -4
- package/dist/components/stream/renderBackend.d.ts +14 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +51 -0
- package/dist/components/types/legendTypes.d.ts +16 -3
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.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-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- 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-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-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- 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-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.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.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/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -4
- package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
- package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
- package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
- package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
- package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
export { DEFAULT_COLOR } from "./colorUtils";
|
|
2
2
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
3
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
4
|
-
import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode, HoverHighlightMode,
|
|
4
|
+
import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode, HoverHighlightMode, ResolvedMobileInteractionConfig } from "./types";
|
|
5
5
|
import type { MarginType, PartialMargin } from "../../types/marginType";
|
|
6
6
|
import type { TransitionConfig } from "../../stream/types";
|
|
7
|
+
import type { LegendValue } from "../../types/legendTypes";
|
|
7
8
|
import type { Datum } from "./datumTypes";
|
|
8
|
-
import type {
|
|
9
|
-
|
|
9
|
+
import type { ChartModeInput, ChartModeResult } from "./chartMode";
|
|
10
|
+
export { DISABLED_MOBILE_INTERACTION, MOBILE_INTERACTION_DEFAULTS, MOBILE_INTERACTION_MIN_HIT_RADIUS, MOBILE_INTERACTION_TARGET_SIZE, isChartMode, resolveChartMode, resolveMobileInteraction, } from "./chartMode";
|
|
11
|
+
export type { ChartModeInput, ChartModeResult } from "./chartMode";
|
|
10
12
|
import type { SemanticClickBehavior, SemanticHoverBehavior } from "./semanticInteractions";
|
|
11
|
-
/**
|
|
12
|
-
* Default fill color used when no colorBy is specified
|
|
13
|
-
*/
|
|
14
|
-
export declare const DEFAULT_COLOR = "#007bff";
|
|
15
|
-
export declare const MOBILE_INTERACTION_TARGET_SIZE = 44;
|
|
16
|
-
export declare const MOBILE_INTERACTION_MIN_HIT_RADIUS = 24;
|
|
17
|
-
export declare const MOBILE_INTERACTION_DEFAULTS: ResolvedMobileInteractionConfig;
|
|
18
|
-
export declare const DISABLED_MOBILE_INTERACTION: ResolvedMobileInteractionConfig;
|
|
19
|
-
export declare function resolveMobileInteraction(input: MobileInteractionProp | undefined, context?: {
|
|
20
|
-
mode?: ChartMode;
|
|
21
|
-
width?: number;
|
|
22
|
-
mobileSemantics?: MobileVisualizationContract;
|
|
23
|
-
}): ResolvedMobileInteractionConfig;
|
|
24
13
|
/**
|
|
25
14
|
* Returns the theme's categorical palette, or undefined if no ThemeProvider or
|
|
26
15
|
* the palette is empty. Safe to call outside a ThemeProvider (returns undefined).
|
|
@@ -113,7 +102,7 @@ export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceI
|
|
|
113
102
|
* expansion pattern that every chart with color encoding repeats.
|
|
114
103
|
*/
|
|
115
104
|
export type LegendPosition = "right" | "left" | "top" | "bottom";
|
|
116
|
-
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, }: {
|
|
105
|
+
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, additionalLegend, }: {
|
|
117
106
|
data: Array<Datum>;
|
|
118
107
|
colorBy: Accessor<string> | undefined;
|
|
119
108
|
colorScale: ((v: string) => string) | undefined;
|
|
@@ -122,8 +111,10 @@ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, sho
|
|
|
122
111
|
userMargin: PartialMargin | undefined;
|
|
123
112
|
defaults?: MarginType;
|
|
124
113
|
categories?: string[];
|
|
114
|
+
/** Caller legend composed after the chart's inferred categorical groups. */
|
|
115
|
+
additionalLegend?: LegendValue;
|
|
125
116
|
}): {
|
|
126
|
-
legend:
|
|
117
|
+
legend: LegendValue | undefined;
|
|
127
118
|
margin: MarginType;
|
|
128
119
|
legendPosition: LegendPosition;
|
|
129
120
|
};
|
|
@@ -153,67 +144,10 @@ export interface LegendInteractionState {
|
|
|
153
144
|
* - "isolate": click toggles category visibility; click all to reset
|
|
154
145
|
*/
|
|
155
146
|
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
|
|
156
|
-
interface ChartModeInput {
|
|
157
|
-
width?: number;
|
|
158
|
-
height?: number;
|
|
159
|
-
showAxes?: boolean;
|
|
160
|
-
showGrid?: boolean;
|
|
161
|
-
enableHover?: boolean;
|
|
162
|
-
showLegend?: boolean;
|
|
163
|
-
showLabels?: boolean;
|
|
164
|
-
showCategoryTicks?: boolean;
|
|
165
|
-
/** "vertical" | "horizontal" — used to shrink the category-axis margin when showCategoryTicks is false */
|
|
166
|
-
orientation?: string;
|
|
167
|
-
title?: string;
|
|
168
|
-
description?: string;
|
|
169
|
-
summary?: string;
|
|
170
|
-
accessibleTable?: boolean;
|
|
171
|
-
xLabel?: string;
|
|
172
|
-
yLabel?: string;
|
|
173
|
-
categoryLabel?: string;
|
|
174
|
-
valueLabel?: string;
|
|
175
|
-
/** When truthy, enableHover is forced true regardless of mode (LinkedCharts needs hover) */
|
|
176
|
-
linkedHover?: LinkedHoverProp;
|
|
177
|
-
/** Optional mobile interaction policy surfaced through useChartMode for custom wrappers. */
|
|
178
|
-
mobileInteraction?: MobileInteractionProp;
|
|
179
|
-
/** Optional mobile semantic contract surfaced through useChartMode for custom wrappers. */
|
|
180
|
-
mobileSemantics?: MobileVisualizationContract;
|
|
181
|
-
/** Semantic responsive transformations resolved before mode defaults. */
|
|
182
|
-
responsiveRules?: ResponsiveRule[];
|
|
183
|
-
}
|
|
184
|
-
/** Result of {@link useChartMode} — exported so declaration emit can name it. */
|
|
185
|
-
export interface ChartModeResult {
|
|
186
|
-
width: number;
|
|
187
|
-
height: number;
|
|
188
|
-
showAxes: boolean;
|
|
189
|
-
showGrid: boolean;
|
|
190
|
-
enableHover: boolean;
|
|
191
|
-
showLegend: boolean | undefined;
|
|
192
|
-
showLabels: boolean | undefined;
|
|
193
|
-
title: string | undefined;
|
|
194
|
-
description: string | undefined;
|
|
195
|
-
summary: string | undefined;
|
|
196
|
-
accessibleTable: boolean | undefined;
|
|
197
|
-
xLabel: string | undefined;
|
|
198
|
-
yLabel: string | undefined;
|
|
199
|
-
categoryLabel: string | undefined;
|
|
200
|
-
valueLabel: string | undefined;
|
|
201
|
-
marginDefaults: {
|
|
202
|
-
top: number;
|
|
203
|
-
bottom: number;
|
|
204
|
-
left: number;
|
|
205
|
-
right: number;
|
|
206
|
-
};
|
|
207
|
-
/** True when mode is context or sparkline — the "hide interactive chrome" union. */
|
|
208
|
-
compactMode: boolean;
|
|
209
|
-
/** Resolved touch-first behavior for mobile-capable wrappers. */
|
|
210
|
-
mobileInteraction: ResolvedMobileInteractionConfig;
|
|
211
|
-
/** Mobile semantic contract after matching responsive rules are applied. */
|
|
212
|
-
mobileSemantics: MobileVisualizationContract | undefined;
|
|
213
|
-
}
|
|
214
147
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
148
|
+
* React-facing alias for {@link resolveChartMode}. Mode resolution is kept
|
|
149
|
+
* pure so non-React renderers (notably semiotic/server) consume the exact same
|
|
150
|
+
* defaults and responsive-rule contract as chart HOCs.
|
|
217
151
|
*/
|
|
218
152
|
export declare function useChartMode(mode: ChartMode | undefined, userProps: ChartModeInput, primaryDefaults?: {
|
|
219
153
|
width?: number;
|
|
@@ -227,4 +161,3 @@ export declare function resolveAnimateConfig(animate: boolean | {
|
|
|
227
161
|
duration?: number;
|
|
228
162
|
easing?: "linear" | "ease-out";
|
|
229
163
|
} | undefined): TransitionConfig | undefined;
|
|
230
|
-
export {};
|
|
@@ -7,6 +7,7 @@ import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
|
7
7
|
import type { PartialMargin } from "../../types/marginType";
|
|
8
8
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
9
9
|
import type { ReactElement, ReactNode } from "react";
|
|
10
|
+
import type { LegendValue } from "../../types/legendTypes";
|
|
10
11
|
/**
|
|
11
12
|
* Input parameters for useChartSetup.
|
|
12
13
|
*
|
|
@@ -43,6 +44,8 @@ export interface ChartSetupInput {
|
|
|
43
44
|
chartId: string | undefined;
|
|
44
45
|
/** Show legend override */
|
|
45
46
|
showLegend: boolean | undefined;
|
|
47
|
+
/** Caller legend appended to inferred categorical legend groups. */
|
|
48
|
+
legend?: LegendValue;
|
|
46
49
|
/** User-provided margin */
|
|
47
50
|
userMargin: PartialMargin | undefined;
|
|
48
51
|
/** Mode-resolved margin defaults */
|
|
@@ -8,6 +8,7 @@ import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
|
8
8
|
import { type PartialMargin, type MarginType } from "../../types/marginType";
|
|
9
9
|
import type { Datum } from "./datumTypes";
|
|
10
10
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
11
|
+
import type { LegendValue } from "../../types/legendTypes";
|
|
11
12
|
/**
|
|
12
13
|
* Margin shorthand → sided form. The Stream*Frame margin props only
|
|
13
14
|
* accept the sided object form, so HOCs that expose the user-friendly
|
|
@@ -64,6 +65,8 @@ interface DataSetupOptions extends ScaffoldOptions {
|
|
|
64
65
|
colorScheme?: string | string[] | Record<string, string>;
|
|
65
66
|
/** Semantic color accessor for legend, linked-hover series mode, and frame color config. */
|
|
66
67
|
colorBy?: Accessor<string>;
|
|
68
|
+
/** Caller legend appended to the inferred colorBy legend. */
|
|
69
|
+
legend?: LegendValue;
|
|
67
70
|
/** Pass-through chart-setup inputs. */
|
|
68
71
|
selection?: SelectionConfig;
|
|
69
72
|
linkedHover?: LinkedHoverProp;
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
|
5
|
-
|
|
4
|
+
import type { XYLineBaseStyleOptions } from "./xyLineStyle";
|
|
5
|
+
import type { StyleRule, StyleRuleContext } from "./styleRules";
|
|
6
|
+
export interface XYLineStyleOptions extends XYLineBaseStyleOptions {
|
|
6
7
|
/**
|
|
7
8
|
* Base stroke width. The top-level `strokeWidth` override below
|
|
8
9
|
* wins via `mergeShapeStyle` when both are supplied.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Datum } from "./datumTypes";
|
|
2
|
+
import type { Accessor, ChartAccessor } from "./types";
|
|
3
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
4
|
+
/** Pure portion of the LineChart style contract, shared by CSR and SSR. */
|
|
5
|
+
export interface XYLineBaseStyleOptions {
|
|
6
|
+
lineWidth?: number;
|
|
7
|
+
colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
|
|
8
|
+
colorScale?: (value: string) => string;
|
|
9
|
+
color?: string;
|
|
10
|
+
resolveStroke?: (datum: Datum, group?: string) => string;
|
|
11
|
+
fillArea?: boolean | string[];
|
|
12
|
+
areaOpacity?: number;
|
|
13
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
14
|
+
ruleContext?: (datum: Datum, group?: string) => StyleRuleContext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the deterministic data-to-style callback used before primitive and
|
|
18
|
+
* selection overlays. Keeping this free of React lets renderChart() apply the
|
|
19
|
+
* same default/color/fill/rule precedence as the client HOC.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildXYLineBaseStyle(options: XYLineBaseStyleOptions): (datum: Datum, group?: string) => Datum;
|
|
@@ -7,6 +7,7 @@ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types"
|
|
|
7
7
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
8
8
|
import { type StyleRule } from "../shared/styleRules";
|
|
9
9
|
import type { AnomalyConfig, ForecastConfig } from "../shared/statisticalOverlays";
|
|
10
|
+
import type { LegendValue } from "../../types/legendTypes";
|
|
10
11
|
/**
|
|
11
12
|
* LineChart component props
|
|
12
13
|
*/
|
|
@@ -153,6 +154,8 @@ export interface LineChartProps<TDatum extends Datum = Datum> extends BaseChartP
|
|
|
153
154
|
* @default "right"
|
|
154
155
|
*/
|
|
155
156
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
157
|
+
/** Additional legend content. Categorical groups follow the inferred series legend. */
|
|
158
|
+
legend?: LegendValue;
|
|
156
159
|
/**
|
|
157
160
|
* Tooltip configuration
|
|
158
161
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LegendLayout } from "./types/legendTypes";
|
|
2
|
+
export declare const DEFAULT_LEGEND_SWATCH_SIZE = 16;
|
|
3
|
+
export declare const DEFAULT_LEGEND_LABEL_GAP = 6;
|
|
4
|
+
export declare const DEFAULT_LEGEND_ITEM_GAP = 10;
|
|
5
|
+
export declare const DEFAULT_LEGEND_ROW_HEIGHT = 22;
|
|
6
|
+
export interface LegendMetrics {
|
|
7
|
+
swatchSize: number;
|
|
8
|
+
labelGap: number;
|
|
9
|
+
itemGap: number;
|
|
10
|
+
rowHeight: number;
|
|
11
|
+
align: "start" | "center" | "end";
|
|
12
|
+
maxWidth?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface VerticalLegendGroupInput {
|
|
15
|
+
hasLabel: boolean;
|
|
16
|
+
itemCount: number;
|
|
17
|
+
}
|
|
18
|
+
export interface VerticalLegendGroupLayout {
|
|
19
|
+
lineY: number;
|
|
20
|
+
labelY?: number;
|
|
21
|
+
itemsY: number;
|
|
22
|
+
endY: number;
|
|
23
|
+
}
|
|
24
|
+
/** Resolve the dimensions used by both the interactive and static legends. */
|
|
25
|
+
export declare function resolveLegendMetrics(layout?: LegendLayout): LegendMetrics;
|
|
26
|
+
/**
|
|
27
|
+
* Lay out vertical legend groups using the long-standing Legend.tsx geometry.
|
|
28
|
+
* Keeping this calculation renderer-neutral prevents SSR and CSR from drifting
|
|
29
|
+
* when labels, multiple groups, or custom row heights are used.
|
|
30
|
+
*/
|
|
31
|
+
export declare function layoutVerticalLegendGroups(groups: VerticalLegendGroupInput[], rowHeight: number): VerticalLegendGroupLayout[];
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
|
+
import type { ChartMode } from "../charts/shared/types";
|
|
3
|
+
import type { ChartModeInput, ChartModeResult } from "../charts/shared/chartMode";
|
|
4
|
+
import type { SemioticTheme } from "../store/ThemeStore";
|
|
5
|
+
import type { ReactNode } from "react";
|
|
2
6
|
export type FrameType = "xy" | "ordinal" | "network" | "geo" | "physics";
|
|
3
7
|
export type ServerAccessorValue = string | number | boolean | Date | null | undefined;
|
|
4
8
|
export type ServerAccessor = string | ((datum: Datum) => ServerAccessorValue);
|
|
5
9
|
export type ServerColorScheme = string | string[] | Record<string, string> | undefined;
|
|
6
10
|
export type ServerChartData = Datum | Datum[] | null | undefined;
|
|
11
|
+
export type ServerMargin = {
|
|
12
|
+
top: number;
|
|
13
|
+
right: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
left: number;
|
|
16
|
+
};
|
|
17
|
+
export interface ServerChartLayoutDefaults {
|
|
18
|
+
/** Force a semantic mode for aliases such as the server-only Sparkline. */
|
|
19
|
+
mode?: ChartMode;
|
|
20
|
+
/** HOC-specific primary dimensions. Compact/mobile modes retain shared defaults. */
|
|
21
|
+
primarySize?: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
/** Chart-specific margin contract when the HOC does not use mode margins. */
|
|
26
|
+
margin?: ServerMargin | ((props: Datum, resolved: ChartModeResult) => ServerMargin);
|
|
27
|
+
/** HOC defaults applied before explicit props and semantic mode resolution. */
|
|
28
|
+
modeDefaults?: Partial<ChartModeInput>;
|
|
29
|
+
}
|
|
30
|
+
export interface ServerChartOverlayContext {
|
|
31
|
+
theme: SemioticTheme;
|
|
32
|
+
}
|
|
7
33
|
export interface ChartConfig {
|
|
8
34
|
frameType: FrameType;
|
|
35
|
+
layout?: ServerChartLayoutDefaults;
|
|
9
36
|
/** Build frame props from HOC-level props */
|
|
10
37
|
buildProps: (data: ServerChartData, colorBy: ServerAccessor | undefined, colorScheme: ServerColorScheme, common: Datum, rest: Datum) => Datum;
|
|
38
|
+
/** Optional chart-owned SVG overlay rendered after the shared frame. */
|
|
39
|
+
renderOverlay?: (frameProps: Datum, context: ServerChartOverlayContext) => ReactNode;
|
|
11
40
|
}
|
|
12
41
|
export declare function accessorValue(accessor: ServerAccessor | undefined, fallback: string, d: Datum): ServerAccessorValue;
|
|
13
42
|
export declare function numericValue(value: ServerAccessorValue): number;
|
|
@@ -12,22 +12,11 @@ export declare const CHART_CONFIGS: {
|
|
|
12
12
|
StackedAreaChart: ChartConfig;
|
|
13
13
|
Scatterplot: ChartConfig;
|
|
14
14
|
CandlestickChart: ChartConfig;
|
|
15
|
-
BubbleChart:
|
|
16
|
-
frameType: "xy";
|
|
17
|
-
buildProps: (data: import("./serverChartConfigShared").ServerChartData, colorBy: import("./serverChartConfigShared").ServerAccessor | undefined, colorScheme: import("./serverChartConfigShared").ServerColorScheme, common: import("../stream/networkColorAccessors").Datum, rest: import("../stream/networkColorAccessors").Datum) => {
|
|
18
|
-
chartType: string;
|
|
19
|
-
data: import("./serverChartConfigShared").ServerChartData;
|
|
20
|
-
xAccessor: any;
|
|
21
|
-
yAccessor: any;
|
|
22
|
-
colorAccessor: import("./serverChartConfigShared").ServerAccessor | undefined;
|
|
23
|
-
sizeAccessor: any;
|
|
24
|
-
sizeRange: any;
|
|
25
|
-
colorScheme: import("./serverChartConfigShared").ServerColorScheme;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
15
|
+
BubbleChart: ChartConfig;
|
|
28
16
|
ConnectedScatterplot: ChartConfig;
|
|
29
17
|
QuadrantChart: ChartConfig;
|
|
30
18
|
Heatmap: ChartConfig;
|
|
19
|
+
TemporalHistogram: ChartConfig;
|
|
31
20
|
XYCustomChart: ChartConfig;
|
|
32
21
|
BarChart: ChartConfig;
|
|
33
22
|
StackedBarChart: ChartConfig;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type ChartConfig } from "./serverChartConfigShared";
|
|
2
|
+
export declare const bubbleChart: ChartConfig;
|
|
2
3
|
export declare const sparkline: ChartConfig;
|
|
3
4
|
export declare const lineChart: ChartConfig;
|
|
5
|
+
/** Static-data TemporalHistogram mapped onto the shared time-binned XY pipeline. */
|
|
6
|
+
export declare const temporalHistogram: ChartConfig;
|
|
4
7
|
export declare const areaChart: ChartConfig;
|
|
5
8
|
export declare const differenceChart: ChartConfig;
|
|
6
9
|
export declare const stackedAreaChart: ChartConfig;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
|
+
import type { ServerChartOverlayContext } from "./serverChartConfigShared";
|
|
4
|
+
export interface ServerGaugeDescriptor {
|
|
5
|
+
gMin: number;
|
|
6
|
+
gMax: number;
|
|
7
|
+
sweep: number;
|
|
8
|
+
value?: number;
|
|
9
|
+
startAngleDeg: number;
|
|
10
|
+
thresholds?: Array<{
|
|
11
|
+
value: number;
|
|
12
|
+
color: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
}>;
|
|
15
|
+
centerX: number;
|
|
16
|
+
centerY: number;
|
|
17
|
+
radius: number;
|
|
18
|
+
innerRadius: number;
|
|
19
|
+
showScaleLabels: boolean;
|
|
20
|
+
needleLength: number;
|
|
21
|
+
showNeedle: boolean;
|
|
22
|
+
needleColor?: string;
|
|
23
|
+
contextValue?: string;
|
|
24
|
+
contextValueY?: number;
|
|
25
|
+
valueFontSize?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Gauge-owned chrome rendered outside the ordinal scene (needle/readout/ticks). */
|
|
28
|
+
export declare function renderServerGaugeOverlay(frameProps: Datum, { theme }: ServerChartOverlayContext): React.ReactNode;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import type { SemioticTheme } from "../store/ThemeStore";
|
|
9
9
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
10
|
-
import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
|
|
10
|
+
import type { CategoricalLegendConfig, GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
|
|
11
11
|
interface LegendItemLayout {
|
|
12
12
|
category: string;
|
|
13
13
|
width: number;
|
|
@@ -45,15 +45,21 @@ export interface StaticLegendConfig {
|
|
|
45
45
|
hasTitle?: boolean;
|
|
46
46
|
/** SSR legend layout controls */
|
|
47
47
|
legendLayout?: LegendLayout;
|
|
48
|
+
/** Client <Legend> uses a stable 100px vertical placement box. */
|
|
49
|
+
reservedWidth?: number;
|
|
48
50
|
/** Optional id namespace used for generated SVG ids */
|
|
49
51
|
idPrefix?: string;
|
|
50
52
|
}
|
|
51
53
|
export interface StaticLegendGroupsConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
|
|
52
54
|
legendGroups: LegendGroup[];
|
|
55
|
+
/** Client <Legend> uses a stable 100px vertical placement box. */
|
|
56
|
+
reservedWidth?: number;
|
|
53
57
|
}
|
|
54
58
|
export interface StaticGradientLegendConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
|
|
55
59
|
gradient: GradientLegendConfig;
|
|
56
60
|
}
|
|
61
|
+
/** Build the same categorical config shape consumed by the live Legend. */
|
|
62
|
+
export declare function buildStaticCategoricalLegendConfig(categories: string[], colorScheme: string | string[] | Record<string, string> | undefined, theme: SemioticTheme): CategoricalLegendConfig | undefined;
|
|
57
63
|
export declare function measureStaticLegend(config: StaticLegendConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
|
|
58
64
|
export declare function measureStaticLegendGroups(config: StaticLegendGroupsConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
|
|
59
65
|
export declare function measureStaticGradientLegend(config: StaticGradientLegendConfig): {
|
|
@@ -11,6 +11,7 @@ import type { RenderEvidence } from "./renderEvidence";
|
|
|
11
11
|
import { resolveTheme, type ThemeInput } from "./themeResolver";
|
|
12
12
|
import type { SemioticTheme } from "../store/ThemeStore";
|
|
13
13
|
import * as React from "react";
|
|
14
|
+
import { type AxisExtentMode } from "../charts/shared/axisExtent";
|
|
14
15
|
export type FrameType = RenderEvidence["frameType"];
|
|
15
16
|
export type StaticPhysicsFrameProps = PhysicsSettledSVGOptions & {
|
|
16
17
|
config?: ConstructorParameters<typeof PhysicsPipelineStore>[0];
|
|
@@ -38,7 +39,32 @@ export interface ThemeAwareProps {
|
|
|
38
39
|
legendLayout?: LegendLayout;
|
|
39
40
|
/** Prefix for SVG element IDs — used by renderDashboard to avoid collisions */
|
|
40
41
|
_idPrefix?: string;
|
|
42
|
+
/** Internal HOC-level legend/margin contract metadata. */
|
|
43
|
+
__explicitMargin?: unknown;
|
|
44
|
+
__autoLegendMargin?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The supplied legend already contains the chart HOC's inferred groups.
|
|
47
|
+
* Specialized charts use this when their semantic categories cannot be
|
|
48
|
+
* reconstructed from the lower-level frame data (for example Likert's
|
|
49
|
+
* split neutral buckets). Caller legend groups may still be composed into
|
|
50
|
+
* that complete value by the chart config.
|
|
51
|
+
*/
|
|
52
|
+
__legendIncludesAutomatic?: boolean;
|
|
41
53
|
}
|
|
54
|
+
type LegendPosition = "right" | "left" | "top" | "bottom";
|
|
55
|
+
type StaticLegendHostProps = ThemeAwareProps & {
|
|
56
|
+
legend?: unknown;
|
|
57
|
+
colorScheme?: string | string[] | Record<string, string>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The client HOCs reserve a stable legend gutter before layout. The static
|
|
61
|
+
* frame API still uses content measurement by default, but renderChart()
|
|
62
|
+
* marks HOC requests so both paths share that contract. An explicitly set
|
|
63
|
+
* side remains fully caller-controlled.
|
|
64
|
+
*/
|
|
65
|
+
export declare function hocLegendMarginMinimum(props: ThemeAwareProps, position: LegendPosition): number | undefined;
|
|
66
|
+
/** Whether the caller, rather than the HOC default, owns a legend side. */
|
|
67
|
+
export declare function hasExplicitLegendMargin(props: ThemeAwareProps, position: LegendPosition): boolean;
|
|
42
68
|
export declare function reserveStaticLegendMargin(margin: {
|
|
43
69
|
top: number;
|
|
44
70
|
right: number;
|
|
@@ -52,6 +78,8 @@ export declare function reserveStaticLegendMargin(margin: {
|
|
|
52
78
|
size: [number, number];
|
|
53
79
|
hasTitle?: boolean;
|
|
54
80
|
legendLayout?: LegendLayout;
|
|
81
|
+
minimumMargin?: number;
|
|
82
|
+
preserveExplicitMargin?: boolean;
|
|
55
83
|
}): void;
|
|
56
84
|
export declare function reserveLegendConfigMargin(margin: {
|
|
57
85
|
top: number;
|
|
@@ -65,6 +93,8 @@ export declare function reserveLegendConfigMargin(margin: {
|
|
|
65
93
|
size: [number, number];
|
|
66
94
|
hasTitle?: boolean;
|
|
67
95
|
legendLayout?: LegendLayout;
|
|
96
|
+
minimumMargin?: number;
|
|
97
|
+
preserveExplicitMargin?: boolean;
|
|
68
98
|
}): void;
|
|
69
99
|
export declare function renderLegendConfig(legend: unknown, options: {
|
|
70
100
|
theme: ReturnType<typeof resolveTheme>;
|
|
@@ -79,15 +109,43 @@ export declare function renderLegendConfig(legend: unknown, options: {
|
|
|
79
109
|
hasTitle?: boolean;
|
|
80
110
|
legendLayout?: LegendLayout;
|
|
81
111
|
idPrefix?: string;
|
|
112
|
+
reservedWidth?: number;
|
|
113
|
+
}): React.ReactNode;
|
|
114
|
+
/** Reserve the plot gutter for either a supplied legend config or categories. */
|
|
115
|
+
export declare function reserveFrameLegendMargin(margin: {
|
|
116
|
+
top: number;
|
|
117
|
+
right: number;
|
|
118
|
+
bottom: number;
|
|
119
|
+
left: number;
|
|
120
|
+
}, options: {
|
|
121
|
+
props: StaticLegendHostProps;
|
|
122
|
+
categories: string[];
|
|
123
|
+
theme: ReturnType<typeof resolveTheme>;
|
|
124
|
+
size: [number, number];
|
|
125
|
+
hasTitle?: boolean;
|
|
126
|
+
}): LegendPosition;
|
|
127
|
+
/** Render caller-supplied or automatic categorical legends with one contract. */
|
|
128
|
+
export declare function renderFrameLegend(options: {
|
|
129
|
+
props: StaticLegendHostProps;
|
|
130
|
+
categories: string[];
|
|
131
|
+
theme: ReturnType<typeof resolveTheme>;
|
|
132
|
+
size: [number, number];
|
|
133
|
+
margin: {
|
|
134
|
+
top: number;
|
|
135
|
+
right: number;
|
|
136
|
+
bottom: number;
|
|
137
|
+
left: number;
|
|
138
|
+
};
|
|
139
|
+
hasTitle?: boolean;
|
|
82
140
|
}): React.ReactNode;
|
|
83
141
|
export declare function defaultTickFormat(v: number): string;
|
|
84
142
|
/** Render grid lines for XY charts */
|
|
85
|
-
export declare function renderGridSVG(scales: StreamScales, layout: StreamLayout, theme: SemioticTheme, idPrefix?: string): React.ReactNode;
|
|
143
|
+
export declare function renderGridSVG(scales: StreamScales, layout: StreamLayout, theme: SemioticTheme, idPrefix?: string, axisExtent?: AxisExtentMode): React.ReactNode;
|
|
86
144
|
/** Render grid lines for ordinal charts */
|
|
87
145
|
export declare function renderOrdinalGridSVG(store: OrdinalPipelineStore, layout: {
|
|
88
146
|
width: number;
|
|
89
147
|
height: number;
|
|
90
|
-
}, theme: SemioticTheme, idPrefix?: string): React.ReactNode;
|
|
148
|
+
}, theme: SemioticTheme, idPrefix?: string, axisExtent?: AxisExtentMode): React.ReactNode;
|
|
91
149
|
/** Wrap SVG content with accessibility attributes */
|
|
92
150
|
export declare function wrapSVG(content: React.ReactNode, opts: {
|
|
93
151
|
width: number;
|
|
@@ -154,6 +154,8 @@ export declare class GeoPipelineStore implements UpdateResultStore {
|
|
|
154
154
|
* (e.g., applyZoomScale), to avoid redundant scene builds.
|
|
155
155
|
*/
|
|
156
156
|
setRotation(rotation: [number, number, number]): void;
|
|
157
|
+
/** Whether a projection has been resolved by at least one scene compute. */
|
|
158
|
+
hasProjection(): boolean;
|
|
157
159
|
/** Get current rotation (for external tracking) */
|
|
158
160
|
getRotation(): [number, number, number];
|
|
159
161
|
/** Get the current base projection state (for zoom reset) */
|
|
@@ -51,6 +51,8 @@ interface GeoSVGOverlayProps {
|
|
|
51
51
|
y: number;
|
|
52
52
|
r: number;
|
|
53
53
|
}[];
|
|
54
|
+
/** Project geographic `[longitude, latitude]` annotation coordinates. */
|
|
55
|
+
geoProjection?: (longitude: number, latitude: number) => [number, number] | null;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* The SVG chrome used by StreamGeoFrame.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import * as React from "react";
|
|
19
19
|
import type { OrdinalScales } from "./ordinalTypes";
|
|
20
|
-
interface OrdinalBrushOverlayProps {
|
|
20
|
+
export interface OrdinalBrushOverlayProps {
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
23
|
totalWidth: number;
|
|
@@ -40,4 +40,3 @@ interface OrdinalBrushOverlayProps {
|
|
|
40
40
|
* In vertical projection, r maps to y-pixels → uses brushY.
|
|
41
41
|
*/
|
|
42
42
|
export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps): React.JSX.Element;
|
|
43
|
-
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy-loaded wrapper for OrdinalBrushOverlay.
|
|
3
|
+
*
|
|
4
|
+
* Same rationale as XYBrushOverlayLazy: d3-brush is only needed when brushing
|
|
5
|
+
* is enabled. Keep it off the default ordinal cold path (BarChart, PieChart…).
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import type { OrdinalBrushOverlayProps } from "./OrdinalBrushOverlay";
|
|
9
|
+
export declare function OrdinalBrushOverlayLazy(props: OrdinalBrushOverlayProps): React.JSX.Element | null;
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared module used by Stream Frames for SSR rendering and
|
|
5
5
|
* by semiotic/server for static SVG export.
|
|
6
|
+
*
|
|
7
|
+
* Network and geo serializers live in sibling modules
|
|
8
|
+
* (SceneToSVGNetwork.tsx / SceneToSVGGeo.tsx) and are re-exported below to
|
|
9
|
+
* keep this file under the file-size ratchet ceiling; low-level helpers
|
|
10
|
+
* shared across all three (svgFill, safeSvgId, glyphNodeToSVG, ARC_NOOP)
|
|
11
|
+
* live in sceneToSVGShared.tsx.
|
|
6
12
|
*/
|
|
7
13
|
import * as React from "react";
|
|
8
14
|
import type { SceneNode } from "./types";
|
|
9
|
-
import type { NetworkSceneNode, NetworkSceneEdge, NetworkLabel } from "./networkTypes";
|
|
10
15
|
import type { OrdinalSceneNode } from "./ordinalTypes";
|
|
11
|
-
|
|
16
|
+
export { networkSceneNodeToSVG, networkSceneEdgeToSVG, networkLabelToSVG } from "./SceneToSVGNetwork";
|
|
17
|
+
export { geoSceneNodeToSVG } from "./SceneToSVGGeo";
|
|
12
18
|
export declare function xySceneNodeToSVG(node: SceneNode, i: number, idPrefix?: string): React.ReactNode;
|
|
13
|
-
export declare function networkSceneNodeToSVG(node: NetworkSceneNode, i: number): React.ReactNode;
|
|
14
|
-
export declare function networkSceneEdgeToSVG(edge: NetworkSceneEdge, i: number): React.ReactNode;
|
|
15
|
-
export declare function networkLabelToSVG(label: NetworkLabel, i: number): React.ReactNode;
|
|
16
19
|
export declare function ordinalSceneNodeToSVG(node: OrdinalSceneNode, i: number, idPrefix?: string): React.ReactNode;
|
|
17
|
-
export declare function geoSceneNodeToSVG(node: GeoSceneNode, i: number): React.ReactNode;
|
|
18
20
|
/**
|
|
19
21
|
* Returns true when running in a true server/Node.js context where
|
|
20
22
|
* window and document are not available.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene graph → SVG element converters for the geo family.
|
|
3
|
+
*
|
|
4
|
+
* Split out of SceneToSVG.tsx (see scripts/file-size-policy.json) to keep
|
|
5
|
+
* that module under the file-size ratchet ceiling. Re-exported from
|
|
6
|
+
* SceneToSVG.tsx so existing imports are unaffected.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import type { GeoSceneNode } from "./geoTypes";
|
|
10
|
+
export declare function geoSceneNodeToSVG(node: GeoSceneNode, i: number): React.ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene graph → SVG element converters for the network family.
|
|
3
|
+
*
|
|
4
|
+
* Split out of SceneToSVG.tsx (see scripts/file-size-policy.json) to keep
|
|
5
|
+
* that module under the file-size ratchet ceiling. Re-exported from
|
|
6
|
+
* SceneToSVG.tsx so existing imports are unaffected.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import type { NetworkSceneNode, NetworkSceneEdge, NetworkLabel } from "./networkTypes";
|
|
10
|
+
export declare function networkSceneNodeToSVG(node: NetworkSceneNode, i: number): React.ReactNode;
|
|
11
|
+
export declare function networkSceneEdgeToSVG(edge: NetworkSceneEdge, i: number): React.ReactNode;
|
|
12
|
+
export declare function networkLabelToSVG(label: NetworkLabel, i: number): React.ReactNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy-loaded wrapper for XYBrushOverlay.
|
|
3
|
+
*
|
|
4
|
+
* d3-brush pulls d3-selection + d3-drag + d3-transition (~14 KB gz). Most XY
|
|
5
|
+
* charts never enable brushing, so keep that graph out of the default cold path
|
|
6
|
+
* and only load it when `brush` / `onBrush` is actually used.
|
|
7
|
+
*
|
|
8
|
+
* Pattern mirrors `statisticalOverlaysLazy.ts`.
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import type { XYBrushOverlayProps } from "./XYBrushOverlay";
|
|
12
|
+
/**
|
|
13
|
+
* Renders nothing until the brush module resolves, then mounts the real overlay.
|
|
14
|
+
* Acceptable: brush is interaction-driven; the first paint of the SVG layer can
|
|
15
|
+
* lag one tick without affecting chart layout or data marks.
|
|
16
|
+
*/
|
|
17
|
+
export declare function XYBrushOverlayLazy(props: XYBrushOverlayProps): React.JSX.Element | null;
|
|
@@ -17,6 +17,13 @@ export interface PaintCanvasBackgroundOptions {
|
|
|
17
17
|
width: number;
|
|
18
18
|
height: number;
|
|
19
19
|
}
|
|
20
|
+
export type CanvasBackgroundOptions = Pick<PaintCanvasBackgroundOptions, "background" | "hasBackgroundGraphics" | "themeBackground">;
|
|
21
|
+
/**
|
|
22
|
+
* Select the background token a canvas will attempt to paint. This is kept
|
|
23
|
+
* separate from the drawing operation so SVG layer composition can use the
|
|
24
|
+
* exact same visibility decision as the canvas renderer.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveCanvasBackground(options: CanvasBackgroundOptions): string | null;
|
|
20
27
|
/**
|
|
21
28
|
* Paint an opaque chart background when appropriate.
|
|
22
29
|
* Returns true if a fill was applied.
|
|
@@ -5,7 +5,7 @@ type NetworkDatumComparator = {
|
|
|
5
5
|
bivarianceHack(a: Datum, b: Datum): number;
|
|
6
6
|
}["bivarianceHack"];
|
|
7
7
|
type NetworkGroupComparator = (a: number, b: number) => number;
|
|
8
|
-
import type {
|
|
8
|
+
import type { LegendLayout, LegendValue } from "../types/legendTypes";
|
|
9
9
|
import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, ThemeSemanticColors, SceneDatum, SceneAccessibilityMetadata, SceneRenderMode } from "./types";
|
|
10
10
|
import type { AnimateProp } from "./pipelineTransitionUtils";
|
|
11
11
|
import type { NetworkSymbolName } from "./symbolPath";
|
|
@@ -616,9 +616,7 @@ export interface StreamNetworkFrameProps<T = Datum> extends StreamNetworkInterac
|
|
|
616
616
|
};
|
|
617
617
|
className?: string;
|
|
618
618
|
background?: string;
|
|
619
|
-
legend?:
|
|
620
|
-
legendGroups: LegendGroup[];
|
|
621
|
-
};
|
|
619
|
+
legend?: LegendValue;
|
|
622
620
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
623
621
|
legendLayout?: LegendLayout;
|
|
624
622
|
legendHoverBehavior?: (item: {
|