@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
92 lines (90 loc) • 3.78 kB
TypeScript
import type { JSONSupport } from "../../core/JSONSupport.js";
export interface GraphObjectProperties extends Partial<Pick<GraphObject, "properties">> {}
/**
* This is the parent class of all objects that can be represented on a graph structure or graph query - [Entity](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Entity/),
* [Relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Relationship/), [Path](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Path/), and anonymous object.
* An anonymous object is any object that is not specifically an `entity`, `relationship`, or `path`.
*
* @since 4.25
* @see [GraphNamedObject](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/GraphNamedObject/)
* @see [Relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Relationship/)
* @see [Entity](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Entity/)
*/
export default class GraphObject extends JSONSupport {
constructor(properties?: GraphObjectProperties);
/**
* The properties of the graph object. For [entities](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Entity/) and [relationships](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Relationship/)
* the properties are specified by its [entity type](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/EntityType/) or [relationship type](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/RelationshipType/).
* The values of the properties are specific to the object.
*
* @example
* //example of properties structure that includes geometry
* "properties": {
* "shape": {
* "declaredClass": "esri.geometry.Point",
* "cache": {},
* "hasM": false,
* "hasZ": false,
* "latitude": 53.589000000000009,
* "longitude": -0.9633,
* "type": "point",
* "extent": null,
* "spatialReference": {
* "wkid": 4326
* },
* "x": -0.9633,
* "y": 53.589000000000009
* },
* "Name": "Suncommon",
* "Employee_Count": 400,
* "Address": "123 Broadway, New York, New York",
* "EnergyType": "solar"
* }
* @example
* //two entities of different entity types with different properties
* [{
* "declaredClass": "esri.rest.knowledgeGraph.Entity",
* "properties": {
* "Name": "Suncommon",
* "Employee_Count": 400,
* "energyType": "solar"
* },
* "typeName": "Company",
* "id": "1256"
* },
* {
* "declaredClass": "esri.rest.knowledgeGraph.Entity",
* "properties": {
* "Name": "Empire State Building",
* "height": 1454,
* "heightUnits": "feet",
* "city": "New York"
* },
* "typeName": "Building",
* "id": "B7889541"
* }]
* @example
* //two relationships of different relationship types with different properties
* [{
* "declaredClass": "esri.rest.Relationship.Relationship",
* "properties": {
* "start_date": "2020-04-17",
* "employee_id": "4589",
* "office": "152 Building A"
* },
* "typeName": "Employed_by",
* "id": "B7889541"
* },
* {
* "declaredClass": "esri.rest.Relationship.Relationship",
* "properties": {
* "quantity": 125000,
* "frequency": "bi-weekly",
* "contact_person": "Betty White"
* },
* "typeName": "buys_part",
* "id": "B7889541"
* }]
*/
accessor properties: Record<string, any>;
}