data-navigator 3.0.0 → 3.2.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/index.d.cts CHANGED
@@ -9,6 +9,61 @@ type StructureOptions = {
9
9
  addIds?: boolean;
10
10
  keysForIdGeneration?: KeyList;
11
11
  navigationRules?: NavigationRules;
12
+ frame?: FrameOptions;
13
+ spatialGrid?: SpatialGridOptions;
14
+ hierarchy?: HierarchyOptions;
15
+ };
16
+ type FrameOptions = {
17
+ root: NodeObject;
18
+ elements: Array<NodeObject>;
19
+ data?: NodeObject;
20
+ behavior?: {
21
+ extents: 'circular' | 'terminal';
22
+ };
23
+ navigationRules?: DimensionNavigationRules;
24
+ };
25
+ type FrameInfo = {
26
+ rootId: NodeId;
27
+ elementIds: Array<NodeId>;
28
+ dataId: NodeId;
29
+ parentRules: DimensionNavigationPair;
30
+ };
31
+ type SpatialGridOptions = {
32
+ xKey: string;
33
+ yKey: string;
34
+ xExtent?: NumericalExtentsPair;
35
+ yExtent?: NumericalExtentsPair;
36
+ levels: Array<number>;
37
+ leaves?: 'points' | 'cells';
38
+ levelNavigation?: 'across' | 'within';
39
+ skipEmpty?: boolean;
40
+ extents?: 'terminal' | 'circular';
41
+ root?: NodeObject;
42
+ cellIds?: (level: number, col: number, row: number) => NodeId;
43
+ navigationRules?: {
44
+ x?: DimensionNavigationPair;
45
+ y?: DimensionNavigationPair;
46
+ parent_child?: DimensionNavigationPair;
47
+ };
48
+ };
49
+ type SpatialGridInfo = {
50
+ rootId: NodeId;
51
+ levels: Array<number>;
52
+ cellsByLevel: Array<Array<NodeId>>;
53
+ leafIds: Array<NodeId>;
54
+ parentRules: DimensionNavigationPair;
55
+ };
56
+ type HierarchyOptions = {
57
+ parentKey: string;
58
+ sortFunction?: SortingFunction;
59
+ levelNavigation?: 'within' | 'across';
60
+ extents?: 'circular' | 'terminal';
61
+ navigationRules?: DimensionNavigationRules;
62
+ };
63
+ type HierarchyInfo = {
64
+ rootId: NodeId;
65
+ depthCount: number;
66
+ parentRules: DimensionNavigationPair;
12
67
  };
13
68
  type InputOptions = {
14
69
  structure: Structure;
@@ -43,6 +98,9 @@ type Structure = {
43
98
  dimensions?: Dimensions;
44
99
  navigationRules?: NavigationRules;
45
100
  elementData?: ElementData;
101
+ frame?: FrameInfo;
102
+ spatialGrid?: SpatialGridInfo;
103
+ hierarchy?: HierarchyInfo;
46
104
  };
47
105
  type Nodes = Record<NodeId, NodeObject>;
48
106
  type Edges = Record<EdgeId, EdgeObject>;
@@ -69,6 +127,9 @@ type NodeObject = {
69
127
  renderingStrategy?: RenderingStrategy;
70
128
  derivedNode?: DerivedNode;
71
129
  dimensionLevel?: DimensionLevel;
130
+ parentId?: NodeId;
131
+ depth?: number;
132
+ frameRole?: 'root' | 'element' | 'data';
72
133
  [key: string | number]: any;
73
134
  };
74
135
  type EdgeObject = {
@@ -162,6 +223,7 @@ type CommandsObject = {
162
223
  rootId?: string;
163
224
  navigationRules?: NavigationRules;
164
225
  commands?: Array<CommandObject> | ((genericCommands: Array<CommandObject>) => Array<CommandObject>);
226
+ descriptions?: Record<NavId, string>;
165
227
  columns?: Array<{
166
228
  label: string;
167
229
  id: string;
@@ -171,6 +233,8 @@ type CommandsObject = {
171
233
  type CommandObject = {
172
234
  label: string;
173
235
  description: string;
236
+ command?: NavId;
237
+ [key: string]: any;
174
238
  };
175
239
  type SemanticsObject = {
176
240
  label?: DynamicString;
@@ -355,6 +419,8 @@ declare function offsetLinePath(points: Point[], offsetPx: number): string;
355
419
 
356
420
  declare const describeNode: (d: DatumObject, descriptionOptions?: DescriptionOptions) => string;
357
421
  declare const createValidId: (s: string) => string;
422
+ declare const keyLabel: (code?: string) => string;
423
+ declare function getGenericCommandsFromNavRules(navigationRules?: NavigationRules, descriptions?: Record<NavId, string>): CommandObject[];
358
424
 
359
425
  declare const _default: {
360
426
  structure: (options: StructureOptions) => Structure;
@@ -363,4 +429,4 @@ declare const _default: {
363
429
  textChat: (options: TextChatOptions) => TextChatInstance;
364
430
  };
365
431
 
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 };
432
+ 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 FrameInfo, type FrameOptions, type GenericDataset, type HierarchyInfo, type HierarchyOptions, 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 SpatialGridInfo, type SpatialGridOptions, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, boundingRectPath, convexHullOfCircles, convexHullOfRects, convexHullPath, createValidId, _default as default, describeNode, expandHull, getGenericCommandsFromNavRules, grahamScan, keyLabel, offsetLinePath, unionOfRectPaths };
package/dist/index.d.ts CHANGED
@@ -9,6 +9,61 @@ type StructureOptions = {
9
9
  addIds?: boolean;
10
10
  keysForIdGeneration?: KeyList;
11
11
  navigationRules?: NavigationRules;
12
+ frame?: FrameOptions;
13
+ spatialGrid?: SpatialGridOptions;
14
+ hierarchy?: HierarchyOptions;
15
+ };
16
+ type FrameOptions = {
17
+ root: NodeObject;
18
+ elements: Array<NodeObject>;
19
+ data?: NodeObject;
20
+ behavior?: {
21
+ extents: 'circular' | 'terminal';
22
+ };
23
+ navigationRules?: DimensionNavigationRules;
24
+ };
25
+ type FrameInfo = {
26
+ rootId: NodeId;
27
+ elementIds: Array<NodeId>;
28
+ dataId: NodeId;
29
+ parentRules: DimensionNavigationPair;
30
+ };
31
+ type SpatialGridOptions = {
32
+ xKey: string;
33
+ yKey: string;
34
+ xExtent?: NumericalExtentsPair;
35
+ yExtent?: NumericalExtentsPair;
36
+ levels: Array<number>;
37
+ leaves?: 'points' | 'cells';
38
+ levelNavigation?: 'across' | 'within';
39
+ skipEmpty?: boolean;
40
+ extents?: 'terminal' | 'circular';
41
+ root?: NodeObject;
42
+ cellIds?: (level: number, col: number, row: number) => NodeId;
43
+ navigationRules?: {
44
+ x?: DimensionNavigationPair;
45
+ y?: DimensionNavigationPair;
46
+ parent_child?: DimensionNavigationPair;
47
+ };
48
+ };
49
+ type SpatialGridInfo = {
50
+ rootId: NodeId;
51
+ levels: Array<number>;
52
+ cellsByLevel: Array<Array<NodeId>>;
53
+ leafIds: Array<NodeId>;
54
+ parentRules: DimensionNavigationPair;
55
+ };
56
+ type HierarchyOptions = {
57
+ parentKey: string;
58
+ sortFunction?: SortingFunction;
59
+ levelNavigation?: 'within' | 'across';
60
+ extents?: 'circular' | 'terminal';
61
+ navigationRules?: DimensionNavigationRules;
62
+ };
63
+ type HierarchyInfo = {
64
+ rootId: NodeId;
65
+ depthCount: number;
66
+ parentRules: DimensionNavigationPair;
12
67
  };
13
68
  type InputOptions = {
14
69
  structure: Structure;
@@ -43,6 +98,9 @@ type Structure = {
43
98
  dimensions?: Dimensions;
44
99
  navigationRules?: NavigationRules;
45
100
  elementData?: ElementData;
101
+ frame?: FrameInfo;
102
+ spatialGrid?: SpatialGridInfo;
103
+ hierarchy?: HierarchyInfo;
46
104
  };
47
105
  type Nodes = Record<NodeId, NodeObject>;
48
106
  type Edges = Record<EdgeId, EdgeObject>;
@@ -69,6 +127,9 @@ type NodeObject = {
69
127
  renderingStrategy?: RenderingStrategy;
70
128
  derivedNode?: DerivedNode;
71
129
  dimensionLevel?: DimensionLevel;
130
+ parentId?: NodeId;
131
+ depth?: number;
132
+ frameRole?: 'root' | 'element' | 'data';
72
133
  [key: string | number]: any;
73
134
  };
74
135
  type EdgeObject = {
@@ -162,6 +223,7 @@ type CommandsObject = {
162
223
  rootId?: string;
163
224
  navigationRules?: NavigationRules;
164
225
  commands?: Array<CommandObject> | ((genericCommands: Array<CommandObject>) => Array<CommandObject>);
226
+ descriptions?: Record<NavId, string>;
165
227
  columns?: Array<{
166
228
  label: string;
167
229
  id: string;
@@ -171,6 +233,8 @@ type CommandsObject = {
171
233
  type CommandObject = {
172
234
  label: string;
173
235
  description: string;
236
+ command?: NavId;
237
+ [key: string]: any;
174
238
  };
175
239
  type SemanticsObject = {
176
240
  label?: DynamicString;
@@ -355,6 +419,8 @@ declare function offsetLinePath(points: Point[], offsetPx: number): string;
355
419
 
356
420
  declare const describeNode: (d: DatumObject, descriptionOptions?: DescriptionOptions) => string;
357
421
  declare const createValidId: (s: string) => string;
422
+ declare const keyLabel: (code?: string) => string;
423
+ declare function getGenericCommandsFromNavRules(navigationRules?: NavigationRules, descriptions?: Record<NavId, string>): CommandObject[];
358
424
 
359
425
  declare const _default: {
360
426
  structure: (options: StructureOptions) => Structure;
@@ -363,4 +429,4 @@ declare const _default: {
363
429
  textChat: (options: TextChatOptions) => TextChatInstance;
364
430
  };
365
431
 
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 };
432
+ 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 FrameInfo, type FrameOptions, type GenericDataset, type HierarchyInfo, type HierarchyOptions, 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 SpatialGridInfo, type SpatialGridOptions, type SpatialObject, type SpatialProperties, type Structure, type StructureOptions, type TextChatInstance, type TextChatOptions, boundingRectPath, convexHullOfCircles, convexHullOfRects, convexHullPath, createValidId, _default as default, describeNode, expandHull, getGenericCommandsFromNavRules, grahamScan, keyLabel, offsetLinePath, unionOfRectPaths };