Skip to content

@graphty/graphty-element / index / SourceLoadOptions

Interface: SourceLoadOptions ​

Defined in: graphty-element/src/session/sources/types.ts:23

How a load from a network source runs. The credential is used for this call only: it is never recorded, journaled, saved or sent in an event. Experimental.

Extends ​

Properties ​

credential? ​

readonly optional credential?: Credential

Defined in: graphty-element/src/session/sources/types.ts:27

The credential; looked up in the element's credential store by source and origin when absent.


cursor? ​

readonly optional cursor?: Readonly<Record<string, string | number | boolean | null>>

Defined in: graphty-element/src/session/sources/types.ts:37

Where to resume a capped load.


directed? ​

readonly optional directed?: boolean | "auto"

Defined in: graphty-element/src/session/types.ts:1614

Writes data.directed in the same step.

Inherited from ​

LoadChoices.directed


duplicateIds? ​

readonly optional duplicateIds?: "first" | "refuse" | "merge"

Defined in: graphty-element/src/session/types.ts:1612

A node row repeating an id an earlier node row of the same load gave: "first" (the default) keeps the first row's node and leaves the later row out; "merge" also writes the later row's values onto that node, later rows winning; "refuse" refuses the load with E_DUPLICATE_ID (details.id). Every case is counted in LoadReport.duplicates, which a report() fills under "refuse" instead of refusing. A row with no usable id is never a duplicate: it is rejected and counted in counts.rejected.

OPEN UNION: later releases may add policies.

Inherited from ​

LoadChoices.duplicateIds


endpoint? ​

readonly optional endpoint?: string

Defined in: graphty-element/src/session/sources/types.ts:29

The service's address; the source's default when absent.


existing? ​

readonly optional existing?: "keep" | "update"

Defined in: graphty-element/src/session/sources/types.ts:25

For mode: "merge": keep (the default) or update the attributes of a node already there.


fetch? ​

readonly optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: graphty-element/src/session/sources/types.ts:41

The fetch to use instead of the global one: recorded responses in a test or a story.

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise<Response>

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

string | URL | Request

init? ​

RequestInit

Returns ​

Promise<Response>


layout? ​

readonly optional layout?: "keep" | "recommended"

Defined in: graphty-element/src/session/types.ts:1730

"recommended" also chooses a layout for what was loaded, from its shape and its coordinates, in the same step; "keep" (the default) leaves the layout as it is.

Inherited from ​

LoadChoices.layout


limits? ​

readonly optional limits?: SourceLimitOptions

Defined in: graphty-element/src/session/sources/types.ts:33

The caps; every default is "no limit".


mapping? ​

readonly optional mapping?: LoadMapping

Defined in: graphty-element/src/session/types.ts:1596

The column roles; a role left out is the element's own reading.

Inherited from ​

LoadChoices.mapping


mode? ​

readonly optional mode?: "replace" | "merge"

Defined in: graphty-element/src/session/types.ts:1725

"replace" (the default) empties the graph first, in the same step; "merge" adds to it.

Inherited from ​

LoadChoices.mode


retry? ​

readonly optional retry?: false | RetryOptions

Defined in: graphty-element/src/session/sources/types.ts:35

How to retry, or false never to.


signal? ​

readonly optional signal?: AbortSignal

Defined in: graphty-element/src/session/sources/types.ts:39

Cancels the load.


styleOptions? ​

readonly optional styleOptions?: FileStyleOptions

Defined in: graphty-element/src/session/types.ts:1626

How a file's styles are turned into layers, when styles is "file".

Inherited from ​

LoadChoices.styleOptions


styles? ​

readonly optional styles?: "file" | "none"

Defined in: graphty-element/src/session/types.ts:1624

"file" draws the file's own styles -- its colors, sizes, shapes, labels and the rest -- as style layers above the element's base layers, in the same step, so the graph looks as it does in the program that wrote the file. "none" (the default) loads the data alone. lastImport().styles says which layers the file made and what could not be drawn. catalog.formats() says which formats can carry styles (styles.read).

OPEN UNION: later releases may add choices.

Inherited from ​

LoadChoices.styles


unmatched? ​

readonly optional unmatched?: "add" | "leave-out"

Defined in: graphty-element/src/session/types.ts:1601

An edge naming a node no node row holds: "add" (the default) makes the node, "leave-out" drops the edge.

Inherited from ​

LoadChoices.unmatched


write? ​

readonly optional write?: boolean

Defined in: graphty-element/src/session/sources/types.ts:31

Allow a query that writes. Never recorded.