panels.kg_context ================= .. py:module:: panels.kg_context .. autoapi-nested-parse:: KG Context panel: component seeding, subgraph topology, failure modes, events. Reads the ``kg_context`` artifact to render a seed-match bar chart, an interactive Pyvis subgraph (asset, components, failure modes, past events, upstream paths), and filterable tables of failure modes, in-scope documents (with extracted causal statements), and a past-event timeline. Attributes ---------- .. autoapisummary:: panels.kg_context.JsonDict Functions --------- .. autoapisummary:: panels.kg_context.build_component_seed_chart panels.kg_context.build_pyvis_html panels.kg_context._cached_pyvis_html panels.kg_context.render_kg_panel panels.kg_context.truncate_safe Module Contents --------------- .. py:data:: JsonDict .. py:function:: build_component_seed_chart(kg_context) Build a bar chart of components grouped by ``seed_match_type``. @ In, kg_context, dict, the ``kg_context`` artifact; reads ``components[]`` ``seed_match_type``/``component_type`` @ Out, fig, plotly.graph_objects.Figure, the chart, or None if no components .. py:function:: build_pyvis_html(kg_context, height_px = 480) Components, failure modes, optional asset + past events — from kg_context JSON only. .. py:function:: _cached_pyvis_html(kg_json, height_px) .. py:function:: render_kg_panel(kg_context) Render the KG Context section. @ In, kg_context, dict, the ``kg_context`` artifact; reads ``components``, ``failure_modes``, ``past_events``, ``documents``, ``upstream_paths``, ``asset_id``; None shows an info note @ Out, None .. py:function:: truncate_safe(val, n) Stringify a value and truncate to ``n`` characters with an ellipsis. @ In, val, object, the value to stringify (None becomes "") @ In, n, int, maximum length of the returned string @ Out, out, str, the (possibly truncated) string