Skip to content

Commit 2bf10a4

Browse files
author
Manfred Cheung
committed
feat: add documentation associated with relative points
1 parent b92e6ab commit 2bf10a4

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

docs/api/grafer-points-data.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ An array of point objects to be loaded into Grafer. The PointData property list
1414
| Property | Type | Description |
1515
| :--- | :--- | :--- |
1616
| id | string - *optional* | Name of the point. Will be used as an ID when referencing point in node, edge, and label data. Will default to its index in the PointData array if left out. |
17+
| parentId | string - *optional* | ID of the point which this point is the child of. Used to enable relative positioning of points and relative radius. Will default to *No Parent* if left out.
1718
| x | number | X-Coordinate of the point. |
1819
| y | number | Y-Coordinate of the point. |
1920
| z | number - *optional* | Z-Coordinate of the point. Will default to 0 if left out. |
@@ -27,7 +28,19 @@ Data [mappings](../guides/mappings.md) are used to compute properties at runtime
2728
| Property | Type | Description |
2829
| :--- | :--- | :--- |
2930
| id | (datum: PointData) => string - *optional* | |
31+
| parentId | (datum: PointData) => string - *optional* | |
3032
| x | (datum: PointData) => number - *optional* | |
3133
| y | (datum: PointData) => number - *optional* | |
3234
| z | (datum: PointData) => number - *optional* | |
3335
| radius | (datum: PointData) => number - *optional* | |
36+
37+
### `options`
38+
###### { [key: string]: any } - *optional*
39+
40+
An object containing configuration options for the points.
41+
42+
| Property | Type | Description |
43+
| :--- | :--- | :--- |
44+
| positionHierarchyType | HierarchyTypes | Changes how point hierarchies changes the point positions. See [HierarchyTypes](./hierarchy-types.md) for more information. |
45+
| radiusHierarchyType | HierarchyTypes | Changes how point hierarchies changes the point radius. See [HierarchyTypes](./hierarchy-types.md) for more information. |
46+
| maxHierarchyDepth | number | Sets the maximum hierarchy depth that any point will have. Defaults to 100. |

docs/api/hierarchy-types.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# HierarchyTypes
2+
3+
An enum specifying how a points hierarchy influences a given point data property.
4+
5+
<br>
6+
7+
## Properties
8+
9+
### `NONE`
10+
11+
The hierarchy has no effect on a given data property.
12+
13+
### `ADD`
14+
15+
The value of a given point data property is the sum of all the values associated with that data property up the hierarchy. This type can be used to allow for relative point positioning as an example.

src/data/GraphPoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export enum HierarchyTypes {
1212
}
1313

1414
export interface PointOptions {
15-
positionClassMode?: HierarchyTypes
16-
radiusClassMode?: HierarchyTypes
15+
positionHierarchyType?: HierarchyTypes
16+
radiusHierarchyType?: HierarchyTypes
1717
maxHierarchyDepth?: number
1818
}
1919

0 commit comments

Comments
 (0)