インターフェース: ExtraPanel
グラフ UI のサイドバーの追加パネル。
title と render は両方とも次のようになります。
- 静的コンテンツの場合は文字列または
HTMLElement、または - 現在の選択の関数 (
Node、Edge、いずれかの配列) 複数選択の場合、または何も選択されていない場合はnull) — 再度呼び出されます ExtraPanel.reactive がfalseでない限り、すべての選択は変更されます。
UI.extraPanels を介して前もってパネルを宣言するか、任意の時点でパネルを登録します。 graph.UIManager.addPanel() によるグラフの寿命 (ディスポーザーを返します)。
例
{
id: 'description',
title: 'Description',
render: (element): HTMLElement => {
const node = element instanceof Node ? element : null
const div = document.createElement('div')
div.textContent = node?.getData().description ?? 'Empty node description'
return div
},
}延長により
プロパティ
alwaysVisible?
optionalalwaysVisible:boolean
定義: interfaces/GraphUI.ts:1011
パネルは常に表示されるべきですか
デフォルト
falseid?
optionalid:string
安定した識別子。removePanel / でパネルをアドレス指定するために使用されます。 refreshPanel。省略時は自動生成されます。
order?
optionalorder:number
定義: interfaces/GraphUI.ts:1018
サイドバーの表示順序は昇順です。 order キープを共有するパネル 登録順序なので、UI.extraPanels は上から下に読み、 実行時パネルはその後に追加されます。
デフォルト
0reactive?
optionalreactive:boolean
定義: interfaces/GraphUI.ts:1026
選択が変更されるたびに、title と render を再解決します。セット false 製作費が高く、説明が記載されていないパネルの場合 選択: その後 1 回レンダリングされ、明示的な refreshPanel() のみがレンダリングされます。 それを再構築します。
デフォルト
truerender
render:
ExtraPanelContent
定義: interfaces/GraphUI.ts:1006
string はプレーンテキストとしてレンダリングされます。 HTMLElement を渡して HTML をレンダリングします。
title?
optionaltitle:ExtraPanelContent
定義: interfaces/GraphUI.ts:1004
パネルのヘッダー行。 string はプレーンテキストとしてレンダリングされます。渡す HTMLElement を使用して HTML をレンダリングします。パネルの場合は省略します (または空白に解決します)。 ヘッダーがまったくありません。