D3.js zoom.scaleBy() Function
The zoom.scaleBy() Function in D3.js is used to scale the current zoom transform of the selected elements by k. The reference point p does move.
zoom.scaleBy(selection, k[, p])
Parameters: This function accepts three parameters as mentioned above and described below:
- selection: This parameter can be selection or transition.
- k: This parameter is a scale factor, specified either as numbers or as functions
- p: The value of p is not specified, it defaults value is the center of the viewport extent.
Return Value: This function returns the zoom behavior.
Below programs illustrate the zoom.scaleBy() function in D3.js