src/app/graphs/issue-graph/issue-graph.component.ts
This component creates nodes and edges in the embedded MICO GraphEditor
(html tag:
OnInit
OnDestroy
AfterViewInit
selector | app-issue-graph |
styleUrls | ./issue-graph.component.css |
templateUrl | ./issue-graph.component.html |
constructor(dialog: MatDialog, gs: IssueGraphStateService, ss: StateService, router: Router, activatedRoute: ActivatedRoute, componentStoreService: ComponentStoreService, interfaceStoreService: InterfaceStoreService, componentContextMenuService: componentContextMenuComponent.ComponentContextMenuService, breakPointObserver: BreakpointObserver, issueGraphClassSettersService: IssueGraphClassSettersService, issueGraphLinkHandlesService: IssueGraphLinkHandlesService, issueGraphDynamicTemplateRegistryService: IssueGraphDynamicTemplateRegistryService)
|
|||||||||||||||||||||||||||||||||||||||
Parameters :
|
projectId | |
Type : string
|
|
Private addInterfaceToComponent | ||||||||||||
addInterfaceToComponent(offeredById: string, position: issueGraphNodes.Position)
|
||||||||||||
Opens the interface creation dialog. If the user actually creates the interface it is added to the providing component at the position where the dragged edge was dropped by the user (before opening the interface creation dialog).
Parameters :
Returns :
void
|
Private addIssueFolderNodes | ||||||||
addIssueFolderNodes(node: issueGraphNodes.IssueNode)
|
||||||||
This method presumes that node has the 4 'Grouping Manager Objects' depicted on the the upper levels in the graph_structure_documentation.png. correctly setup.
Parameters :
Returns :
void
|
Private addIssueFolders | ||||||||
addIssueFolders(node: issueGraphNodes.IssueNode)
|
||||||||
Adds the issue folders with counts for each IssueCategory (currently 3) to the component or interface represented by node. The first methods call sets up invisible nodes in the graph to make the folders display properly. The second method takes care of actually adding the visible folders with the correct counts.
Parameters :
Returns :
void
|
Private addIssueGroupContainer | ||||||||
addIssueGroupContainer(node: issueGraphNodes.IssueNode)
|
||||||||
Creates the node groups necessary for displaying issue folders attached to a node. A Node represents a component or an interface. It also gets an issue group of IssueGroupContainerParentBehaviour, issueGroupContainerNode with IssueGroupContainerBehaviour gets added to it. This corresponds to the 4 'Grouping Manager' object on the upper two levels in the graph_structure_documentation.png.
Parameters :
Returns :
void
|
calculateBoundingBox |
calculateBoundingBox()
|
Calculates the bounding box of the view.
Returns :
Rect
The calculated bounding box. |
Private closeComponentActions | ||||||||||
closeComponentActions(reload: boolean)
|
||||||||||
Closes the component context menu, if one is open
Parameters :
Returns :
boolean
|
connectConsumingComponents | ||||||||
connectConsumingComponents(interfaceNode: issueGraphNodes.InterfaceNode)
|
||||||||
Adds an edge from each connected component to the interface.
Parameters :
Returns :
void
|
connectToOfferingComponent | ||||||||
connectToOfferingComponent(node: issueGraphNodes.InterfaceNode)
|
||||||||
Creates and adds an edge between the node representing a component an the node representing the interface itself.
Parameters :
Returns :
void
|
Private contextMenuTypeForNodeType | ||||||||
contextMenuTypeForNodeType(node: Node)
|
||||||||
Sets the context menu type.
Parameters :
Returns :
NodeDetailsType
|
Private drawFolderRelations | ||||||||
drawFolderRelations(node: issueGraphNodes.IssueNode)
|
||||||||
Draws folder relations originating from the issue folder represented by node.
Parameters :
Returns :
void
|
drawGraph |
drawGraph()
|
Responsible for drawing the graph based on this.graphData. Takes care of adding interfaces and components, and their connections. Additionally adds issue folders attached to each component and the dashed edges between them based on this.graphData.relatedFolders
Returns :
void
|
Private extractIssueId | ||||||||||||
extractIssueId(issueList, category: string)
|
||||||||||||
Extracts the id of an issue in a given issue list.
Parameters :
Returns :
string
Id of the first issue (in the issue list) with matching category. |
findIdealComponentPosition | ||||||||||||
findIdealComponentPosition(id: string, boundingBox: Rect)
|
||||||||||||
Finds the ideal component position if none is saved.
Parameters :
Returns :
Point
|
fitGraphInView |
fitGraphInView()
|
Fits the graph into view.
Returns :
void
|
initGraph |
initGraph()
|
Sets up the graph and register event listeners
Returns :
void
|
layoutGraph |
layoutGraph()
|
Attempts to automatically lay-out the graph in a reasonable manner
Returns :
void
|
Private loadSavedPositions |
loadSavedPositions()
|
Loads positions of graph elements from the local storage.
Returns :
Positions
Parsed positions |
Private manageDragBehaviour | ||||||||
manageDragBehaviour(graph: GraphEditor)
|
||||||||
Manages the edge drag behaviour of given GraphEditor instance.
Parameters :
Returns :
void
|
Private manageEventListeners | ||||||||||||
manageEventListeners(graph: GraphEditor, minimap: GraphEditor)
|
||||||||||||
Adds event listeners to a given GraphEditor instance.
Parameters :
Returns :
void
|
Private nodeClickContextMenuHasType | ||||||||||||||||
nodeClickContextMenuHasType(node: Node, event: CustomEvent, contextMenuType: NodeDetailsType)
|
||||||||||||||||
Open the component context menu
Parameters :
Returns :
void
|
Private nodeClickIssueFolder | ||||||||
nodeClickIssueFolder(node: Node)
|
||||||||
Handles the case in which an issue folder is clicked. Determines the number of issues in the issue folder and opens the corresponding issue page.
Parameters :
Returns :
void
|
Private nodeClickManyIssues | ||||||||
nodeClickManyIssues(rootNode: Node)
|
||||||||
Handles the case in which the clicked issue folder contains many issues.
Parameters :
Returns :
void
|
Private nodeClickOneIssue | ||||||||||||||||
nodeClickOneIssue(rootId: string, rootNode: Node, node: Node)
|
||||||||||||||||
Handles the case in which the clicked issue folder contains only one issues.
Parameters :
Returns :
void
|
Public openCreateComponentDialog |
openCreateComponentDialog()
|
Opens create component dialog and triggers reload of data after the dialog is closed.
Returns :
void
|
Public reload |
reload()
|
Issues a redraw of the graph. ?
Returns :
void
|
resetGraph |
resetGraph()
|
Resets graph state. Called at start of draw(). Enables logic in draw() to assume a 'blank sheet' state avoiding complex updating logic.
Returns :
void
|
Private setGraphToLastView |
setGraphToLastView()
|
Sets the view and the bounding box of the graph to how it was when the user left the graph with the help of localStorage. When theres no previous session available set the view to the optimized bounding box for the graph.
Returns :
void
|
setRelationVisibility | ||||||||
setRelationVisibility(showRelations: boolean)
|
||||||||
Sets --show-relations css variable to initial or none. It is the value of the display attribute of the edges. If we set it to none the edges disappear.
Parameters :
Returns :
void
|
Private subscribeToSubject |
subscribeToSubject()
|
Subscribes to the subject emitting node positions.
Returns :
void
|
Private componentContextMenu |
Type : componentContextMenuComponent.ComponentContextMenuComponent
|
Private componentContextMenuNodeId |
Type : number | string
|
currentVisibleArea |
Type : Rect
|
Default value : {x: 0, y: 0, width: 1, height: 1}
|
Private destroy$ |
Default value : new ReplaySubject(1)
|
Private graph |
Type : GraphEditor
|
Public graphData |
Type : GraphData
|
Private graphFirstRender |
Default value : true
|
Private graphInitialized |
Default value : false
|
graphWrapper |
Type : literal type
|
Decorators :
@ViewChild('graph', {static: true})
|
Private isHandset |
Default value : false
|
Private issueGroupParents |
Type : Node[]
|
Default value : []
|
minimap |
Type : literal type
|
Decorators :
@ViewChild('minimap', {static: true})
|
Private onCreateEdge | ||||
Default value : () => {...}
|
||||
Method gets triggered after an edge gets created, it can either be of type provider or consumer. |
||||
Parameters :
|
Private onDraggedEdgeTargetChanged | ||||||||
Default value : () => {...}
|
||||||||
Method gets triggered after an edge gets dragged and its target is changed: ex. consumer edge gets moved away from the provider edge. |
||||||||
Parameters :
|
Private onEdgeAdd | ||||
Default value : () => {...}
|
||||
Method gets triggered after an edge gets added. |
||||
Parameters :
|
Private onEdgeDrop | ||||
Default value : () => {...}
|
||||
Method gets triggered after an edge gets dropped. |
||||
Parameters :
|
Private onEdgeRemove | ||||
Default value : () => {...}
|
||||
Method gets triggered after an edge gets removed. |
||||
Parameters :
|
Private onNodeClick | ||||
Default value : () => {...}
|
||||
Method gets triggered after a node is clicked. |
||||
Parameters :
|
Private onNodeDragEnd | ||||
Default value : () => {...}
|
||||
Called when the user lets go of a node |
||||
Parameters :
|
Private projectStorageKey |
Type : string
|
Private redrawByCloseOfComponentDetails |
Default value : false
|
Public reload$ |
Type : BehaviorSubject<void>
|
Default value : new BehaviorSubject(null)
|
Private reloadOnMouseUp |
Default value : false
|
Private savedPositions |
Type : Positions
|
Default value : {nodes: {}, issueGroups: {}}
|
Private savePositionsSubject |
Default value : new Subject<null>()
|
Readonly zeroPosition |
Type : object
|
Default value : {x: 0, y: 0}
|
Private zoomOnRedraw |
Default value : true
|
./issue-graph.component.css