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

Param | Type | Details
--- | --- | ---

items

object

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.

relations

object

the object containing all of the node relationships:

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

icons | object | The different icons to be used in the node representations
selection | object | The item to be selected
force | object | 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.
nodes | object | The node configuration for the various types of nodes
searchText | string | Search text which is watched for changes and highlights the nodes matching the search text
kinds | object | The different kinds of nodes represented in the topology chart
chartRendered | function (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.
itemSelected | boolean | A function that is dispatched when an item is selected (along with the node data associated with the function
showLabels | boolean | A watched boolean that determines whether or not lables should be displayed beneath the nodes
tooltipFunction | function (node) | A passed in tooltip function which can be used to overwrite the default tooltip behavior

## Example

#### Source

#### Demo