Options
Preview version
The jsMind V2 programming API is currently a preview. The API will change in later updates. Please check this documentation anytime for the interface that is current.
Configuration passed to jsMind.create. Omitted fields use the library defaults.
This page is generated from the published typings dist/jsmind.d.ts with TypeDoc.
JsMindOptions
Interface
Options for JsMind.
Properties
| Name | Type | Description |
|---|---|---|
layout | LayoutOptions | Layout options, i.e. the four spacing values. |
mind | MindOptions | Mind-level options: which node the map starts from. |
view | ViewOptions | View configuration: padding, expander and viewport mode. |
JsMindOptionsInput
Interface
The options accepted when an instance is created.
Remarks
Every group is optional, and so is every field inside a group: a caller can pass { view: { viewportMode: 'native' } } and keep the default padding and expander, which is what the merge already does at runtime. Partial<JsMindOptions> cannot express that - it only makes the groups optional, so a group that is present would have to be complete.
JsMindOptions is the resolved shape, with every field present.
Properties
| Name | Type | Description |
|---|---|---|
layout (optional) | Partial<LayoutOptions> | Layout options; omitted fields use the defaults. |
mind (optional) | Partial<MindOptions> | Mind map options; omitted fields use the defaults. |
view (optional) | Partial<ViewOptions> | View options; omitted fields use the defaults. |
ViewOptions
Interface
View configuration: padding, expander and viewport mode.
Properties
| Name | Type | Description |
|---|---|---|
expander | ViewExpanderOptions | How the fold control beside a node is drawn. |
padding | ViewPadding | Empty space kept around the map, added to the minimum canvas size. |
viewportMode | JmViewportMode | Which mechanism moves the map inside the container. 'viewport', the default, hands the container's inner box to the transform viewport: overflow becomes visible and zoom and pan write a transform. The commands then own every movement of the map, and the browser no longer scrolls it - so a host that takes the box over is the one that has to drive the gestures. The exported page's shell does that; the library itself does not listen to the browser's input events. That is the warning that comes with the default: a host that only calls create() and open() and shows a map larger than its box gets a canvas the browser cannot scroll and the library cannot move. Call getViewport() to check mode, wire the gestures, or ask for 'native'. 'native' keeps native scrolling: a map larger than the box overflows it and the browser's own scrollbars reach the rest. The five viewport commands are not available in that mode and throw. The mode is decided here, once, and never changes: switching later would move the map under the reader's hand. It cannot be relaxed either - taking the box over folds the scroll offset into the origin and replaces overflow, so going back would have to restore both. |
ViewPadding
Interface
Empty space kept around the map, one value per side.
Properties
| Name | Type | Description |
|---|---|---|
bottom | number | Space kept on the bottom side. |
left | number | Space kept on the left side. |
right | number | Space kept on the right side. |
top | number | Space kept on the top side. |
ViewExpanderOptions
Interface
How the fold control beside a node is drawn.
Properties
| Name | Type | Description |
|---|---|---|
style | ViewExpanderStyle | Which of the two drawings to use. |
ViewExpanderStyle
Enumeration
Members
| Name | Value | Description |
|---|---|---|
Char | "char" | Switches a class on fold state; the stylesheet draws the symbol. |
Number | "number" | Shows the number of children the node has. |
LayoutOptions
Interface
Spacing between nodes in the layout.
Properties
| Name | Type | Description |
|---|---|---|
cousinSpace | number | Vertical gap between cousins, i.e. nodes with different parents. |
expanderSize | number | Width of the fold control. |
parentChildSpace | number | Horizontal distance from the parent's edge to the child's edge. |
siblingSpace | number | Vertical gap between siblings, measured on whole subtree blocks. |