You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/zoom.md
+90-89Lines changed: 90 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,13 @@ sidebar_label: "Zoom Extension"
5
5
6
6
# Zoom Extension
7
7
8
-
9
-
10
-
You can read details about the Zoom extension in the [Zooming](guides/zooming.md) article. The current article provides the API reference of the **zoom** object:
11
-
8
+
You can read details about the Zoom extension in the [Zooming](guides/zooming.md) article. The current article provides the API reference of the `zoom` object:
12
9
13
10
## Zoom Levels
14
11
15
12
The Zoom extension uses a set of the scale settings and allows quickly switching between them.
16
13
17
-
**ZoomLevel** is an object that contains the scale settings. It has the following properties:
14
+
`ZoomLevel` is an object that contains the scale settings. It has the following properties:
18
15
19
16
- <spanclass="subproperty">**name**</span> - (*string*) - the name of the level
20
17
- <spanclass="subproperty">**scale_height?**</span> - (*number*) - the height of the scale
@@ -25,7 +22,7 @@ The Zoom extension uses a set of the scale settings and allows quickly switching
25
22
26
23
## Methods
27
24
28
-
- <spanclass="submethod">**init(zoomConfig): void**</span> - initializes the extension with the provided configuration.
25
+
- <spanclass="submethod">**init(zoomConfig): void**</span> - initializes the extension with the provided configuration.
29
26
-**_zoomConfig_** - (*object*) - an object with configuration settings that contains the *levels* array of zooming levels and a number of additional properties:
30
27
- **_levels_** - (*ZoomLevel[]*) - required, an array of zooming levels
31
28
- **_handler?_** - (*Function*): void - allows specifying a custom handler of the mouse wheel to work with zooming manually
@@ -40,111 +37,115 @@ The Zoom extension uses a set of the scale settings and allows quickly switching
40
37
- **_trigger?_** - (*string | null | undefined*) - the trigger of zooming: "wheel" | null | undefined
41
38
- **_element?_** - (*HTMLElement | Function*): HTMLElement - a DOM element over which zooming is triggered or a function that returns a DOM element
42
39
43
-
These are two examples of setting the **zoom** configuration:
40
+
These are two examples of setting the `zoom` configuration:
- <spanclass="submethod">**getCurrentLevel(): number**</span> - returns the number (index) of the current zooming level
142
+
- <spanclass="submethod">**getCurrentLevel(): number**</span> - returns the number (index) of the current zooming level
142
143
143
144
~~~js
144
145
gantt.ext.zoom.getCurrentLevel();
145
146
~~~
146
147
147
-
- <spanclass="submethod">**setLevel(level): void**</span> - switches to the specified zooming level.
148
+
- <spanclass="submethod">**setLevel(level): void**</span> - switches to the specified zooming level.
148
149
-**_level_** - (*number | string*) - The level is defined either by a string (the name of the level from the config, e.g. "year"), or by its number in the array of levels
0 commit comments