@infinit-canvas/react 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/types.d.ts +23 -2
package/package.json
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -243,6 +243,22 @@ export interface Card {
|
|
|
243
243
|
|
|
244
244
|
// ─── Component Props ─────────────────────────────────────────────
|
|
245
245
|
|
|
246
|
+
export interface CanvasNodeConfig {
|
|
247
|
+
fill?: string;
|
|
248
|
+
stroke?: string;
|
|
249
|
+
strokeWidth?: number;
|
|
250
|
+
radius?: number;
|
|
251
|
+
shadow?: boolean;
|
|
252
|
+
shadowColor?: string;
|
|
253
|
+
shadowBlur?: number;
|
|
254
|
+
shadowOffsetY?: number;
|
|
255
|
+
accent?: { side?: 'left' | 'right' | 'top' | 'bottom'; width?: number; color?: string };
|
|
256
|
+
icon?: { dataField?: string; text?: string; x?: number; y?: number; size?: number; color?: string };
|
|
257
|
+
title?: { dataField?: string; text?: string; x?: number; y?: number; font?: string; color?: string; align?: string };
|
|
258
|
+
subtitle?: { dataField?: string; text?: string; x?: number; y?: number; font?: string; color?: string; align?: string };
|
|
259
|
+
badge?: { dataField?: string; text?: string; bg?: string; color?: string; font?: string; radius?: number; paddingX?: number; paddingY?: number };
|
|
260
|
+
}
|
|
261
|
+
|
|
246
262
|
export interface InfiniteCanvasProps {
|
|
247
263
|
// Data
|
|
248
264
|
cards?: Card[];
|
|
@@ -252,8 +268,13 @@ export interface InfiniteCanvasProps {
|
|
|
252
268
|
// Custom types
|
|
253
269
|
nodeTypes?: NodeTypes;
|
|
254
270
|
edgeTypes?: EdgeTypes;
|
|
255
|
-
/** Canvas-rendered
|
|
256
|
-
|
|
271
|
+
/** Canvas-rendered custom nodes per type. Accepts:
|
|
272
|
+
* - SVG string: converted to ImageBitmap, drawn via drawImage
|
|
273
|
+
* - HTMLImageElement / HTMLCanvasElement / ImageBitmap: drawn via drawImage
|
|
274
|
+
* - Function `(data) => svgString`: per-node bitmap with caching
|
|
275
|
+
* - Config object: declarative style { fill, stroke, radius, accent, icon, title, subtitle, badge }
|
|
276
|
+
*/
|
|
277
|
+
canvasNodeTypes?: Record<string, string | ImageBitmap | HTMLImageElement | HTMLCanvasElement | CanvasNodeConfig | ((data: Record<string, any>) => string)>;
|
|
257
278
|
|
|
258
279
|
// Appearance
|
|
259
280
|
dark?: boolean;
|