Improve this doc View source

pfTopology
directive in module patternfly.charts

Description

Component for rendering a topology chart. Individual nodes and relationships can be represented with this view. CSS is especially important for rendering the nodes and lines. The example inline contains specific examples that can be used to change the icon size and the line type of the relationships.

In addition; searching, filtering and label visibility is also supported.

Usage

as element:
<pf-topology
       items="{object}"
       relations="{object}"
       icons="{object}"
       selection="{object}"
       force="{object}"
       nodes="{object}"
       search-text="{string}"
       kinds="{object}"
       chart-rendered="{function (vertices, added) }"
       item-selected="{boolean}"
       show-labels="{boolean}"
       tooltip-function="{function (node) }">
</pf-topology>

Parameters

ParamTypeDetails
itemsobject

items to display in the topology chart, each is represented as an individual node. The keys of this object are used in the relations attribute. The items should have a item.kind attribute, as well as the usual item.metadata and so on.:

  • .name - name of the item the node represents
  • .status - optional status of the node (can be used to differentiate the circle color)
  • .kind - the kind of node - this is a general key that needs to be unique for grouping the nodes Filtering and styles use this value as well to correctly select the nodes.
relationsobject

the object containing all of the node relationships:

  • .source - the key of the source node
  • .target - the key of the target node
iconsobject

The different icons to be used in the node representations

selectionobject

The item to be selected

forceobject

Optional. A D3 force layout to use instead of creating one by default. The force layout size will be updated, and layout will be started as appropriate.

nodesobject

The node configuration for the various types of nodes

searchTextstring

Search text which is watched for changes and highlights the nodes matching the search text

kindsobject

The different kinds of nodes represented in the topology chart

chartRenderedfunction (vertices, added)

The argument will be D3 selection of elements that correspond to items. Each item has its data set to one of the items. The default implementation of this event sets the title from Kubernetes metadata and tweaks the look of for certain statuses. Use event.preventDefault() to prevent this default behavior.

itemSelectedboolean

A function that is dispatched when an item is selected (along with the node data associated with the function

showLabelsboolean

A watched boolean that determines whether or not lables should be displayed beneath the nodes

tooltipFunctionfunction (node)

A passed in tooltip function which can be used to overwrite the default tooltip behavior

Example

Source







Demo