|
1 | 1 | import globals from './globals.js'; |
2 | | -import { mxgraph } from './mxgraph-initializer'; |
3 | 2 |
|
4 | | -import { FitType, ShapeBpmnElementKind } from 'bpmn-visualization'; |
| 3 | +import { FitType, mxgraph, ShapeBpmnElementKind } from 'bpmn-visualization'; |
5 | 4 | import { frequencyScale } from './colors.js' |
6 | 5 | import { getFrequencyOverlay } from './overlays.js'; |
7 | 6 | import { colorLegend, overlayLegend } from './legend.js'; |
@@ -56,18 +55,19 @@ function visualizeFrequency(data) { |
56 | 55 | if (activityElement) { |
57 | 56 | const activityCell = graph.getModel().getCell(activityElement.bpmnSemantic.id) |
58 | 57 | let style = graph.getModel().getStyle(activityCell); |
59 | | - style = mxgraph.mxUtils.setStyle(style, mxgraph.mxConstants.STYLE_FILLCOLOR, myFrequencyScale(freqValue)) |
| 58 | + |
| 59 | + style = mxgraph.mxUtils.setStyle(style, mxgraph.mxConstants.STYLE_FILLCOLOR, myFrequencyScale(freqValue)) |
60 | 60 | if (freqValue > avg) { |
61 | 61 | style = mxgraph.mxUtils.setStyle(style, mxgraph.mxConstants.STYLE_FONTCOLOR, 'white') |
62 | 62 | } |
63 | 63 | graph.getModel().setStyle(activityCell, style); |
64 | 64 |
|
65 | | - //add frequency overlay |
66 | | - globals.bpmnVisualization.bpmnElementsRegistry.addOverlays( |
67 | | - activityElement.bpmnSemantic.id, |
68 | | - getFrequencyOverlay(freqValue, max, myFrequencyScale(freqValue))) |
69 | | - } |
70 | | - } |
| 65 | + //add frequency overlay |
| 66 | + globals.bpmnVisualization.bpmnElementsRegistry.addOverlays( |
| 67 | + activityElement.bpmnSemantic.id, |
| 68 | + getFrequencyOverlay(freqValue, max, |
| 69 | + myFrequencyScale(freqValue))) |
| 70 | + }} |
71 | 71 | // Allow to save the style in a new state, in particular keep the rounded activity |
72 | 72 | graph.refresh(); |
73 | 73 | } finally { |
|
0 commit comments