#6992 exposes GraphView through window.pluginLib.ResourceMap — thank you,
this unblocked embedding graphs in the kro plugin (headlamp-k8s/plugins,
kro 0.2.0-alpha). Using it on plugin detail pages surfaced a set of
behaviors that make sense for the full-page Map but are surprising for an
embedded section. Requesting an opt-in embedded mode (or props) that:
- Controlled/uncontrolled selection without URL sync.
GraphView reads
and writes the page's ?node= and ?group= query params
(useQueryParamsState), so an embedded graph mutates the host page's URL
and participates in browser history. Two GraphViews on one page would
fight over the same params. An embedded mode should keep selection in
component state (or accept selectedNode/onNodeSelect props).
- No global namespace-filter coupling. Mounting dispatches
setNamespaceFilter([]) when the URL has no ?namespace=, resetting the
user's app-wide namespace selection as a side effect of visiting any page
that embeds a graph.
- Sources isolation.
defaultSources is appended to, not substituted
for, all globally registered plugin sources; there is no way to render
only the sources the caller passes. (Today the workaround is
defaultNodeSelection + connected-component collapsing, plus id-matched
first-wins dedupe.)
- Hideable chrome. The namespace autocomplete, source picker, group-by
chips, and filters cannot be hidden; an embedded section usually wants
just the canvas (or a reduced toolbar).
- Skip unneeded discovery.
useGetAllSources() (cluster-wide CRD list,
API discovery, VPA/Gateway probes) runs even when the caller passes
defaultSources only.
- Minor:
GraphViewProps is not exported from the barrel, so plugin
wrappers cannot type their pass-through props; and the lazy wrapper's
Suspense fallback={null} causes a layout jump unless the caller
reserves height.
Alternatively, exporting the lower-level pieces (GraphRenderer,
GraphSourceManager, applyGraphLayout, GraphNodeDetails) would let
plugins compose a bare renderer themselves.
#6992 exposes
GraphViewthroughwindow.pluginLib.ResourceMap— thank you,this unblocked embedding graphs in the kro plugin (headlamp-k8s/plugins,
kro0.2.0-alpha). Using it on plugin detail pages surfaced a set ofbehaviors that make sense for the full-page Map but are surprising for an
embedded section. Requesting an opt-in embedded mode (or props) that:
GraphViewreadsand writes the page's
?node=and?group=query params(
useQueryParamsState), so an embedded graph mutates the host page's URLand participates in browser history. Two GraphViews on one page would
fight over the same params. An
embeddedmode should keep selection incomponent state (or accept
selectedNode/onNodeSelectprops).setNamespaceFilter([])when the URL has no?namespace=, resetting theuser's app-wide namespace selection as a side effect of visiting any page
that embeds a graph.
defaultSourcesis appended to, not substitutedfor, all globally registered plugin sources; there is no way to render
only the sources the caller passes. (Today the workaround is
defaultNodeSelection+ connected-component collapsing, plus id-matchedfirst-wins dedupe.)
chips, and filters cannot be hidden; an embedded section usually wants
just the canvas (or a reduced toolbar).
useGetAllSources()(cluster-wide CRD list,API discovery, VPA/Gateway probes) runs even when the caller passes
defaultSourcesonly.GraphViewPropsis not exported from the barrel, so pluginwrappers cannot type their pass-through props; and the lazy wrapper's
Suspense fallback={null}causes a layout jump unless the callerreserves height.
Alternatively, exporting the lower-level pieces (
GraphRenderer,GraphSourceManager,applyGraphLayout,GraphNodeDetails) would letplugins compose a bare renderer themselves.