aboutsummaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-04-07 15:30:07 +0200
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-04-07 15:30:07 +0200
commit8d1e657dbc673a8005fe7f3f5b2dda3be664efb2 (patch)
tree12b32c50743497a7b10a1bf80dc1382b5205409a /frontend/src
parent5e9bba412ed721c095693592ef7379797eb3a110 (diff)
Dodao opciju menjanja boje oko cvora u graph komponenti.
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/app/_elements/graph/graph.component.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/frontend/src/app/_elements/graph/graph.component.ts b/frontend/src/app/_elements/graph/graph.component.ts
index c17e8906..e0a05145 100644
--- a/frontend/src/app/_elements/graph/graph.component.ts
+++ b/frontend/src/app/_elements/graph/graph.component.ts
@@ -12,12 +12,13 @@ export class GraphComponent implements OnInit {
@Input() model?: Model;
@Input() inputCols: number = 1;
- @Input() lineThickness: number = 5;
+ @Input() lineThickness: number = 2;
@Input() nodeRadius: number = 15;
- @Input() lineColor: string = '#ff0000';
+ @Input() lineColor: string = '#00a8e8';
@Input() nodeColor: string = '#222277';
- @Input() inputNodeColor: string = '#44ee22';
- @Input() outputNodeColor: string = '#559977';
+ @Input() borderColor: string = '#00a8e8';
+ @Input() inputNodeColor: string = '#ffdd11';
+ @Input() outputNodeColor: string = '#44ee22';
private wrapper?: HTMLDivElement;
private canvas?: HTMLCanvasElement;
@@ -103,6 +104,7 @@ export class GraphComponent implements OnInit {
drawLine(node1: Node, node2: Node) {
this.ctx!.strokeStyle = this.lineColor;
+ this.ctx!.lineWidth = this.lineThickness;
this.ctx!.beginPath();
this.ctx!.moveTo(node1.x * this.width, node1.y * this.height);
this.ctx!.lineTo(node2.x * this.width, node2.y * this.height);
@@ -111,7 +113,8 @@ export class GraphComponent implements OnInit {
drawNode(node: Node) {
this.ctx!.fillStyle = node.color;
- this.ctx!.strokeStyle = '#000';
+ this.ctx!.strokeStyle = this.borderColor;
+ this.ctx!.lineWidth = this.lineThickness;
this.ctx!.beginPath();
this.ctx!.arc(node.x * this.width, node.y * this.height, this.nodeRadius, 0, 2 * Math.PI);
this.ctx!.fill();