コンテンツへスキップ

pivotick v3.0.0


ピボット / RendererOptions / NodeBadge

インターフェース: NodeBadge ​

定義: interfaces/RendererOptions.ts:393

ノードの縁に固定される小さなインジケーターです。KeyLines や ReGraph ではグリフと呼ばれます。

Badges are a decoration channel of their own, so a node can carry a fact that color, shape, size, iconClass and imagePath are already spent on. 以下についてのみ説明します。 node they sit on: a collapsed cluster does not aggregate its children's badges — walk それを望むなら、node.children自分自身で。

例 ​

js
defaultNodeStyle: {
    badges: node => node.getData().notes
        ? [{ text: String(node.getData().notes), title: 'Notes', onClick: () => openNotes(node) }]
        : [],
}

プロパティ ​

color? ​

optional color: string

定義: interfaces/RendererOptions.ts:401

任意のCSS色。

デフォルト ​

var(--pvt-badge-color)


iconClass? ​

optional iconClass: string

定義: interfaces/RendererOptions.ts:407


iconUnicode? ​

optional iconUnicode: string

定義: interfaces/RendererOptions.ts:408


onClick()? ​

optional onClick: (event, node, badge) => void

定義: interfaces/RendererOptions.ts:420

バッジがクリックされたときに、InterractionCallbacks.onBadgeClick より先に呼び出されます。

Declaring it makes the badge take the pointer cursor and consume the click, so the ノードも選択されていません。 A badge without one stays transparent to the node underneath. Pressing a badge still drags the node either way.

パラメータ ​

event ​

PointerEvent

node ​

Node

badge ​

NodeBadge

返品 ​

void


position? ​

optional position: NodeBadgePosition

定義: interfaces/RendererOptions.ts:399

どの隅に座るか。 Omit it and the badge is auto-placed in the first free corner, 'ne'から時計回りに。 An explicit position is honoured verbatim, even where that 別のバッジまたは拡張アフォーダンスと重複します。


svgIcon? ​

optional svgIcon: string

定義: interfaces/RendererOptions.ts:410

DOM に挿入する前にサニタイズされるインライン SVG マークアップ。


text? ​

optional text: string

定義: interfaces/RendererOptions.ts:406

カウント、または 1 文字または 2 文字。テキストが長いと、バッジが丸薬に成長します。過去3回 文字は 99+ としてレンダリングされます。 Takes precedence over any icon on the same badge.


title? ​

optional title: string

定義: interfaces/RendererOptions.ts:412

ネイティブのツールチップ。実際の <title> としてレンダリングされます。グラフ自体のツールチップを抑制しません。