Class: GraphComponent

Components. GraphComponent

Angular Component containing Cytoscape graph.
Inject services on object creation.


new GraphComponent(graph, eventListenerService, cytoscapeInitialisationService, webSocketService, styleUpdater, dependenciesUpdater, ginflowNotifier, json)

Constructor.

Parameters:
Name Type Description
graph GraphService
eventListenerService EventListenerService
cytoscapeInitialisationService CytoscapeInitialisationService
webSocketService WebSocketService
styleUpdater StyleUpdaterService
dependenciesUpdater DependenciesUpdaterService
ginflowNotifier GinflowNotifierService
json JsonService
Source:

Members


container :HTMLElement

DOM Element which contains the graph.

Type:
  • HTMLElement
Source:

currentAlt :number

Data received from Components.AppComponent, represents the alternative group of the current service selected.

Type:
  • number
Source:

currentEdge :any

Data received from Components.AppComponent, represents the current edge selected.

Type:
  • any
Source:

currentSrv :string

Data received from Components.AppComponent, represents the srv of the current service selected.

Type:
  • string
Source:

currentSup :number

Data received from Components.AppComponent, represents the supervised group of the current service selected.

Type:
  • number
Source:

currentTypeControl :any

Data received from Components.AppComponent, represents the current type of egde selected.
Possible values on Enums.TypeControl.

Type:
  • any
Source:

elements :Array.<Cy.ElementDefinition>

Elements.

Type:
  • Array.<Cy.ElementDefinition>
Source:

end :EventEmitter

Event sent to Components.AppComponent when the workflow execution ending.

Type:
  • EventEmitter
Source:

exportData :string

Data received from Components.AppComponent, represents the JSON object contained in the text area JSON preview.

Type:
  • string
Source:

exportJSON :boolean

Boolean to display or not text area for JSON export.

Type:
  • boolean
Source:

exports :EventEmitter

Event sent to Components.AppComponent when clicking on export to JSON button.

Type:
  • EventEmitter
Source:

hideImportJSON :boolean

Boolean to display or not text area for JSON import.

Type:
  • boolean
Source:

importData :any

Data received from Components.AppComponent, represents the JSON object when submitting the form to import JSON to graph.

Type:
  • any
Source:

importJSON :boolean

Boolean to display or not text area for JSON import.

Type:
  • boolean
Source:

launch :EventEmitter

Event sent to Components.AppComponent when clicking on launch button.

Type:
  • EventEmitter
Source:

layout :Cy.LayoutOptions

Layout.

Type:
  • Cy.LayoutOptions
Source:

select :EventEmitter

Event sent to Components.AppComponent when selecting or deselecting element of the graph.

Type:
  • EventEmitter
Source:

style :Array.<Cy.Stylesheet>

Style of elements (selectors).

Type:
  • Array.<Cy.Stylesheet>
Source:

subscription :Subscription

Subscriber which listens for changes of workflowStatus.

Type:
  • Subscription
Source:

subscriptionProgressionDeployment :Subscription

Subscriber which listens for changes of workflowPourcentageDeployment.

Type:
  • Subscription
Source:

subscriptionProgressionDescription :Subscription

Subscriber which listens for changes of workflowPourcentageDescription.

Type:
  • Subscription
Source:

subscriptionProgressionResult :Subscription

Subscriber which listens for changes of workflowPourcentageResult.

Type:
  • Subscription
Source:

toggle :EventEmitter

Event sent to Components.AppComponent when a click on toggle button create/import graph.

Type:
  • EventEmitter
Source:

wasClickedOnce :boolean

Boolean used to force the export to JSON only once (except if errors occurs).

Type:
  • boolean
Source:

workflowName :string

Data received from Components.AppComponent, represents the name of the workflow.

Type:
  • string
Source:

workflowPourcentageDeployment :number

Purcentage for services deployed progressbar.

Type:
  • number
Source:

workflowPourcentageDescription :number

Purcentage for services description sent progressbar.

Type:
  • number
Source:

workflowPourcentageResult :number

Purcentage for services result progressbar.

Type:
  • number
Source:

workflowStatus :WorkflowStatus

Current status of the workflow.

Type:
  • WorkflowStatus
Source:

Methods


ngAfterViewInit()

Function called when DOM is ready.
All code concerning cytoscape initialisation must be put here.

Source:

ngOnChanges(changes)

Method provided by OnChanges interface.
This method is called for every time we modify @Input variable content.

Parameters:
Name Type Description
changes

an object containing all @Input variables

Source:

onClickToggle()

When clicking on the button, it allows to switch mode between edit mode and export mode.

Source:

onExportJSON()

Called when clicking on export JSON button.

Source:

onLaunch()

Launch the workflow.
Multiple preconditions to launch it :
1) The workflow must have a name
2) All services must have a srv field (Service)
3) The workflow must have at least one service
4) The workflow must not have cycle

After checking these 4 preconditions, the cytoscape graph is converted into a specific ginflow JSON representation.
Then this JSON is sent through a WebSocket to the Java-API ginflow.
Finally, we disable update of the graph when the workflow is finished.

Source: