Open In App

D3.js Continuous Scales API Complete Reference

Last Updated : 19 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The D3 is an abbreviation of Data-Driven Documents, and D3.js is a resource JavaScript library for managing documents based on data. D3 is one of the most effective frameworks to work on data visualization.

Continuous Scales

Description

D3.js continuous() Function

built-in persist() function. However, D3.js is a library under active development, and new features and functionality may have been added to versions released after that date.

D3.js continuous.invert() Function

The d3.continuous.invert() function is used to return the corresponding value from the domain if a value from the range is given.

D3.js continuous.domain() Function

The continuous.domain() function is used to set the scale’s domain to the specified array of numbers. The array specified here contains two or more than two elements in it.

D3.js continuous.range() Function

The continuous.range() function is used to set the range of the scale to the specified array of values that must contain two or more than two values. The elements in the range can be numbers or strings.

D3.js continuous.rangeRound() Function

The continuous.rangeRound() function is used to set the range of the scale to the specified array of values. It also sets the interpolator to interpolatorRound. The rounding interpolator may be useful for avoiding antialiasing artifacts.

D3.js continuous.clamp() Function

The d3.continuous.clamp() function is used to enable or disable the clamp. If the clamp is disabled then the range of the domain’s value might be out of range but if the clamp is enabled then the range of domain’s value will always be in range.

D3.js continuous.unknown() Function

The d3.continuousScale.unknown() function is used for “unknownquot; get or set a value. or missing data on a continuous scale in D3.js.

D3.js continuous.interpolate() Function

The continuous.interpolate() function is used to set the range interpolator factory which is used to create the interpolators for each pair of values from the range that are adjacent to each other.

D3.js continuous.ticks() Function

The continuous.ticks() function is used to return the count values from the scale’s domain. If the count is not given as a parameter then by default it is set to 10. The values returned by tick lies in the domain.

D3.js continuous.tickFormat() Function

The continuous.tickFormat() function is used to change the format of the tick values. It returns a number format function that is suitable for displaying a tick value

D3.js continuous.nice() Function

The d3.continuousScale.nice() function is used to change the continuous scale and domain to create more human and visually appealing markers or ranges.

D3.js continuous.copy() Function

The d3.continuousScale.copy() is used to create a copy of an existing continuous scale.

D3.js tickFormat() Function

The d3.axis.tickFormat() Function is used to control which ticks are labelled. This function is used to implement your own tick format function.

D3.js scaleLinear() Function

The d3.scaleLinear() method is used to create a visual scale point. This method is used to transform data values into visual variables.

D3.js scalePow() Function

The d3.scalePow() function is used to create and return a new continuous scale. This scale has a specified domain and range. Generally, it acts as a linear scale but when used with exponent it works in a different way.

D3.js pow() Function

The d3.scalePow() function is used to create a power scale, which is a type of continuous scale that uses a power function to relate input values ​​to output values. This scale is often used in visualizations where you want to emphasize differences between data points, especially when some values ​​have a wide range.

D3.js pow.invert() Function

The pow.invert() function is used to return a value from the domain when given a value from the range. This inversion is useful for interaction such as determining the data value that corresponds to the position of the mouse.

D3.js pow.exponent() Function

The pow.exponent() function is used to specify the exponent to the given value. It returns the current exponent when the exponent is not specified. The value of the current exponent defaults to one.

D3.js pow.domain() Function

The pow.domain() function is used to set the scale’s domain to the specified array of numbers. The array specified here must contain two or more than two elements.

D3.js pow.range() Function

The pow.range() function is used to set the scale’s range to the specified array of values that must contain two or more than two values. The elements in the range can be number or string.

D3.js pow.rangeRound() Function

The pow.rangeRound() function is used set the range of the scale to the specified array of values along with this it internally sets the interpolator to interpolatorRound.

D3.js pow.clamp() Function

The pow.clamp() function is used to enable the clamp or disable the clamp only if the clamp is specified. The range of the return value may be outside the given range if the clamp is disabled.

D3.js pow.interpolate() Function

The pow.interpolate() function is used to set the range interpolator factory which is used to create the interpolators for each pair of values from the adjacent ranges.

D3.js pow.ticks() Function

The pow.ticks() function is used to return the count values from the scale’s domain. The values returned by ticks() lies in the domain. If the count is not given as a parameter then by default it is set to 10.

D3.js pow.tickFormat() Function

The pow.tickFormat() function is used to change the format of the tick values. It returns a number format function that is suitable for displaying a tick value.

D3.js pow.nice() Function

In d3.js, the d3.scalePow().nice() function is used to change the power scale to include the andquot;niceandquot; and human-friendly domain values.

D3.js pow.copy() Function

The pow.copy() function is used to create and return an exact copy of the given scale. Any change in the original scale will not affect the return scale and vice-versa.

D3.js scaleSqrt() Function

In D3.js, the d3.scaleSqrt() function is used to generate the square root scale. A square root scale is a type of continuous scale that uses the square root function to relate input values ​​to output values

D3.js scaleLog() Function

The d3.scaleLog() function is used to create a new continuous scale with the user-defined domain and range, the default base is 10. clamping is disabled by default in this scale.

D3.js log() Function

In D3.js, the d3.scaleLog() function is used to create a logarithmic scale. A logarithmic scale is a type of continuous scale that uses a logarithmic function to relate input values ​​to output values.

D3.js log.invert() Function

The log.invert() function returns a value from the domain when a value from the range is given. This inversion is useful for interaction such as determining the data value that corresponds to the position of the mouse.

D3.js log.base() Function

In D3.js, the .base() method is used with a logarithmic scale, such as d3.scaleLog(), to determine the logarithmic base. The logarithmic base specifies the type of logarithm used for the input values ​​when creating the scale.

D3.js log.domain() Function

The log.domain() function is used to set the scale’s domain to the specified array of numbers. The array specified here must contain two or more than two elements. By default, the domain is [1,10].

D3.js log.range() Function

The log.range() function sets the range of the log scale to the specified array of values that must contain two or more than two values. The elements in the range can be number or string.

D3.js log.rangeRound() Function

The log.rangeRound() function is used to set the range of the scale to the specified array of values along with this it internally sets the interpolator to interpolatorRound.

D3.js log.clamp() Function

The log.clamp() function is used to enable the clamp or disable the clamp. If the clamp is disabled then the range of the return value may be outside the given range through extrapolation.

D3.js log.interpolate() Function

The log.interpolate() function is used to set the range interpolator factory which is used to create the interpolators for each pair of values from the adjacent ranges. If the factory is not specified then it returns the current interpolator factory of the scale.

D3.js log.ticks() Function

The log.ticks() function is used to return ticks that are uniformly spaced within each integer power of base and each tick lies in scale’s domain. The values returned by ticks() lies in the domain. If the order of the in-domain is greater than count then one tick per power is returned. If the count is not given as a parameter then by default it is set to 10.

D3.js log.tickFormat() Function

The log.tickFormat() function is used to format the ticks returned by log.ticks() function. This function is similar to pow.tickFormat(), the only difference is that this function is customized for the logarithmic scale. If there are too many ticks, the formatter may return the empty string for some ticks so to avoid this set the count equal to infinity.

D3.js log.nice() Function

The d3.scaleLog().nice() function is used to change the logarithmic scale and domain so that it has a “nice” and human-friendly domain values. This is especially useful if you want to adjust the log scale to more user-friendly tick values, making the chart or visualization easier to read and understand.

D3.js log.copy() Function

The log.copy() function is used to create and return the exact copy of the original scale. This copy is not a reference to the original scale so any change in the original scale will not affect the copy scale.

D3.js scaleSymlog() Function

The D3.js scaleSymlog() Function is used to Create a symmetrical logarithmic scale.

D3.js symlog.constant() Function

The D3.js symlog.constant() Function used to set the simlog scale constant.

D3.js scaleRadial() Function

Radial scales are variants of linear scales where the range is internally squared so that the input value corresponds linearly to the squared output value. These scales are useful when you want the input value to fit the area of ​​the graphic mark and the mark is defined by a radius, as in a radial bar chart. Radial scales do not support interpolation.

D3.js scaleTime() Function

The d3.scaleTime() function is used to create and return a new time scale which have the particular domain and range. In this function the clamping is disabled by default.

D3.js time.invert() Function

The time.invert() function is used to return a value from the domain when given a input value from the specified range. This inversion can be useful in determining the data value corresponding to the position of the mouse.

D3.js time.domain() Function

The time.domain() function is used to set the domain for the time scale. If the domain is not specified then the default domain is [2000-01-01, 2000-01-02].

D3.js time.range() Function

The time.range() function is used to set the range of the scale to the specified array of values. The array given contains two or more elements.

D3.js time.rangeRound() Function

The time.rangeRound() function is used to set the range of the scale to the specified array of values along with setting the interpolator to intepolateRound.

D3.js time.clamp() Function

The time.clamp() function 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.

D3.js time.interpolate() Function

The time.interpolate() function is used to change the scale’s range interpolator factory. It returns the current interpolator if the factory is not specified.

D3.js time.ticks() Function

The time.ticks() function is used to uniformly space dates that corresponds to the domain of the scale. The dates are always in the extent of the domain of the scale.

D3.js time.tickFormat() Function

The time.tickFormat() function is used to return a time format function suitable for displaying tick values. It returns the default time format when the specifier is not specified.

D3.js time.nice() Function

This method usually changes the scale domain and can only extend the limits to the nearest round value.

D3.js time.copy() Function

The time.copy() function is used to construct and return the copy of the original scale. Changes done to the original scale will not affect the copy scale and vice-versa.

D3.js scaleUtc() Function

Equivalent to the scaleTime schedule, but the returned timescale operates in Coordinated Universal Time instead of local time



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads