Skip to content

LocalGraphView

Extends

Properties

_children

_children: Component[]

Child Components attached to current component, will be unloaded on unloading parent component

Inherited from

InfoFileView._children


_events

_events: EventRef[]

Events that are attached to the current component, will be detached on unloading parent component

Inherited from

InfoFileView._events


_loaded

_loaded: boolean

Whether the component and its children are loaded

Inherited from

InfoFileView._loaded


actionsEl

actionsEl: HTMLElement

Container of actions for the view

Inherited from

InfoFileView.actionsEl


allowNoFile

allowNoFile: boolean

Inherited from

InfoFileView.allowNoFile


app

app: App

Inherited from

InfoFileView.app


backButtonEl

backButtonEl: HTMLButtonElement

Back button element for changing view history

Inherited from

InfoFileView.backButtonEl


canDropAnywhere

canDropAnywhere: boolean

Whether the view may be dropped anywhere in workspace

Inherited from

InfoFileView.canDropAnywhere


closeable

closeable: boolean

Whether the leaf may close the view

Inherited from

InfoFileView.closeable


containerEl

containerEl: HTMLElement

Inherited from

InfoFileView.containerEl


contentEl

contentEl: HTMLElement

Inherited from

InfoFileView.contentEl


file

file: null | TFile

Inherited from

InfoFileView.file


forwardButtonEl

forwardButtonEl: HTMLButtonElement

Forward button element for changing view history

Inherited from

InfoFileView.forwardButtonEl


headerEl

headerEl: HTMLElement

Header bar container of view

Inherited from

InfoFileView.headerEl


icon

icon: string

Inherited from

InfoFileView.icon


iconEl

iconEl: HTMLElement

Icon element for the view (for dragging)

Inherited from

InfoFileView.iconEl


leaf

leaf: WorkspaceLeaf

Inherited from

InfoFileView.leaf


moreOptionsButtonEl

moreOptionsButtonEl: HTMLAnchorElement

Anchor button for revealing more view actions

Inherited from

InfoFileView.moreOptionsButtonEl


navigation: boolean

Whether or not the view is intended for navigation. If your view is a static view that is not intended to be navigated away, set this to false. (For example: File explorer, calendar, etc.) If your view opens a file or can be otherwise navigated, set this to true. (For example: Markdown editor view, Kanban view, PDF view, etc.)

Inherited from

InfoFileView.navigation


scope

scope: null | Scope

Assign an optional scope to your view to register hotkeys for when the view is in focus.

Example

this.scope = new Scope(this.app.scope);

Default

null
@public

Inherited from

InfoFileView.scope


titleContainerEl

titleContainerEl: HTMLElement

Container for the title of the view

Inherited from

InfoFileView.titleContainerEl


titleEl

titleEl: HTMLElement

Title element for the view

Inherited from

InfoFileView.titleEl


titleParentEl

titleParentEl: HTMLElement

Title of the parent

Inherited from

InfoFileView.titleParentEl

Methods

addAction()

addAction(icon, title, callback)

addAction(icon, title, callback): HTMLElement

Parameters

icon: string

title: string

callback

Returns

HTMLElement

Inherited from

InfoFileView.addAction

addAction(icon, title, callback)

addAction(icon, title, callback): HTMLElement

Adds an action button to the header of the view

Parameters

icon: string

The icon for the action

title: string

The title for the action

callback

Callback to execute on click

Returns

HTMLElement

Inherited from

InfoFileView.addAction


addChild()

addChild<T>(component): T

Adds a child component, loading it if this component is loaded

Type Parameters

T extends Component

Parameters

component: T

Returns

T

Inherited from

InfoFileView.addChild


canAcceptExtension()

canAcceptExtension(extension)

canAcceptExtension(extension): boolean

Parameters

extension: string

Returns

boolean

Inherited from

InfoFileView.canAcceptExtension

canAcceptExtension(extension)

canAcceptExtension(extension): boolean

Determines whether the specified file extension can be opened in this view.

Parameters

extension: string

The file extension to be evaluated

Returns

boolean

Inherited from

InfoFileView.canAcceptExtension


close()

close(): Promise<void>

Closes the view

Returns

Promise<void>

Inherited from

InfoFileView.close


getDisplayText()

getDisplayText(): string

Returns

string

Inherited from

InfoFileView.getDisplayText


getEphemeralState()

getEphemeralState()

getEphemeralState(): Record<string, unknown>

Returns

Record<string, unknown>

Inherited from

InfoFileView.getEphemeralState

getEphemeralState()

getEphemeralState(): object

Gets the ephemeral (non-persistent) state of the editor

Returns

object

Inherited from

InfoFileView.getEphemeralState


getIcon()

getIcon()

getIcon(): string

Returns

string

Inherited from

InfoFileView.getIcon

getIcon()

getIcon(): string

Returns the icon name

Returns

string

Inherited from

InfoFileView.getIcon


getSideTooltipPlacement()

getSideTooltipPlacement(): undefined | "left" | "right"

Returns the placement of the tooltip

Returns

undefined | "left" | "right"

Inherited from

InfoFileView.getSideTooltipPlacement


getState()

getState(): Record<string, unknown>

Returns

Record<string, unknown>

Inherited from

InfoFileView.getState


getSyncViewState()

getSyncViewState(): any

Get view state for sync plugin

Returns

any

Inherited from

InfoFileView.getSyncViewState


getViewType()

getViewType(): "localgraph"

Get the current view type

Returns

"localgraph"

Overrides

InfoFileView.getViewType


handleCopy()

handleCopy(event): void

Handle copy event on metadata editor and serialize properties

Parameters

event: ClipboardEvent

Returns

void

Inherited from

InfoFileView.handleCopy


handleCut()

handleCut(event): void

Handle cut event on metadata editor and serialize and remove properties

Parameters

event: ClipboardEvent

Returns

void

Inherited from

InfoFileView.handleCut


handleDrop()

handleDrop(event, t, n): unknown

Parameters

event: DragEvent

t: unknown

n: unknown

Returns

unknown

Inherited from

InfoFileView.handleDrop


handlePaste()

handlePaste(event): void

Handle paste event of properties on metadata editor

Parameters

event: ClipboardEvent

Returns

void

Inherited from

InfoFileView.handlePaste


load()

load(): void

Load this component and its children

Returns

void

Inherited from

InfoFileView.load


loadFile()

loadFile(file): Promise<unknown>

Loads the file with the onLoadFile function

Parameters

file: TFile

The File to load

Returns

Promise<unknown>

Inherited from

InfoFileView.loadFile


onClose()

onClose(): Promise<void>

Returns

Promise<void>

Inherited from

InfoFileView.onClose


onDelete()

onDelete(file): Promise<void>

Updates the view if it contains the deleted file

Parameters

file: TFile

The file that is deleted

Returns

Promise<void>

Inherited from

InfoFileView.onDelete


onFileChanged()

onFileChanged(file): void

Requests a update if the changed file is the opened file

Parameters

file: TFile

The changed file

Returns

void


onFileOpen()

onFileOpen(file): void

Called when a file is opened. Loads the file and requests a content update

Parameters

file: TFile

The opened file

Returns

void

Inherited from

InfoFileView.onFileOpen


onGroupChange()

onGroupChange(): void

Returns

void

Inherited from

InfoFileView.onGroupChange


onHeaderMenu()

onHeaderMenu(e): void

Parameters

e: unknown

Returns

void

Inherited from

InfoFileView.onHeaderMenu


onload()

onload(): void

Returns

void

Inherited from

InfoFileView.onload


onLoadFile()

onLoadFile(file)

onLoadFile(file): Promise<void>

Parameters

file: TFile

Returns

Promise<void>

Inherited from

InfoFileView.onLoadFile

onLoadFile(file)

onLoadFile(file): Promise<void>

Is called when a file get loaded

Parameters

file: TFile

The file that is loaded

Returns

Promise<void>

Inherited from

InfoFileView.onLoadFile


onMoreOptions()

onMoreOptions(event): void

Parameters

event: Event

Returns

void

Inherited from

InfoFileView.onMoreOptions


onMoreOptionsMenu()

onMoreOptionsMenu(e): void

Parameters

e: unknown

Returns

void

Inherited from

InfoFileView.onMoreOptionsMenu


onOpen()

onOpen(): Promise<void>

Returns

Promise<void>

Inherited from

InfoFileView.onOpen


onOptionsChange()

onOptionsChange(): void

Updates the options from the plugin when changed in view

Returns

void


onPaneMenu()

onPaneMenu(menu, source): void

Populates the pane menu.

(Replaces the previously removed onHeaderMenu and onMoreOptionsMenu)

Parameters

menu: Menu

source: string

Returns

void

Inherited from

InfoFileView.onPaneMenu


onRename()

onRename(file)

onRename(file): Promise<void>

Parameters

file: TFile

Returns

Promise<void>

Inherited from

InfoFileView.onRename

onRename(file)

onRename(file): Promise<void>

Updates the view information based on the new file name

Parameters

file: TFile

The file that is renamed

Returns

Promise<void>

Inherited from

InfoFileView.onRename


onResize()

onResize(): void

Called when the size of this view is changed.

Returns

void

Inherited from

InfoFileView.onResize


onTabMenu()

onTabMenu(menu): void

Adds the menu items to the menu

Parameters

menu: Menu

the menu to fill

Returns

void

Inherited from

InfoFileView.onTabMenu


onunload()

onunload(): void

Override this to unload your component

Returns

void

Inherited from

InfoFileView.onunload


onUnloadFile()

onUnloadFile(file)

onUnloadFile(file): Promise<void>

Parameters

file: TFile

Returns

Promise<void>

Inherited from

InfoFileView.onUnloadFile

onUnloadFile(file)

onUnloadFile(file): Promise<void>

Is called when a file get unloaded

Parameters

file: TFile

The file that is unloaded

Returns

Promise<void>

Inherited from

InfoFileView.onUnloadFile


open()

open(parentEl): Promise<void>

Opens the view

Parameters

parentEl: Node

The node the view get attached to

Returns

Promise<void>

Inherited from

InfoFileView.open


register()

register(cb): void

Registers a callback to be called when unloading

Parameters

cb

Returns

void

Inherited from

InfoFileView.register


registerDomEvent()

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof WindowEventMap

Parameters

el: Window

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

InfoFileView.registerDomEvent

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof DocumentEventMap

Parameters

el: Document

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

InfoFileView.registerDomEvent

registerDomEvent(el, type, callback, options)

registerDomEvent<K>(el, type, callback, options?): void

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof HTMLElementEventMap

Parameters

el: HTMLElement

type: K

callback

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

InfoFileView.registerDomEvent


registerEvent()

registerEvent(eventRef): void

Registers an event to be detached when unloading

Parameters

eventRef: EventRef

Returns

void

Inherited from

InfoFileView.registerEvent


registerInterval()

registerInterval(id): number

Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API

Parameters

id: number

Returns

number

Inherited from

InfoFileView.registerInterval


registerScopeEvent()

registerScopeEvent(keymapEventHandler): void

Parameters

keymapEventHandler: KeymapEventHandler

Returns

void

Inherited from

InfoFileView.registerScopeEvent


removeChild()

removeChild<T>(component): T

Removes a child component, unloading it

Type Parameters

T extends Component

Parameters

component: T

Returns

T

Inherited from

InfoFileView.removeChild


renderBreadcrumbs()

renderBreadcrumbs(): void

Returns

void

Inherited from

InfoFileView.renderBreadcrumbs


setEphemeralState()

setEphemeralState(state)

setEphemeralState(state): void

Parameters

state: unknown

Returns

void

Inherited from

InfoFileView.setEphemeralState

setEphemeralState(state)

setEphemeralState(state): void

Set the ephemeral (non-persistent) state of the editor

Parameters

state: any

Returns

void

Inherited from

InfoFileView.setEphemeralState


setState()

setState(state, result): Promise<void>

Parameters

state: any

result: ViewStateResult

Returns

Promise<void>

Inherited from

InfoFileView.setState


syncState()

syncState(e): Promise<unknown>

Parameters

e: boolean

Returns

Promise<unknown>

Inherited from

InfoFileView.syncState


unload()

unload(): void

Unload this component and its children

Returns

void

Inherited from

InfoFileView.unload


update()

update(): void

Renders the graph

Returns

void


updateNavButtons()

updateNavButtons(): void

Updates the navigation buttons depending on the history

Returns

void

Inherited from

InfoFileView.updateNavButtons