@graphty/graphty-element / session / SessionViews
Interface: SessionViews ​
Defined in: graphty-element/src/session/types.ts:1786
The saved camera views, read as a map from name to camera state.
A saved view is a fixed position, not a rule: it does not recompute itself for a different graph the way a camera view does, which is why a name a camera view answers to is refused.
Extends ​
ReadonlyMap<string,CameraState>
Methods ​
remove() ​
remove(
names):Promise<void>
Defined in: graphty-element/src/session/types.ts:1802
Forget saved views. One step.
Parameters ​
names ​
readonly string[]
The names.
Returns ​
Promise<void>
Settles once the step is recorded.
Throws ​
A GraphtyError (as a rejection) with E_BAD_COMMAND when a name is not saved; nothing is removed then.
save() ​
save(
views):Promise<void>
Defined in: graphty-element/src/session/types.ts:1794
Keep camera states under names, replacing any view already saved under one. One step.
Parameters ​
views ​
readonly object[]
The names and the camera states.
Returns ​
Promise<void>
Settles once the step is recorded.
Throws ​
A GraphtyError (as a rejection) with E_PROTECTED when a camera view answers to a name, or E_BAD_COMMAND for an empty name; nothing is saved then.