Skip to content

@graphty/graphty-element / index / ProgressChange

Interface: ProgressChange ​

Defined in: graphty-element/src/session/shared.ts:84

How far a piece of the element's work has got, published as progress:changed on the session and as graphty-progress-change on the element.

Sent while the work runs (phase: "progress") and once when it stops (phase: "end"). A load or a prepare sends its first change as it begins, before it reads anything (completed: 0), and its end carries outcome, saying how it stopped. A run's end does not; the call that started it says how. A session with no view reports progress exactly as one with a view does.

Properties ​

completed ​

readonly completed: number

Defined in: graphty-element/src/session/shared.ts:103

How many units are done. For a load, the records read so far (nodes and edges); for a prepare, the rows read so far, counted while a CSV file is read; for a run, whatever unit the algorithm counts in.


error? ​

readonly optional error?: object

Defined in: graphty-element/src/session/shared.ts:128

Why a load or a prepare failed, on its phase: "end" change when outcome is "failed" and the failure carried a code: the code and the details the rejection carries (for E_TOO_LARGE, its limit, count and of).

code ​

readonly code: string

details ​

readonly details: Readonly<Record<string, unknown>>


fraction ​

readonly fraction: number | null

Defined in: graphty-element/src/session/shared.ts:111

How far along, from 0 to 1, or null when it is not known. Never an invented number. For a prepare reading a CSV file, the share of the file's text read so far (total stays null, since the row count is not known until the file has been read).


outcome? ​

readonly optional outcome?: "succeeded" | "failed" | "cancelled"

Defined in: graphty-element/src/session/shared.ts:122

How a load or a prepare stopped, on its phase: "end" change only.

OPEN UNION: later releases may add outcomes.


phase ​

readonly phase: "progress" | "end"

Defined in: graphty-element/src/session/shared.ts:97

Whether the work is still going, or has stopped.


run? ​

readonly optional run?: string

Defined in: graphty-element/src/session/shared.ts:95

The run, when task is "run".


source? ​

readonly optional source?: object

Defined in: graphty-element/src/session/shared.ts:116

What is being read, on every change of a load or a prepare: the name the source was given or its file's name or URL's last part, and the URL when it was read from one. Absent for a run.

name? ​

readonly optional name?: string

url? ​

readonly optional url?: string


task ​

readonly task: "run" | "load" | "prepare"

Defined in: graphty-element/src/session/shared.ts:93

What is making progress: "load" for a data import, "prepare" for data.prepare() reading a source into a load draft, and "run" for an algorithm run. A prepare is sent like a load: a first change before anything is read, the rows read so far, and an end with its outcome.

OPEN UNION: later releases add tasks. Show a generic bar for one you do not know.


total ​

readonly total: number | null

Defined in: graphty-element/src/session/shared.ts:105

How many units there are in all, or null when that is not known in advance.