コンテンツへスキップ

pivotick v3.0.0


ピボット / GraphUI / ExtraPanel

インターフェース: ExtraPanel ​

定義: interfaces/GraphUI.ts:993

グラフ UI のサイドバーの追加パネル。

title と render は両方とも次のようになります。

  • 静的コンテンツの場合は文字列または HTMLElement、または
  • 現在の選択の関数 (Node、Edge、いずれかの配列) 複数選択の場合、または何も選択されていない場合は null) — 再度呼び出されます ExtraPanel.reactive が false でない限り、すべての選択は変更されます。

UI.extraPanels を介して前もってパネルを宣言するか、任意の時点でパネルを登録します。 graph.UIManager.addPanel() によるグラフの寿命 (ディスポーザーを返します)。

例 ​

ts
{
    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? ​

optional alwaysVisible: boolean

定義: interfaces/GraphUI.ts:1011

パネルは常に表示されるべきですか

デフォルト ​

ts
false

id? ​

optional id: string

定義: interfaces/GraphUI.ts:998

安定した識別子。removePanel / でパネルをアドレス指定するために使用されます。 refreshPanel。省略時は自動生成されます。


order? ​

optional order: number

定義: interfaces/GraphUI.ts:1018

サイドバーの表示順序は昇順です。 order キープを共有するパネル 登録順序なので、UI.extraPanels は上から下に読み、 実行時パネルはその後に追加されます。

デフォルト ​

ts
0

reactive? ​

optional reactive: boolean

定義: interfaces/GraphUI.ts:1026

選択が変更されるたびに、title と render を再解決します。セット false 製作費が高く、説明が記載されていないパネルの場合 選択: その後 1 回レンダリングされ、明示的な refreshPanel() のみがレンダリングされます。 それを再構築します。

デフォルト ​

ts
true

render ​

render: ExtraPanelContent

定義: interfaces/GraphUI.ts:1006

string はプレーンテキストとしてレンダリングされます。 HTMLElement を渡して HTML をレンダリングします。


title? ​

optional title: ExtraPanelContent

定義: interfaces/GraphUI.ts:1004

パネルのヘッダー行。 string はプレーンテキストとしてレンダリングされます。渡す HTMLElement を使用して HTML をレンダリングします。パネルの場合は省略します (または空白に解決します)。 ヘッダーがまったくありません。