From 5516c8a28bea617e3123b13fc2aeefdd33e32596 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 10:19:30 +0100 Subject: [PATCH] Fix diagram event properties color --- .../diagrams/diagram-event.component.html | 3 ++- .../components/diagrams/diagram-event.component.ts | 10 +++++++++- .../components/raphael/raphael-circle.component.ts | 13 +++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html index d965900f2d..83ec775c87 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts index db510db849..178b73e304 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts @@ -16,6 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './services/diagram-color.service'; @Component({ moduleId: module.id, @@ -38,11 +39,18 @@ export class DiagramEventComponent { center: any = {}; - constructor(public elementRef: ElementRef) {} + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} ngOnInit() { console.log(this.elementRef); this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); + + this.data.radius = this.radius; + this.data.strokeWidth = this.strokeWidth; + this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.data.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts index a1a81edebc..566ceb0754 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts @@ -32,7 +32,16 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { radius: number; @Input() - strokeWith: number; + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; @Output() onError = new EventEmitter(); @@ -44,7 +53,7 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { ngOnInit() { console.log(this.elementRef); - let opts = {'stroke-width': this.strokeWith}; + let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; this.draw(this.center, this.radius, opts); }