mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#1052 - add tooltip to heatmap
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusInner" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
<raphael-circle [elementId]="data.id" [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<diagram-container-icon-event [data]="data" [type]="data.eventDefinition.type" [fillColor]="signalFillColor"></diagram-container-icon-event>
|
||||
<diagram-tooltip [data]="data"></diagram-tooltip>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusInner" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
<raphael-circle [elementId]="data.id" [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<diagram-container-icon-event [data]="data" [type]="data.eventDefinition && data.eventDefinition.type"
|
||||
[fillColor]="signalFillColor"></diagram-container-icon-event>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
<raphael-rhombus [center]="center" [width]="width" [height]="height" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
|
||||
<raphael-rhombus [elementId]="data.id" [center]="center" [width]="width" [height]="height" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-rhombus>
|
||||
<diagram-tooltip [data]="data"></diagram-tooltip>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusInner" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
<raphael-circle [elementId]="data.id" [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<diagram-container-icon-event [data]="data" [type]="data.eventDefinition.type"></diagram-container-icon-event>
|
||||
<diagram-tooltip [data]="data"></diagram-tooltip>
|
||||
|
@@ -43,6 +43,9 @@ export class RaphaelRhombusDirective extends RaphaelBase implements OnInit {
|
||||
@Input()
|
||||
fillOpacity: any;
|
||||
|
||||
@Input()
|
||||
elementId: string;
|
||||
|
||||
@Output()
|
||||
onError = new EventEmitter();
|
||||
|
||||
@@ -54,11 +57,12 @@ export class RaphaelRhombusDirective extends RaphaelBase implements OnInit {
|
||||
ngOnInit() {
|
||||
console.log(this.elementRef);
|
||||
let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity};
|
||||
this.draw(this.center, this.width, this.height, opts);
|
||||
let elementDraw = this.draw(this.center, this.width, this.height, opts);
|
||||
elementDraw.node.id = this.elementId;
|
||||
}
|
||||
|
||||
public draw(center: Point, width: number, height: number, opts?: any) {
|
||||
this.paper.path('M' + center.x + ' ' + (center.y + (height / 2)) +
|
||||
return this.paper.path('M' + center.x + ' ' + (center.y + (height / 2)) +
|
||||
'L' + (center.x + (width / 2)) + ' ' + (center.y + height) +
|
||||
'L' + (center.x + width) + ' ' + (center.y + (height / 2)) +
|
||||
'L' + (center.x + (width / 2)) + ' ' + center.y + 'z'
|
||||
|
@@ -54,6 +54,7 @@ export class DiagramElementModel {
|
||||
y: string;
|
||||
properties: DiagramElementPropertyModel[] = [];
|
||||
dataType: string = '';
|
||||
eventDefinition: DiagramEventDefinitionModel;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
@@ -71,6 +72,9 @@ export class DiagramElementModel {
|
||||
});
|
||||
}
|
||||
this.dataType = obj.dataType || '';
|
||||
if (obj.eventDefinition) {
|
||||
this.eventDefinition = new DiagramEventDefinitionModel(obj.eventDefinition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,3 +128,15 @@ export class DiagramWayPointModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class DiagramEventDefinitionModel {
|
||||
timeCycle: string;
|
||||
type: string;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.timeCycle = obj.timeCycle;
|
||||
this.type = obj.type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user