data-navigator 1.2.1 → 1.2.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/README.md CHANGED
@@ -40,15 +40,40 @@ npm install data-navigator
40
40
  ```
41
41
 
42
42
  ```js
43
- // to use it in a .js or .ts file
44
- import { default as dataNavigator } from 'data-navigator';
45
- console.log(dataNavigator);
43
+ // to use it in a .js file
44
+ import { default as dataNavigator } from "data-navigator"
45
+ import rendering from "./node_modules/data-navigator/dist/rendering"
46
+
47
+ // whole ecosystem
48
+ console.log("dataNavigator", dataNavigator)
49
+
50
+ // module within the ecosystem
51
+ console.log("dataNavigator.rendering", dataNavigator.rendering)
52
+
53
+ // just one module
54
+ console.log("rendering", rendering)
55
+ ```
56
+
57
+ ```ts
58
+ // to use it in a .ts file
59
+ import { default as dataNavigator } from "./node_modules/data-navigator/dist"
60
+ import rendering from "./node_modules/data-navigator/dist/rendering"
61
+
62
+ // whole ecosystem
63
+ console.log("dataNavigator", dataNavigator)
64
+
65
+ // module within the ecosystem
66
+ console.log("dataNavigator.rendering", dataNavigator.rendering)
67
+
68
+ // just one module
69
+ console.log("rendering", rendering)
46
70
  ```
47
71
 
48
72
  ```html
49
73
  <!-- and even as a script tag module loaded from a cdn -->
50
74
  <script type="module">
51
- import dataNavigator from 'https://cdn.jsdelivr.net/npm/data-navigator@1.0.0/dist/index.mjs';
75
+ // pay attention to the version! the latest may be higher than this example
76
+ import dataNavigator from 'https://cdn.jsdelivr.net/npm/data-navigator@1.2.3/dist/index.mjs';
52
77
  console.log(dataNavigator);
53
78
  </script>
54
79
  ```
@@ -1,142 +1,112 @@
1
- // StructureOptions is still under development!
2
- // Our next major step is to build functions to automatically produce Structure
3
1
  type StructureOptions = {
4
- [key: string | number]: any
5
- }
6
-
2
+ [key: string | number]: any;
3
+ };
7
4
  type InputOptions = {
8
- structure: Structure,
9
- navigationRules: NavigationRules,
10
- entryPoint?: NodeId,
11
- exitPoint?: RenderId
12
- }
13
-
5
+ structure: Structure;
6
+ navigationRules: NavigationRules;
7
+ entryPoint?: NodeId;
8
+ exitPoint?: RenderId;
9
+ };
14
10
  type RenderingOptions = {
15
- elementData: ElementData | Nodes,
16
- suffixId: string,
17
- root: RootObject,
18
- defaults?: RenderObject,
19
- entryButton?: EntryObject,
20
- exitElement?: ExitObject
21
- }
22
-
11
+ elementData: ElementData | Nodes;
12
+ suffixId: string;
13
+ root: RootObject;
14
+ defaults?: RenderObject;
15
+ entryButton?: EntryObject;
16
+ exitElement?: ExitObject;
17
+ };
23
18
  type Structure = {
24
- nodes: Nodes,
25
- edges: Edges,
26
- navigationRules?: NavigationRules,
27
- elementData?: ElementData
28
- }
29
-
30
- type Nodes = Record<NodeId, NodeObject>
31
- type Edges = Record<EdgeId, EdgeObject>
32
- type NavigationRules = Record<NavId, NavObject>
33
- type ElementData = Record<RenderId, RenderObject>
34
-
35
- type EdgeList = Array<EdgeId>
36
- type NavigationList = Array<NavId>
37
-
38
- type Semantics = ((RenderObject?,DatumObject?) => SemanticsObject) | SemanticsObject
39
- type Dimensions = ((RenderObject?,DatumObject?) => DimensionsObject) | DimensionsObject
40
- type Attributes = ((RenderObject?,DatumObject?) => AttributesObject) | AttributesObject
41
-
19
+ nodes: Nodes;
20
+ edges: Edges;
21
+ navigationRules?: NavigationRules;
22
+ elementData?: ElementData;
23
+ };
24
+ type Nodes = Record<NodeId, NodeObject>;
25
+ type Edges = Record<EdgeId, EdgeObject>;
26
+ type NavigationRules = Record<NavId, NavObject>;
27
+ type ElementData = Record<RenderId, RenderObject>;
28
+ type EdgeList = Array<EdgeId>;
29
+ type NavigationList = Array<NavId>;
30
+ type Semantics = ((RenderObject?: any, DatumObject?: any) => SemanticsObject) | SemanticsObject;
31
+ type Dimensions = ((RenderObject?: any, DatumObject?: any) => DimensionsObject) | DimensionsObject;
32
+ type Attributes = ((RenderObject?: any, DatumObject?: any) => AttributesObject) | AttributesObject;
42
33
  type NodeObject = {
43
- id: NodeId,
44
- edges: EdgeList,
45
- renderId?: RenderId,
46
- [key: string | number]: any // NodeObjects can be lazily used as generic objects (like ElementObjects) too
47
- }
48
-
34
+ id: NodeId;
35
+ edges: EdgeList;
36
+ renderId?: RenderId;
37
+ [key: string | number]: any;
38
+ };
49
39
  type EdgeObject = {
50
40
  source: (() => EdgeId) | EdgeId;
51
41
  target: (() => EdgeId) | EdgeId;
52
42
  navigationRules: NavigationList;
53
- }
54
-
43
+ };
55
44
  type NavObject = {
56
45
  direction: Direction;
57
46
  key?: string;
58
- }
59
-
47
+ };
60
48
  type RenderObject = {
61
- cssClass?: DynamicString,
62
- dimensions?: Dimensions,
63
- semantics?: Semantics,
64
- parentSemantics?: Semantics,
65
- existingElement?: ExistingElement,
66
- showText?: boolean
67
- }
68
-
49
+ cssClass?: DynamicString;
50
+ dimensions?: Dimensions;
51
+ semantics?: Semantics;
52
+ parentSemantics?: Semantics;
53
+ existingElement?: ExistingElement;
54
+ showText?: boolean;
55
+ };
69
56
  type RootObject = {
70
- id: string,
71
- cssClass?: string,
72
- description?: string,
73
- width?: string | number,
74
- height?: string | number
75
- }
76
-
57
+ id: string;
58
+ cssClass?: string;
59
+ description?: string;
60
+ width?: string | number;
61
+ height?: string | number;
62
+ };
77
63
  type EntryObject = {
78
- include: boolean,
79
- callbacks?: EntryCallbacks
80
- }
81
-
64
+ include: boolean;
65
+ callbacks?: EntryCallbacks;
66
+ };
82
67
  type ExitObject = {
83
- include: boolean,
84
- callbacks?: ExitCallbacks
85
- }
86
-
68
+ include: boolean;
69
+ callbacks?: ExitCallbacks;
70
+ };
87
71
  type SemanticsObject = {
88
- label?: DynamicString,
89
- elementType?: DynamicString,
90
- role?: DynamicString,
91
- attributes?: Attributes
92
- }
93
-
72
+ label?: DynamicString;
73
+ elementType?: DynamicString;
74
+ role?: DynamicString;
75
+ attributes?: Attributes;
76
+ };
94
77
  type DimensionsObject = {
95
- x?: DynamicNumber,
96
- y?: DynamicNumber,
97
- width?: DynamicNumber,
98
- height?: DynamicNumber,
99
- path?: DynamicString
100
- }
101
-
78
+ x?: DynamicNumber;
79
+ y?: DynamicNumber;
80
+ width?: DynamicNumber;
81
+ height?: DynamicNumber;
82
+ path?: DynamicString;
83
+ };
102
84
  type DescriptionOptions = {
103
- omitKeyNames?: boolean,
104
- semanticLabel?: string
105
- }
106
-
85
+ omitKeyNames?: boolean;
86
+ semanticLabel?: string;
87
+ };
107
88
  type ExistingElement = {
108
- useForDimensions: boolean,
109
- dimensions?: Dimensions
110
- }
111
-
89
+ useForDimensions: boolean;
90
+ dimensions?: Dimensions;
91
+ };
112
92
  type EntryCallbacks = {
113
- focus?: Function,
114
- click?: Function
115
- }
116
-
93
+ focus?: Function;
94
+ click?: Function;
95
+ };
117
96
  type ExitCallbacks = {
118
- focus?: Function,
119
- blur?: Function
120
- }
121
-
97
+ focus?: Function;
98
+ blur?: Function;
99
+ };
122
100
  type DatumObject = {
123
- [key: string | number]: any
124
- }
125
-
101
+ [key: string | number]: any;
102
+ };
126
103
  type AttributesObject = {
127
- [key: string]: string
128
- }
129
-
130
- type DynamicNumber = ((RenderObject?,DatumObject?) => number) | number
131
-
132
- type DynamicString = ((RenderObject?,DatumObject?) => string) | string
133
-
134
- type NodeId = string
135
-
136
- type EdgeId = string
137
-
138
- type RenderId = string
139
-
140
- type NavId = string
141
-
142
- type Direction = "target" | "source"
104
+ [key: string]: string;
105
+ };
106
+ type DynamicNumber = ((RenderObject?: any, DatumObject?: any) => number) | number;
107
+ type DynamicString = ((RenderObject?: any, DatumObject?: any) => string) | string;
108
+ type NodeId = string;
109
+ type EdgeId = string;
110
+ type RenderId = string;
111
+ type NavId = string;
112
+ type Direction = "target" | "source";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const defaultKeyBindings: DatumObject;
2
+ export declare const GenericFullNavigationRules: NavigationRules;
3
+ export declare const GenericLimitedNavigationRules: NavigationRules;
4
+ export declare const NodeElementDefaults: RenderObject;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ structure: (options: StructureOptions) => {
3
+ nodes: {};
4
+ edges: {};
5
+ elementData: {};
6
+ navigationRules: NavigationRules;
7
+ };
8
+ input: (options: InputOptions) => any;
9
+ rendering: (options: RenderingOptions) => any;
10
+ };
11
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: InputOptions) => any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: RenderingOptions) => any;
2
+ export default _default;
@@ -0,0 +1,14 @@
1
+ declare const _default: (options: StructureOptions) => {
2
+ nodes: {};
3
+ edges: {};
4
+ elementData: {};
5
+ navigationRules: NavigationRules;
6
+ };
7
+ export default _default;
8
+ export declare const buildNodeStructureFromVegaLite: (options: any) => {
9
+ nodes: {};
10
+ edges: {};
11
+ elementData: {};
12
+ navigationRules: NavigationRules;
13
+ };
14
+ export declare const buildNodeStructure: (options: any) => {};
@@ -0,0 +1 @@
1
+ export declare const describeNode: (d: DatumObject, descriptionOptions?: DescriptionOptions) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "data-navigator",
3
3
  "author": "Frank Elavsky",
4
- "version": "1.2.1",
4
+ "version": "1.2.3",
5
5
  "main": "./dist/index.jsm",
6
6
  "module": "./dist/index",
7
7
  "types": "./dist/data-navigator.d.ts",
@@ -29,10 +29,9 @@
29
29
  "description": "Data-navigator is a JavaScript library that allows for serial navigation of data structures using a variety of input modalities and assistive technologies.",
30
30
  "scripts": {
31
31
  "clean": "rm -rf ./dist && rm -rf ./app",
32
- "build": "yarn build:app && yarn build:index && yarn build:types && yarn build:modules",
32
+ "build": "yarn build:app && yarn build:index && yarn build:modules",
33
33
  "build:app": "webpack",
34
34
  "build:index": "tsup src/index.ts --format cjs,esm",
35
- "build:types": "cp data-navigator.d.ts ./dist/",
36
35
  "build:modules": "tsup src/structure.ts src/input.ts src/rendering.ts src/utilities.ts src/consts.ts --format cjs,esm --minify",
37
36
  "server": "python -m http.server",
38
37
  "prettier-all-check": "prettier --config ./.prettierrc --ignore ./.prettierignore --debug-check \"**/*.{js,jsx,ts,tsx,html,jsx,json,css,scss,md}\"",
@@ -1 +0,0 @@
1
- var a=(t,c)=>{let s=Object.keys(t),e="";return s.forEach(o=>{e+=`${c.omitKeyNames?"":o+": "}${t[o]}. `}),e+=c.semanticLabel||"Data point.",e};export{a};