The time.clamp() function in D3.js is used to enable or disable the clamp. If the clamp is disabled then the range of the return value may be outside the given range.
time.clamp( clamp )
Parameters: This function accepts only one parameter as given above and described below:
- clamp: It is a boolean value that defines if the clamp is enabled or disabled.
Return Values: This function does not return anything.
Below programs illustrate the time.clamp() function in D3.js:
Example 1: When the clamp is set to false.
Example 2: When clamp is set to true.