[CORD-1943] New service graph
- labels
- enforcing service position
- started documentation
- toggling service instances
- toggle fullscreen

Change-Id: I01b71fb2607fb58711d4624f6b5b6479609b2f4f
diff --git a/src/app/service-graph/interfaces.ts b/src/app/service-graph/interfaces.ts
index af55c54..861ba75 100644
--- a/src/app/service-graph/interfaces.ts
+++ b/src/app/service-graph/interfaces.ts
@@ -1,4 +1,3 @@
-
 /*
  * Copyright 2017-present Open Networking Foundation
 
@@ -15,95 +14,42 @@
  * limitations under the License.
  */
 
-
 interface Id3Element {
-  d3Class?: string;
-  d3Id?: string;
-}
-
-export interface IXosServiceModel {
-  id: number;
-  d3Id?: string;
-  backend_status: string;
-  kind: string;
-  name: string;
-  class_names: string;
-  service_specific_attributes: string; // this is json stringified
-}
-
-export interface IXosTenantModel extends Id3Element {
-  id: number;
-  d3Id?: string;
-  backend_status: string;
-  kind: string;
-
-  // source
-  provider_service_id: number;
-
-  // destination
-  subscriber_service_id: number;
-  subscriber_tenant_id: number;
-  subscriber_root_id: number;
-  subscriber_network_id: number;
-
-  subscriber_user_id: number;
-
-  // extra informations
-  service_specific_id: string;
-  service_specific_attribute: string;
-  connect_method: string;
-
-  // reverse of subscriber tenants
-  subscribed_tenants_ids: number[];
-}
-
-export interface IXosCoarseGraphData {
-  services: IXosServiceModel[];
-  servicedependencies: any[];
-}
-
-// TODO outdated, remove
-export interface IXosFineGrainedGraphData extends IXosCoarseGraphData {
-  tenants: IXosTenantModel[];
-  subscribers: any[];
-  networks: any[];
-}
-
-export interface IXosServiceInstanceGraphData {
-  serviceGraph: IXosServiceGraph;
-  serviceInstances: any[];
-  serviceInstanceLinks: any[];
-  networks: any[];
-}
-
-export interface IXosServiceGraphNodeBadge {
-  type: 'info'|'success'|'warning'|'danger';
-  text: string;
-}
-
-export interface IXosServiceGraphNode extends Id3Element {
-  id: number | string;
-  label: string;
-  x?: number;
-  y?: number;
-  px?: number;
-  py?: number;
-  width?: number;
-  height?: number;
+  x: number;
+  y: number;
   fixed?: boolean;
-  badge?: IXosServiceGraphNodeBadge; // TODO implement badges
-  model: IXosServiceModel;
-  type: 'service' | 'tenant' | 'network' | 'subscriber';
 }
 
-export interface IXosServiceGraphLink extends Id3Element {
+export interface IXosSgNode extends Id3Element {
   id: string;
+  data: any; // this can be a Service, ServiceInstance or Instance
+
+  // do we need those?
+  type: string;
+  d3Class?: string;
+}
+
+export interface IXosSgLink {
+  id: string;
+  type: string;
   source: number;
   target: number;
-  model: IXosTenantModel;
+  data: any; // this can be a ServiceDependency, ServiceInstanceLink or a representation of ServiceInstance.owner_id
 }
 
-export interface IXosServiceGraph {
-  nodes: IXosServiceGraphNode[];
-  links: IXosServiceGraphLink[];
+export interface IXosSgConfig {
+  labels: boolean;
+}
+
+export interface IXosBaseModel {
+  id: number;
+  class_names: string;
+  name?: string;
+  [x: string]: any; // allow extra properties
+}
+
+export interface IXosOwnershipLink {
+  service: number;
+  service_instance: number;
+  type: 'ownership';
 }