diff --git a/src/components/editor/faultTree/shapes/RenderTree.tsx b/src/components/editor/faultTree/shapes/RenderTree.tsx index d350409c..469b0c6a 100644 --- a/src/components/editor/faultTree/shapes/RenderTree.tsx +++ b/src/components/editor/faultTree/shapes/RenderTree.tsx @@ -82,9 +82,14 @@ const renderTree = async (container, node, parentShape = null, pathsToHighlight, } } - if (has(node, "probabilityRequirement")) { - nodeShape.attr(["probabilityRequirementLabel", "text"], node.probabilityRequirement.toExponential(2)); + const probReqValue = + (isReferencedNode(node) && node.supertypes?.hasFailureRate?.requirement?.upperBound?.toExponential(2)) || + (has(node, "probabilityRequirement") && node.probabilityRequirement.toExponential(2)); + + if (probReqValue) { + nodeShape.attr(["probabilityRequirementLabel", "text"], probReqValue); } + if (shouldHighlight) { nodeShape.attr("body/stroke", ERROR_PATH_COLOR); nodeShape.attr("body/fill", ERROR_PATH_COLOR); diff --git a/src/components/editor/faultTree/shapes/shapesDefinitions.tsx b/src/components/editor/faultTree/shapes/shapesDefinitions.tsx index c8d2efc8..13daaeb5 100644 --- a/src/components/editor/faultTree/shapes/shapesDefinitions.tsx +++ b/src/components/editor/faultTree/shapes/shapesDefinitions.tsx @@ -183,6 +183,10 @@ export const ExternalEvent = Event.define( }, refY2: -20, }, + probabilityRequirementLabel: { + fontSize: 16, + refX: "120%", + }, gate: { d: "M -15 -16 L 0 -30 L 15 -16 L 15 0 L -15 0 Z M 0 -30 L 0 -59", stroke: STROKE_COLOR,