Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
fix(conformance): fix typo in legend
Browse files Browse the repository at this point in the history
  • Loading branch information
tbouffard committed Feb 24, 2023
1 parent 133fee9 commit 64c0b91
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions frontend/src/conformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function visualizeAlignment(alignedTraces){

//remove overlays
activities.forEach(act => globals.bpmnVisualization.bpmnElementsRegistry.removeAllOverlays(act.bpmnSemantic.id))


//set violation color
for (const [activityName, violationRatio] of Object.entries(stats.normalizedStats)) {
const activityElement = getBpmnActivityElementbyName(activityName)
const activityElement = getBpmnActivityElementbyName(activityName)
if(activityElement){
activityCell = mxGraph.getModel().getCell(activityElement.bpmnSemantic.id)
activityCurrentStyle = mxGraph.getModel().getStyle(activityCell)
Expand All @@ -59,10 +59,10 @@ function visualizeAlignment(alignedTraces){
mxGraph.getModel().setStyle(activityCell, style);
activityCurrentStyle = mxGraph.getModel().getStyle(activityCell)
//different way of setting the style
//mxGraph.setCellStyles("fillColor", "red", [activityCell]);
//mxGraph.setCellStyles("fillColor", "red", [activityCell]);

//set label to white when the activity fillColor is above the scale average
if(violationRatio > 0.5){
if(violationRatio > 0.5){
style = mxgraph.mxUtils.setStyle(activityCurrentStyle, 'fontColor', 'white')
mxGraph.getModel().setStyle(activityCell, style);
}
Expand All @@ -73,8 +73,8 @@ function visualizeAlignment(alignedTraces){
globals.bpmnVisualization.bpmnElementsRegistry.addOverlays(
activityElement.bpmnSemantic.id,
[
getDeviationOverlay(stats.aggStats[activityName].modelMove,
violationRatio,
getDeviationOverlay(stats.aggStats[activityName].modelMove,
violationRatio,
myViolationScale(violationRatio*100)),
getSynchronousOverlay(stats.aggStats[activityName].syncMove)
])
Expand All @@ -86,9 +86,9 @@ function visualizeAlignment(alignedTraces){
colorScale: myViolationScale,
title: "% deviations (model moves)"
})

overlayLegend({
leftOverlayLegend: "# conformoties\n(synchronous moves)",
leftOverlayLegend: "# conformities\n(synchronous moves)",
rightOverlayLegend : "# deviations\n(model moves)"})
}

Expand All @@ -102,11 +102,11 @@ function getAlignmentDecorations(alignments){
result[elt.bpmnSemantic.name] = {syncMove: 0, modelMove: 0}
return result
})

//convert the list aggStats to one object whose keys are the activity names
aggStats = aggStats.reduce(function(obj,item){
const key = Object.keys(item)[0]
obj[key] = item[key];
obj[key] = item[key];
return obj;
}, {});

Expand All @@ -118,7 +118,7 @@ function getAlignmentDecorations(alignments){
//pair[0] is a trace_move, pair[1] is a model_move
if(pair[1] && pair[1] != '>>'){ //pair[1] is not null (tau transitions from petri net) and it is not a log move
pair[1] === pair[0]? aggStats[pair[1]].syncMove++ : aggStats[pair[1]].modelMove++
}
}
}
}

Expand All @@ -129,4 +129,4 @@ function getAlignmentDecorations(alignments){
);

return {"aggStats": aggStats, "normalizedStats": normalizedStats}
}
}

0 comments on commit 64c0b91

Please sign in to comment.