D3.js transform.translate() Function
The transform.translate() function in D3.js library is used to get the transformation whose translation tx1 and ty1 is equal to tx0 + tk x and ty0 + tk y, where tx0 and ty0 is the transform’s translation and tk is the transform’s scale.
Parameters: This function accepts the following parameter as mentioned above and described below.
- x, y: These parameters are the translation point argument.
Return value: This function returns the transformed zoom behaviour.
Below programs demonstrates the transform.translate() function of D3.js library.