data-navigator 2.4.0 → 3.0.0
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/dist/chunk-7YO7HC2V.js +1 -0
- package/dist/chunk-EXUS2ZKK.js +1 -0
- package/dist/chunk-UNB4R2QN.js +1 -0
- package/dist/chunk-UZ7O3OBE.js +1 -0
- package/dist/chunk-XOJI42HR.js +1 -0
- package/dist/chunk-YWWPZKYP.js +1 -0
- package/dist/consts.cjs +1 -1
- package/dist/consts.js +1 -1
- package/dist/index.cjs +466 -68
- package/dist/index.d.cts +103 -2
- package/dist/index.d.ts +103 -2
- package/dist/index.js +453 -68
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/rendering.cjs +1 -1
- package/dist/rendering.js +1 -1
- package/dist/structure.cjs +1 -1
- package/dist/structure.js +1 -1
- package/dist/text-chat.cjs +10 -10
- package/dist/text-chat.js +1 -1
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.js +1 -1
- package/package.json +1 -1
- package/text-chat.css +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -23,6 +23,7 @@ type RenderingOptions = {
|
|
|
23
23
|
defaults?: RenderObject;
|
|
24
24
|
entryButton?: EntryObject;
|
|
25
25
|
exitElement?: ExitObject;
|
|
26
|
+
commandsElement?: CommandsObject;
|
|
26
27
|
};
|
|
27
28
|
type DimensionOptions = {
|
|
28
29
|
values: DimensionList;
|
|
@@ -156,6 +157,21 @@ type ExitObject = {
|
|
|
156
157
|
include: boolean;
|
|
157
158
|
callbacks?: ExitCallbacks;
|
|
158
159
|
};
|
|
160
|
+
type CommandsObject = {
|
|
161
|
+
include: boolean;
|
|
162
|
+
rootId?: string;
|
|
163
|
+
navigationRules?: NavigationRules;
|
|
164
|
+
commands?: Array<CommandObject> | ((genericCommands: Array<CommandObject>) => Array<CommandObject>);
|
|
165
|
+
columns?: Array<{
|
|
166
|
+
label: string;
|
|
167
|
+
id: string;
|
|
168
|
+
}>;
|
|
169
|
+
title?: string;
|
|
170
|
+
};
|
|
171
|
+
type CommandObject = {
|
|
172
|
+
label: string;
|
|
173
|
+
description: string;
|
|
174
|
+
};
|
|
159
175
|
type SemanticsObject = {
|
|
160
176
|
label?: DynamicString;
|
|
161
177
|
elementType?: DynamicString;
|
|
@@ -225,7 +241,7 @@ type DimensionId = string;
|
|
|
225
241
|
type DimensionKey = string;
|
|
226
242
|
type NodeToAddOrReference = NodeObject | NodeId;
|
|
227
243
|
type Direction = 'target' | 'source';
|
|
228
|
-
type RenderingStrategy = '
|
|
244
|
+
type RenderingStrategy = 'convexHull' | 'unionOfAll' | 'boundingRect' | 'custom';
|
|
229
245
|
type DimensionType = 'numerical' | 'categorical';
|
|
230
246
|
type ExtentType = 'circular' | 'terminal' | 'bridgedCousins' | 'bridgedCustom';
|
|
231
247
|
type ChildmostNavigationStrategy = 'within' | 'across';
|
|
@@ -255,6 +271,91 @@ type TextChatInstance = {
|
|
|
255
271
|
getCurrentNode: () => NodeObject | null;
|
|
256
272
|
};
|
|
257
273
|
|
|
274
|
+
/**
|
|
275
|
+
* geometry — Pure SVG path geometry utilities for data navigation group shapes.
|
|
276
|
+
*
|
|
277
|
+
* All functions are side-effect-free: input is arrays of Rect/Point objects,
|
|
278
|
+
* output is an SVG path `d` string ready to set on a <path d="..."> element.
|
|
279
|
+
*
|
|
280
|
+
* Exported from the data-navigator core library so downstream tools (e.g.
|
|
281
|
+
* the Skeleton scaffolding app) can import them, and they can be packaged
|
|
282
|
+
* independently in future export flows.
|
|
283
|
+
*/
|
|
284
|
+
type Rect = {
|
|
285
|
+
x: number;
|
|
286
|
+
y: number;
|
|
287
|
+
width: number;
|
|
288
|
+
height: number;
|
|
289
|
+
};
|
|
290
|
+
type Point = {
|
|
291
|
+
x: number;
|
|
292
|
+
y: number;
|
|
293
|
+
};
|
|
294
|
+
type Circle = Point & {
|
|
295
|
+
r: number;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Compute the convex hull of a set of 2-D points using the Graham scan
|
|
299
|
+
* algorithm. Returns the hull vertices in counter-clockwise order.
|
|
300
|
+
* Returns an empty array when fewer than 3 distinct points are supplied.
|
|
301
|
+
*/
|
|
302
|
+
declare function grahamScan(points: Point[]): Point[];
|
|
303
|
+
/**
|
|
304
|
+
* Convex hull of a set of points as a closed SVG path string.
|
|
305
|
+
* Returns empty string when fewer than 2 points are given.
|
|
306
|
+
*/
|
|
307
|
+
declare function convexHullPath(points: Point[]): string;
|
|
308
|
+
/**
|
|
309
|
+
* Expand a convex hull polygon outward from its centroid by `padPx` pixels.
|
|
310
|
+
* Each hull vertex is pushed radially away from the centroid.
|
|
311
|
+
*/
|
|
312
|
+
declare function expandHull(hullPoints: Point[], padPx: number): Point[];
|
|
313
|
+
/**
|
|
314
|
+
* Convex hull of a set of axis-aligned rectangles.
|
|
315
|
+
* Collects all 4 corners of every rect and runs Graham scan.
|
|
316
|
+
* Returns a closed SVG path string.
|
|
317
|
+
*/
|
|
318
|
+
declare function convexHullOfRects(rects: Rect[], padPx?: number): string;
|
|
319
|
+
/**
|
|
320
|
+
* Convert an array of rects into an SVG path containing one M…Z subpath per
|
|
321
|
+
* rect. This is a "true union" — non-overlapping marks each get their own
|
|
322
|
+
* outlined region. SVG fill-rule handles interior fill for all subpaths.
|
|
323
|
+
*
|
|
324
|
+
* @param padPx Optional padding added to every rect before generating paths.
|
|
325
|
+
*/
|
|
326
|
+
declare function unionOfRectPaths(rects: Rect[], padPx?: number): string;
|
|
327
|
+
/**
|
|
328
|
+
* Single axis-aligned bounding rect enclosing all input rects.
|
|
329
|
+
* Returns a closed SVG path string (one M…Z rectangle).
|
|
330
|
+
*
|
|
331
|
+
* @param padPx Optional outward padding added to the resulting bounding box.
|
|
332
|
+
*/
|
|
333
|
+
declare function boundingRectPath(rects: Rect[], padPx?: number): string;
|
|
334
|
+
/**
|
|
335
|
+
* Convex hull of a set of circles.
|
|
336
|
+
* Each circle is approximated by 16 sample points on its circumference before
|
|
337
|
+
* running Graham scan. The result is a polygon that is tangent (or very close)
|
|
338
|
+
* to the outer boundary of all circles.
|
|
339
|
+
*
|
|
340
|
+
* Used for scatter plots and line-chart interval groupings where marks are
|
|
341
|
+
* circular (not rectangular).
|
|
342
|
+
*/
|
|
343
|
+
declare function convexHullOfCircles(circles: Circle[], padPx?: number): string;
|
|
344
|
+
/**
|
|
345
|
+
* Create a "fat" closed path around a polyline by tracing it at ±offsetPx
|
|
346
|
+
* using perpendicular offsets at each segment.
|
|
347
|
+
*
|
|
348
|
+
* The result is a single closed SVG path that looks like the line rendered
|
|
349
|
+
* with a stroke of width `offsetPx * 2`. Ideal for line-chart series grouping.
|
|
350
|
+
*
|
|
351
|
+
* @param points Ordered control points of the polyline (left to right).
|
|
352
|
+
* @param offsetPx Half-width of the resulting fat path.
|
|
353
|
+
*/
|
|
354
|
+
declare function offsetLinePath(points: Point[], offsetPx: number): string;
|
|
355
|
+
|
|
356
|
+
declare const describeNode: (d: DatumObject, descriptionOptions?: DescriptionOptions) => string;
|
|
357
|
+
declare const createValidId: (s: string) => string;
|
|
358
|
+
|
|
258
359
|
declare const _default: {
|
|
259
360
|
structure: (options: StructureOptions) => Structure;
|
|
260
361
|
input: (options: InputOptions) => any;
|
|
@@ -262,4 +363,4 @@ declare const _default: {
|
|
|
262
363
|
textChat: (options: TextChatOptions) => TextChatInstance;
|
|
263
364
|
};
|
|
264
365
|
|
|
265
|
-
export { type AddOrReferenceNodeList, type AdjustingFunction, type Attributes, type AttributesObject, type ChildmostMatchingStrategy, type ChildmostNavigationStrategy, type ConditionalFunction, type DataType, type DatumObject, type DerivedNode, type DescriptionOptions, type DimensionBehavior, type DimensionDatum, type DimensionDivisions, type DimensionId, type DimensionKey, type DimensionLevel, type DimensionList, type DimensionNavigationPair, type DimensionNavigationRules, type DimensionObject, type DimensionOperations, type DimensionOptions, type DimensionType, type Dimensions, type Direction, type DivisionObject, type DivisionOptions, type DynamicDimensionId, type DynamicDimensionRenderId, type DynamicNodeId, type DynamicNodeIdKey, type DynamicNumber, type DynamicRenderId, type DynamicRenderIdKey, type DynamicString, type EdgeDatum, type EdgeId, type EdgeList, type EdgeObject, type EdgeOptions, type Edges, type ElementData, type EntryCallbacks, type EntryObject, type ExistingElement, type ExitCallbacks, type ExitObject, type ExtentType, type FilteringFunction, type GenericDataset, type InputOptions, type KeyList, type LLMMessage, type Level0ExtentType, type Level1Behavior, type NavId, type NavObject, type NavigationList, type NavigationRules, type NodeId, type NodeObject, type NodeToAddOrReference, type Nodes, type NumericalExtentsPair, type NumericallySubdivide, type RenderId, type RenderObject, type RenderingOptions, type RenderingStrategy, type RootObject, type Semantics, type SemanticsObject, type SortingFunction, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, _default as default };
|
|
366
|
+
export { type AddOrReferenceNodeList, type AdjustingFunction, type Attributes, type AttributesObject, type ChildmostMatchingStrategy, type ChildmostNavigationStrategy, type Circle, type CommandObject, type CommandsObject, type ConditionalFunction, type DataType, type DatumObject, type DerivedNode, type DescriptionOptions, type DimensionBehavior, type DimensionDatum, type DimensionDivisions, type DimensionId, type DimensionKey, type DimensionLevel, type DimensionList, type DimensionNavigationPair, type DimensionNavigationRules, type DimensionObject, type DimensionOperations, type DimensionOptions, type DimensionType, type Dimensions, type Direction, type DivisionObject, type DivisionOptions, type DynamicDimensionId, type DynamicDimensionRenderId, type DynamicNodeId, type DynamicNodeIdKey, type DynamicNumber, type DynamicRenderId, type DynamicRenderIdKey, type DynamicString, type EdgeDatum, type EdgeId, type EdgeList, type EdgeObject, type EdgeOptions, type Edges, type ElementData, type EntryCallbacks, type EntryObject, type ExistingElement, type ExitCallbacks, type ExitObject, type ExtentType, type FilteringFunction, type GenericDataset, type InputOptions, type KeyList, type LLMMessage, type Level0ExtentType, type Level1Behavior, type NavId, type NavObject, type NavigationList, type NavigationRules, type NodeId, type NodeObject, type NodeToAddOrReference, type Nodes, type NumericalExtentsPair, type NumericallySubdivide, type Point, type Rect, type RenderId, type RenderObject, type RenderingOptions, type RenderingStrategy, type RootObject, type Semantics, type SemanticsObject, type SortingFunction, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, boundingRectPath, convexHullOfCircles, convexHullOfRects, convexHullPath, createValidId, _default as default, describeNode, expandHull, grahamScan, offsetLinePath, unionOfRectPaths };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ type RenderingOptions = {
|
|
|
23
23
|
defaults?: RenderObject;
|
|
24
24
|
entryButton?: EntryObject;
|
|
25
25
|
exitElement?: ExitObject;
|
|
26
|
+
commandsElement?: CommandsObject;
|
|
26
27
|
};
|
|
27
28
|
type DimensionOptions = {
|
|
28
29
|
values: DimensionList;
|
|
@@ -156,6 +157,21 @@ type ExitObject = {
|
|
|
156
157
|
include: boolean;
|
|
157
158
|
callbacks?: ExitCallbacks;
|
|
158
159
|
};
|
|
160
|
+
type CommandsObject = {
|
|
161
|
+
include: boolean;
|
|
162
|
+
rootId?: string;
|
|
163
|
+
navigationRules?: NavigationRules;
|
|
164
|
+
commands?: Array<CommandObject> | ((genericCommands: Array<CommandObject>) => Array<CommandObject>);
|
|
165
|
+
columns?: Array<{
|
|
166
|
+
label: string;
|
|
167
|
+
id: string;
|
|
168
|
+
}>;
|
|
169
|
+
title?: string;
|
|
170
|
+
};
|
|
171
|
+
type CommandObject = {
|
|
172
|
+
label: string;
|
|
173
|
+
description: string;
|
|
174
|
+
};
|
|
159
175
|
type SemanticsObject = {
|
|
160
176
|
label?: DynamicString;
|
|
161
177
|
elementType?: DynamicString;
|
|
@@ -225,7 +241,7 @@ type DimensionId = string;
|
|
|
225
241
|
type DimensionKey = string;
|
|
226
242
|
type NodeToAddOrReference = NodeObject | NodeId;
|
|
227
243
|
type Direction = 'target' | 'source';
|
|
228
|
-
type RenderingStrategy = '
|
|
244
|
+
type RenderingStrategy = 'convexHull' | 'unionOfAll' | 'boundingRect' | 'custom';
|
|
229
245
|
type DimensionType = 'numerical' | 'categorical';
|
|
230
246
|
type ExtentType = 'circular' | 'terminal' | 'bridgedCousins' | 'bridgedCustom';
|
|
231
247
|
type ChildmostNavigationStrategy = 'within' | 'across';
|
|
@@ -255,6 +271,91 @@ type TextChatInstance = {
|
|
|
255
271
|
getCurrentNode: () => NodeObject | null;
|
|
256
272
|
};
|
|
257
273
|
|
|
274
|
+
/**
|
|
275
|
+
* geometry — Pure SVG path geometry utilities for data navigation group shapes.
|
|
276
|
+
*
|
|
277
|
+
* All functions are side-effect-free: input is arrays of Rect/Point objects,
|
|
278
|
+
* output is an SVG path `d` string ready to set on a <path d="..."> element.
|
|
279
|
+
*
|
|
280
|
+
* Exported from the data-navigator core library so downstream tools (e.g.
|
|
281
|
+
* the Skeleton scaffolding app) can import them, and they can be packaged
|
|
282
|
+
* independently in future export flows.
|
|
283
|
+
*/
|
|
284
|
+
type Rect = {
|
|
285
|
+
x: number;
|
|
286
|
+
y: number;
|
|
287
|
+
width: number;
|
|
288
|
+
height: number;
|
|
289
|
+
};
|
|
290
|
+
type Point = {
|
|
291
|
+
x: number;
|
|
292
|
+
y: number;
|
|
293
|
+
};
|
|
294
|
+
type Circle = Point & {
|
|
295
|
+
r: number;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Compute the convex hull of a set of 2-D points using the Graham scan
|
|
299
|
+
* algorithm. Returns the hull vertices in counter-clockwise order.
|
|
300
|
+
* Returns an empty array when fewer than 3 distinct points are supplied.
|
|
301
|
+
*/
|
|
302
|
+
declare function grahamScan(points: Point[]): Point[];
|
|
303
|
+
/**
|
|
304
|
+
* Convex hull of a set of points as a closed SVG path string.
|
|
305
|
+
* Returns empty string when fewer than 2 points are given.
|
|
306
|
+
*/
|
|
307
|
+
declare function convexHullPath(points: Point[]): string;
|
|
308
|
+
/**
|
|
309
|
+
* Expand a convex hull polygon outward from its centroid by `padPx` pixels.
|
|
310
|
+
* Each hull vertex is pushed radially away from the centroid.
|
|
311
|
+
*/
|
|
312
|
+
declare function expandHull(hullPoints: Point[], padPx: number): Point[];
|
|
313
|
+
/**
|
|
314
|
+
* Convex hull of a set of axis-aligned rectangles.
|
|
315
|
+
* Collects all 4 corners of every rect and runs Graham scan.
|
|
316
|
+
* Returns a closed SVG path string.
|
|
317
|
+
*/
|
|
318
|
+
declare function convexHullOfRects(rects: Rect[], padPx?: number): string;
|
|
319
|
+
/**
|
|
320
|
+
* Convert an array of rects into an SVG path containing one M…Z subpath per
|
|
321
|
+
* rect. This is a "true union" — non-overlapping marks each get their own
|
|
322
|
+
* outlined region. SVG fill-rule handles interior fill for all subpaths.
|
|
323
|
+
*
|
|
324
|
+
* @param padPx Optional padding added to every rect before generating paths.
|
|
325
|
+
*/
|
|
326
|
+
declare function unionOfRectPaths(rects: Rect[], padPx?: number): string;
|
|
327
|
+
/**
|
|
328
|
+
* Single axis-aligned bounding rect enclosing all input rects.
|
|
329
|
+
* Returns a closed SVG path string (one M…Z rectangle).
|
|
330
|
+
*
|
|
331
|
+
* @param padPx Optional outward padding added to the resulting bounding box.
|
|
332
|
+
*/
|
|
333
|
+
declare function boundingRectPath(rects: Rect[], padPx?: number): string;
|
|
334
|
+
/**
|
|
335
|
+
* Convex hull of a set of circles.
|
|
336
|
+
* Each circle is approximated by 16 sample points on its circumference before
|
|
337
|
+
* running Graham scan. The result is a polygon that is tangent (or very close)
|
|
338
|
+
* to the outer boundary of all circles.
|
|
339
|
+
*
|
|
340
|
+
* Used for scatter plots and line-chart interval groupings where marks are
|
|
341
|
+
* circular (not rectangular).
|
|
342
|
+
*/
|
|
343
|
+
declare function convexHullOfCircles(circles: Circle[], padPx?: number): string;
|
|
344
|
+
/**
|
|
345
|
+
* Create a "fat" closed path around a polyline by tracing it at ±offsetPx
|
|
346
|
+
* using perpendicular offsets at each segment.
|
|
347
|
+
*
|
|
348
|
+
* The result is a single closed SVG path that looks like the line rendered
|
|
349
|
+
* with a stroke of width `offsetPx * 2`. Ideal for line-chart series grouping.
|
|
350
|
+
*
|
|
351
|
+
* @param points Ordered control points of the polyline (left to right).
|
|
352
|
+
* @param offsetPx Half-width of the resulting fat path.
|
|
353
|
+
*/
|
|
354
|
+
declare function offsetLinePath(points: Point[], offsetPx: number): string;
|
|
355
|
+
|
|
356
|
+
declare const describeNode: (d: DatumObject, descriptionOptions?: DescriptionOptions) => string;
|
|
357
|
+
declare const createValidId: (s: string) => string;
|
|
358
|
+
|
|
258
359
|
declare const _default: {
|
|
259
360
|
structure: (options: StructureOptions) => Structure;
|
|
260
361
|
input: (options: InputOptions) => any;
|
|
@@ -262,4 +363,4 @@ declare const _default: {
|
|
|
262
363
|
textChat: (options: TextChatOptions) => TextChatInstance;
|
|
263
364
|
};
|
|
264
365
|
|
|
265
|
-
export { type AddOrReferenceNodeList, type AdjustingFunction, type Attributes, type AttributesObject, type ChildmostMatchingStrategy, type ChildmostNavigationStrategy, type ConditionalFunction, type DataType, type DatumObject, type DerivedNode, type DescriptionOptions, type DimensionBehavior, type DimensionDatum, type DimensionDivisions, type DimensionId, type DimensionKey, type DimensionLevel, type DimensionList, type DimensionNavigationPair, type DimensionNavigationRules, type DimensionObject, type DimensionOperations, type DimensionOptions, type DimensionType, type Dimensions, type Direction, type DivisionObject, type DivisionOptions, type DynamicDimensionId, type DynamicDimensionRenderId, type DynamicNodeId, type DynamicNodeIdKey, type DynamicNumber, type DynamicRenderId, type DynamicRenderIdKey, type DynamicString, type EdgeDatum, type EdgeId, type EdgeList, type EdgeObject, type EdgeOptions, type Edges, type ElementData, type EntryCallbacks, type EntryObject, type ExistingElement, type ExitCallbacks, type ExitObject, type ExtentType, type FilteringFunction, type GenericDataset, type InputOptions, type KeyList, type LLMMessage, type Level0ExtentType, type Level1Behavior, type NavId, type NavObject, type NavigationList, type NavigationRules, type NodeId, type NodeObject, type NodeToAddOrReference, type Nodes, type NumericalExtentsPair, type NumericallySubdivide, type RenderId, type RenderObject, type RenderingOptions, type RenderingStrategy, type RootObject, type Semantics, type SemanticsObject, type SortingFunction, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, _default as default };
|
|
366
|
+
export { type AddOrReferenceNodeList, type AdjustingFunction, type Attributes, type AttributesObject, type ChildmostMatchingStrategy, type ChildmostNavigationStrategy, type Circle, type CommandObject, type CommandsObject, type ConditionalFunction, type DataType, type DatumObject, type DerivedNode, type DescriptionOptions, type DimensionBehavior, type DimensionDatum, type DimensionDivisions, type DimensionId, type DimensionKey, type DimensionLevel, type DimensionList, type DimensionNavigationPair, type DimensionNavigationRules, type DimensionObject, type DimensionOperations, type DimensionOptions, type DimensionType, type Dimensions, type Direction, type DivisionObject, type DivisionOptions, type DynamicDimensionId, type DynamicDimensionRenderId, type DynamicNodeId, type DynamicNodeIdKey, type DynamicNumber, type DynamicRenderId, type DynamicRenderIdKey, type DynamicString, type EdgeDatum, type EdgeId, type EdgeList, type EdgeObject, type EdgeOptions, type Edges, type ElementData, type EntryCallbacks, type EntryObject, type ExistingElement, type ExitCallbacks, type ExitObject, type ExtentType, type FilteringFunction, type GenericDataset, type InputOptions, type KeyList, type LLMMessage, type Level0ExtentType, type Level1Behavior, type NavId, type NavObject, type NavigationList, type NavigationRules, type NodeId, type NodeObject, type NodeToAddOrReference, type Nodes, type NumericalExtentsPair, type NumericallySubdivide, type Point, type Rect, type RenderId, type RenderObject, type RenderingOptions, type RenderingStrategy, type RootObject, type Semantics, type SemanticsObject, type SortingFunction, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, boundingRectPath, convexHullOfCircles, convexHullOfRects, convexHullPath, createValidId, _default as default, describeNode, expandHull, grahamScan, offsetLinePath, unionOfRectPaths };
|