import SidebarAlgorithm from 'canvas-graph-creator/src/js/ui/sidebar-algorithm.js'
SidebarAlgorithm
Extends:
Sidebar that accompanies the AlgorithmTool.
Constructor Summary
Public Constructor | ||
public |
constructor(graph: Graph) Constructor calls the super, creates a new stepper object and then assigns algorithm specific button listeners to the sidebar |
Member Summary
Public Members | ||
public |
curAlgorithm: * |
|
public |
graph: * |
|
public |
stepper: * |
Method Summary
Public Methods | ||
public |
createLinkElement(obj: Node | Edge): string Create a graph link element using the specified Node or Edge. |
|
public |
display() Called when the sidebar content is switched to this. |
|
public |
hoverEvent(bool: boolean) Called to check for hovering over a graph link (link that associates text with an object in the Graph). |
|
public |
Reset the graph. |
|
public |
run() Runs the current algorithm and displays the results in the sidebar. |
|
public |
setAlgorithm(AlgorithmClass: Object) Set the current algorithm to a new instance of the given algorithm class. |
|
public |
toggleHover(type: string, id: number, isHovering: boolean) Toggle the hover state of the associated Node or Edge when a graph link is being hovered. |
|
public |
update() Update does nothing now, at this point might not do anything ever since changing the algorithm type occurs in algorithm-tool and the top-bar. |
|
public |
Update the state of the buttons in the sidebar. |
Inherited Summary
From class SidebarContent | ||
public |
graph: * |
|
public |
tabs: * |
|
public |
changeGraph(newGraph: Graph) Change the Graph object reference stored to the new one. |
|
public abstract |
display() Display the sidebar. |
|
public abstract |
update() Update the sidebar state. |
Public Constructors
public constructor(graph: Graph) source
Constructor calls the super, creates a new stepper object and then assigns algorithm specific button listeners to the sidebar
Override:
SidebarContent#constructorParams:
Name | Type | Attribute | Description |
graph | Graph | Reference to the master graph object |
Public Methods
public createLinkElement(obj: Node | Edge): string source
Create a graph link element using the specified Node or Edge.
public display() source
Called when the sidebar content is switched to this.
Override:
SidebarContent#displaypublic hoverEvent(bool: boolean) source
Called to check for hovering over a graph link (link that associates text with an object in the Graph).
Params:
Name | Type | Attribute | Description |
bool | boolean | Whether or not the graph link is currently being hovered over. |
public setAlgorithm(AlgorithmClass: Object) source
Set the current algorithm to a new instance of the given algorithm class.
Params:
Name | Type | Attribute | Description |
AlgorithmClass | Object | The algorihtm class |
public toggleHover(type: string, id: number, isHovering: boolean) source
Toggle the hover state of the associated Node or Edge when a graph link is being hovered.
public update() source
Update does nothing now, at this point might not do anything ever since changing the algorithm type occurs in algorithm-tool and the top-bar.