/** * Copyright Linkurious SAS 2012 - 2019 * * - Created on 2019-10-21. */ import { GenericObject } from './commonTypes'; import { PropertyTypeName, PropertyType } from './graphSchema'; import { OgmaEdgeShape, OgmaNodeShape, IStyleIcon, IStyleImage } from './displayTypes'; export interface LkDate { type: 'date'; value: string; timezone?: string; } export interface LkDateTime { type: 'datetime'; value: string; timezone?: string; } export interface ConflictValue { type: PropertyTypeName; status: 'conflict'; original: string; } export interface InvalidValue { type: PropertyType; status: 'invalid'; original: string; } export interface MissingValue { type: PropertyTypeName; status: 'missing'; mandatory: boolean; } export type LkProperty = string | number | boolean | LkDate | LkDateTime | MissingValue | InvalidValue | ConflictValue; export type LkProperties = GenericObject; export interface LkItemData { properties: LkProperties; readAt: number; isVirtual: boolean; } export interface LkItem { id: string; data: LkItemData; } export interface IGeoCoordinates { latitude: number; longitude: number; } export interface IGeoData { original?: IGeoCoordinates; current?: IGeoCoordinates; } export interface LkDigestItem { nodeCategories: string[]; edgeType: string; nodes: number; edges: number; } export interface LkEdgeDigestItem { edgeType: string; edges: number; } export interface LkNodeStatistics { degree?: number; supernode?: boolean; supernodeDigest?: LkEdgeDigestItem[]; supernodeDegree?: number; digest?: LkDigestItem[]; } export interface LkNodeData extends LkItemData { categories: string[]; statistics?: LkNodeStatistics; geo: IGeoData; } export interface LkNode extends LkItem { data: LkNodeData; } export interface LkEdgeData extends LkItemData { type: string; } export interface LkEdge extends LkItem { source: string; target: string; data: LkEdgeData; } export interface LkSubGraph { nodes: LkNode[]; edges: LkEdge[]; } export interface IVizNodeInfo { id: string; attributes: { x: number | null; y: number | null; layoutable: boolean; selected?: boolean; }; data: { geo: IGeoData; }; } export interface IVizNodeGroupInfo { id: string; attributes: { layoutable?: boolean; collapsed?: boolean; }; } export interface IVizEdgeInfo { id: string; attributes: { selected?: boolean; }; } export type VizNode = LkNode & IVizNodeInfo; export type VizEdge = LkEdge & IVizEdgeInfo; export interface WidgetNodeInfo { attributes: { x: number; y: number; color?: string[]; radius?: number; shape?: OgmaNodeShape; icon?: IStyleIcon; image?: IStyleImage; text: { content: string; }; }; } export interface WidgetEdgeInfo { attributes: { color?: string; shape?: OgmaEdgeShape; width?: number; text: { content: string; }; }; } export type WidgetNode = LkNode & WidgetNodeInfo; export type WidgetEdge = LkEdge & WidgetEdgeInfo;