D3.js scaleOrdinal ordinal() Function
The ordinal() function in d3.js library is used to return a value from the specified range on giving an input corresponding to the specified domain.
Parameters: This function accepts a single parameter as given above and described below.
- Value: This parameter accepts a value from the given domain.
Return Value: This function return a value from the range corresponding to the given input.
Below given are a few examples of the function given above.