RenderEntity<TEntity extends Entity>

A default component that visualizes entities in the company ownership diagram. The detail view displays a data grid of all available properties on the entity. The overview visualization only shows the entities name or id. The component can be adjusted for each entity individually or for all entities at once by setting Entity.className or Entity.style in the data.

The component is used as the default visualization if no renderEntity prop is specified on CompanyOwnership. However, it can be integrated in another component, for example, to have different styles for different items.

function CompanyOwnershipComponent() {
    const MyCompanyOwnershipItem = useMemo(
      () => (props: RenderEntityProps<CompanyOwnershipItem>) => {
        const { dataItem } = props
        if (dataItem?.name?.includes('Plate')) {
          return (
            <>
              <div
                style={{
                  backgroundColor: 'lightblue',
                  width: '100%',
                  height: '100%'
                }}
              >
                <div>{dataItem.name}</div>
              </div>
            </>
          )
        } else {
          return <RenderEntity {...props}></RenderEntity>
        }
      },
      []
    )

    return (
      <CompanyOwnership data={data} renderEntity={MyCompanyOwnershipItem}></CompanyOwnership>
    )
  }

Props

RenderEntityProps

NameDescriptionType
dataItem
The data item to render.
TDataItem
detail
The detail level of the visualization. Use this value to implement level-of-detail rendering.
”low” | “high”
focused
Whether the item is currently focused.
boolean
height
The height of the item.
number
hovered
Whether the item is currently being hovered.
boolean
selected
Whether the item is currently selected.
boolean
width
The width of the item.
number