VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-diverging-domain-function/

⇱ D3.js diverging.domain() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js diverging.domain() Function

Last Updated : 31 Aug, 2020

The diverging scales are very much similar to continuous scales. The only difference is that the output range of this scale is fixed by the interpolator thus the range is not configurable.

The diverging.domain() function is used to set the domain of the scale. The domain array must take three numeric values.

Syntax:

diverging.domain([domain]);

Parameters: This function accepts a single parameter as mentioned above and described below:

  • domain: This is an array that takes three numeric values. The default domain of the scale is [0, 0.5, 1].

Return Values: This function does not return anything.

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment
Article Tags: