From 64c0b91bd8f0aa236df0aeb91cd1db8d6f2fc4a7 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Fri, 24 Feb 2023 17:25:30 +0100 Subject: [PATCH] fix(conformance): fix typo in legend --- frontend/src/conformance.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/conformance.js b/frontend/src/conformance.js index c0dbef4..7072446 100644 --- a/frontend/src/conformance.js +++ b/frontend/src/conformance.js @@ -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) @@ -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); } @@ -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) ]) @@ -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)"}) } @@ -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; }, {}); @@ -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++ - } + } } } @@ -129,4 +129,4 @@ function getAlignmentDecorations(alignments){ ); return {"aggStats": aggStats, "normalizedStats": normalizedStats} -} \ No newline at end of file +}