nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Imaging / Extensions

Extensions

Full name Microsoft.VisualBasic.Imaging.d3js.scale.Extensions Assembly Microsoft.VisualBasic.Imaging Members 2
  • Continuous scales map a continuous, quantitative input domain to a continuous output range. If the range is also numeric, the mapping may be inverted. A continuous scale is not constructed directly; instead, try a linear, power, log, identity, time or sequential color scale.
  • Sequential scales are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. However, unlike continuous scales, the output range of a sequential scale is fixed by its interpolator and not configurable. These scales do not expose invert, range, rangeRound and interpolate methods.
  • Unlike continuous scales, ordinal scales have a discrete domain and range. For example, an ordinal scale might map a set of named categories to a set of colors, or determine the horizontal positions of columns in a column chart.

00 Remarks

01 Syntax

Microsoft.VisualBasic.Imaging.d3js.scale.Extensions

02 Methods

NameOverloadsSummary
ordinal 1 Ordinal scales have a discrete domain, such as a set of names or categories.
linear 1 Quantitative scales have a continuous domain, such as the set of real numbers, or dates.

03 Members

method ordinal #
ordinal

Ordinal scales have a discrete domain, such as a set of names or categories. An ordinal scale's values must be coercible to a string, and the stringified version of the domain value uniquely identifies the corresponding range value.

So, as an example, a domain of an ordinal scale may contain names, like so:

 var ordinalScale = d3.scale.ordinal()
     .domain(['Alice', 'Bob'])
     .range([0, 100]);

 ordinalScale('Alice'); // 0
 ordinalScale('Bob');   // 100

Notice how all values are strings. They cannot be interpolated. What Is between 'Alice' and 'Bob'? I don't know. Neither does D3.

method linear #
linear(Boolean)

Quantitative scales have a continuous domain, such as the set of real numbers, or dates.

As an example, you can construct the following scale:

 var linearScale = d3.scale.linear()
     .domain([0, 10])
     .range([0, 100]);

 linearScale(0);  // 0
 linearScale(5);  // 50
 linearScale(10); // 100

Notice how D3 Is able To interpolate 5 even If we haven't specified it explicitly in the domain.

Returns

Constructs a new continuous scale with the unit domain [0, 1], the unit range [0, 1], the default interpolator and clamping disabled. Linear scales are a good default choice for continuous quantitative data because they preserve proportional differences. Each range value y can be expressed as a function of the domain value x: y = mx + b.