diff --git a/src/components/editor/faultTree/shapes/RenderTree.tsx b/src/components/editor/faultTree/shapes/RenderTree.tsx index fd6f37ac..4c4aeabf 100644 --- a/src/components/editor/faultTree/shapes/RenderTree.tsx +++ b/src/components/editor/faultTree/shapes/RenderTree.tsx @@ -81,6 +81,11 @@ const renderTree = async (container, node, parentShape = null, pathsToHighlight, } } + if (isReferencedNode(node) && node.supertypes?.hasFailureRate?.requirement?.upperBound) { + const probReqValue = node.supertypes.hasFailureRate.requirement.upperBound.toExponential(2); + nodeShape.attr(["probabilityRequirementLabel", "text"], probReqValue); + } + if (has(node, "probabilityRequirement")) { nodeShape.attr(["probabilityRequirementLabel", "text"], node.probabilityRequirement.toExponential(2)); } 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,