D3.js Paths API Complete Reference Last Updated : 02 Nov, 2023 Comments Improve Suggest changes Like Article Like 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. D3.js path() Function: D3.js is mostly used for making of graph and visualizing data on the HTML SVG elements. D3 somehow is related to Data-Driven Documents. The Path is used to make the SVG , Path create a object that has all properties of canvas PATH. Functions Description D3.js path.moveTo() FunctionThe Path.moveTo() function is used to move a point inside the svg element. D3.js path.closePath() FunctionThe d3.closePath() function is used to close the current ongoing subpath and is almost the same as SVG’s closepath command. D3.js path.lineTo() FunctionThe path.lineTo() function is used to draw a line to a given point from the current set of points. D3.js path.quadraticCurveTo() FunctionThe d3.path.quadraticCurveTo() function is used to draw the quadratic bezier segment to a certain point from the current points via certain control points. D3.js path.bezierCurveTo() FunctionThe path.bezierCurveTo() function in d3.js is used to draw the cubic-bezier segment to a certain point from the current given point via certain control points. D3.js path.arcTo() FunctionThe path.arc() function is used to make an arc, a circle and other shapes. D3 stands for Data Driven Documents and is mostly used for data visualization. D3.js path.arc() Function The Path.arc() function is used to make a arc and a circle and other shapes. D3.js path.rect() FunctionThe Path.rect() function is used to make a rectangle in a svg element. It's contain four parameters x (x-position), y (y-position), w (width), and h (height). D3.js path.toString() FunctionThe path.toString() function in d3.js is used to return the string representation of the path of the shape drawn. The path representation is according to the SVG’s path data specification. D3.js pathRound() Function d3.pathRound() is used to create a path by appending rounded corners. Comment More infoAdvertise with us kartik Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js D3.js, short for Data-Driven Documents, is a powerful JavaScript library used to create dynamic and interactive data visualizations in web browsers. Developed by Mike Bostock in 2011, it leverages HTML, CSS, and SVG for visualization. In this D3.js tutorial, you'll delve into creating dynamic and in 6 min read d3-axisD3.js axis.tickFormat() FunctionThe d3.axis.tickFormat() Function in D3.js is used to control which ticks are labeled. This function is used to implement your own tick format function.Syntax:axis.tickFormat([format])Parameters: This function accepts the following parameters.format: These parameters are format to set the tick forma 2 min read D3.js axis.tickValues() FunctionThe d3.axis.tickValues() Function is used to generate ticks at specific values. This function returns the current tick values, which defaults to null.Syntax:axis.tickValues([values])Parameters: This function accepts the following parameters.values: This parameter is used for ticks rather than using 2 min read D3.js axisBottom() FunctionAxes can be drawn using built-in D3 functions. This is made of Lines, Ticks and Labels. The d3.axisBottom() function in D3.js is used to create a bottom horizontal axis. This function will construct a new bottom-oriented axis generator for the given scale, with empty tick arguments, a tick size of 6 2 min read D3.js axis.ticks() FunctionThe d3.axis.ticks() Function in D3.js is used to control which ticks are displayed by the axis. This function returns the axis generator Syntax: axis.ticks(argumentsâ¦) axis.ticks([count[, specifier]]) axis.ticks([interval[, specifier]]) Parameters: This function accepts the following parameters. cou 2 min read d3-chordD3.js chord() FunctionThe d3.chord() function in D3.js is used to return a constructed new chord layout with the default settings. Syntax: d3.chord() Parameters: This function does not accept any parameters. Return Value: This function returns the constructed new chord layout. Below programs illustrate the d3.chord() fun 2 min read D3.js chord.padAngle() FunctionThe chord.padAngle() function in D3.js is used to set the pad angle between adjacent groups to the specified number in radians and returns the chord layout. Syntax: chord.padAngle([angle]); Parameters: This function accepts a single parameter as mentioned above and described below angle: This parame 2 min read D3.js chord.sortGroups() FunctionThe chord.sortGroups() function in D3.js is used to set the group comparator to the specified function or null and returns this chord layout. Syntax: chord.sortGroups( [compare] ) Parameters: This function accepts a single parameter as mentioned above and described below compare: This parameter is t 3 min read D3.js chord.sortSubgroups() FunctionThe chord.sortSubgroups() function in D3.js is used to set the subgroup comparator to the specified function or null and returns this chord layout. Syntax: chord.sortSubgroups([compare]); Parameters: This function accepts a single parameter as mentioned above and described below: compare: This param 3 min read D3.js chord.sortChords() FunctionThe chord.sortChords() function in D3.js is used to set the chord comparator to the specified function or null and returns this chord layout. Syntax: chord.sortChords(compare); Parameters: This function accepts a single parameter as mentioned above and described below compare: This parameter is the 3 min read D3.js ribbon() FunctionThe d3.ribbon() function in D3.js is used to return a constructed new ribbon generator with the default settings. Syntax: d3.ribbon(); Parameters: This function does not accept any parameters. Return Value: This function returns the newly constructed ribbon generator. Below programs illustrate the d 2 min read D3.js ribbon.source() FunctionThe ribbon.source() function in D3.js is used to set the source accessor to the specified function and returns this ribbon generator. Syntax: ribbon.source([source][/source]); Parameters: This function accepts a single parameter as mentioned above and described below source: This parameter is the f 2 min read D3.js ribbon.target() FunctionThe ribbon.target() function in D3.js is used to set the target accessor to the specified function and returns this ribbon generator. Syntax: ribbon.target([target]); Parameters: This function accepts a single parameter as mentioned above and described below: target: This parameter is the function t 2 min read D3.js ribbon.radius() FunctionThe ribbon.radius() function in D3.js is used to set the radius accessor to the specified function and returns this ribbon generator. Syntax: ribbon.radius([radius]); Parameters: This function accepts a single parameter as mentioned above and described below radius: This parameter is the function to 2 min read D3.js ribbon.source() FunctionThe ribbon.source() function in D3.js is used to set the source accessor to the specified function and returns this ribbon generator. Syntax: ribbon.source([source][/source]); Parameters: This function accepts a single parameter as mentioned above and described below source: This parameter is the f 2 min read D3.js ribbon.startAngle() FunctionThe ribbon.startAngle() function in D3.js is used to set the start angle accessor to the specified function and returns this ribbon generator. Syntax: ribbon.startAngle([angle]); Parameters: This function accepts a single parameter as mentioned above and described below angle: This parameter is the 2 min read D3.js ribbon.endAngle() FunctionThe ribbon.endAngle() function in D3.js is used to set the end angle accessor to the specified function and returns this ribbon generator. Syntax: ribbon.endAngle([angle]); Parameters: This function accepts a single parameter as mentioned above and described below angle: This parameter is the radian 2 min read D3.js Chords API Complete ReferenceThe 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. Chords: D3.js chord() FunctionD3.js chord.padAngle() FunctionD3.js chord.sortGroups() Functio 1 min read d3-colorD3.js | d3.color() FunctionThe d3.color() function in D3.js is used to parse the specified CSS color used as parameter of the function and return RGB or HSL color. If specifier is not given, then null is returned. Syntax: d3.color(color); Parameters: This function accepts single parameter color which specifies the CSS color. 1 min read D3.js | color.opacityThe color.opacity in D3.js is used to fade the color. The opacity value is in the range of [0, 1]. Syntax: color.opacity Parameters: This function does not accept any parameters. Return Value: This function returns the opacity value of the specified color. Below program illustrate the color.opacity 1 min read D3.js | d3.rgb() FunctionThe d3.rgb() function in D3.js is used to return RGB value of the specified CSS color. Syntax: d3.rgb(color); Parameters: This function accepts single parameter color which is used to specify the CSS color. Return Value: This function returns RGB value of the given CSS color. Below programs illustra 1 min read D3.js color.brighter() FunctionThe color.brighter() function of D3.js is used to make a copy of the color with some extra brightness or darkness in the original color. Syntax: color.brighter(k) Parameter: This function accepts only one parameter k is the amount of brightness required in the original color. It is the Integer value 2 min read D3.js color.darker() FunctionThe color.darker() function of D3.js is used to make a copy of the color with some extra darkness or brightness in the original color. Syntax: color.darker(k) Parameter: It takes the following parameters: k: Here "k" is the amount of darkness required in the original color. It is the Integer value. 2 min read D3.js | color.displayable() FunctionThe color.displayable() function in D3.js is used to return true if the color is displayable otherwise false. Syntax: color.displayable() Parameters: This function does not accept any parameters. Return Value: This function returns true if the color is displayable otherwise false. Below program illu 1 min read D3.js | d3.rgb() FunctionThe d3.rgb() function in D3.js is used to return RGB value of the specified CSS color. Syntax: d3.rgb(color); Parameters: This function accepts single parameter color which is used to specify the CSS color. Return Value: This function returns RGB value of the given CSS color. Below programs illustra 1 min read D3.js | d3.hsl() FunctionThe d3.hsl() function in D3.js is used to construct a new HSL color and returns HSL properties of the specified color taken as the parameter of the function.Syntax: d3.hsl(h, s, l, opacity) or d3.hsl(color) Parameters: This function accepts some parameters as mentioned above and described below: h: 2 min read D3.js | d3.lab() FunctionThe d3.lab() function in D3.js is used to construct a new Lab color and returns 'l', 'a' and 'b' properties of the specified color taken as the parameter of the function. Syntax: d3.lab(color); Parameters: This function accepts single parameter color which is specified CSS color. Return Value: This 1 min read D3.js | d3.hcl() FunctionThe d3.hcl() function in D3.js is used to construct a new HCL color and returns HCL properties of the specified color taken as the parameter of the function. Syntax: d3.hcl(color); Parameters: This function accepts single parameter color which is used to specify the CSS color. Return Value: This fun 1 min read D3.js lch() FunctionThe d3.lch() function in D3.js is used to construct a new LCH color and returns l, c and h properties of the specified color taken as the parameter of the function. Syntax: d3.lch(color); Parameters: This function accepts single parameter color which is used to specify the CSS color. Return Value: T 1 min read D3.js | d3.cubehelix() FunctionThe d3.cubehelix() function in D3.js is used to construct a new Cubehelix color and returns HSL properties of the specified color taken as the parameter of the function. Syntax: d3.cubehelix(color); Parameters: This function accepts single parameter color which specifies the CSS color. Return Value: 1 min read D3.js Colors API Complete ReferenceThe 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. Colors: D3.js color()FunctionD3.js color.opacity()FunctionD3.js color.rgb()FunctionD3.js colo 1 min read d3-interpolated3.interpolate() FunctionThe Interpolate() function in D3.js is used to interpolate the two given values. In the case of colors, it is used to form a third color from the given two colors. Syntax: d3.interpolate(a, b); Parameters: This function accepts two parameters as mentioned above and describe below. a: It is an arbitr 2 min read D3.js interpolateNumber() FunctionThe d3.interpolateNumber() Function is used to return the interpolator between two given numbers. It is almost the same as d3.interpolate() function except that it takes only numbers as parameters. Syntax: d3.interpolateNumber(a,b); Parameters: This function accepts two parameters as mentioned above 1 min read D3.js interpolateRound() FunctionThe d3.InterpolateRound() Function is used to return the interpolate of two given numbers and round them to the nearest integer. Syntax: d3.interpolateRound(a,b) Parameters: This function accepts two parameters as mentioned above and describe below. a: It is any number.b: It is any number. Return Va 1 min read D3.js interpolateString() functionThe intepolateString() function in D3.js is used to return the interpolator function between two strings. For each number in string "b" the function finds a number for it in string "a", then it returns the interpolation of these numbers using Number interpolator function, and the remaining part of s 2 min read d3-contourD3.js contourDensity() FunctionThe d3.contourDensity() function is used to construct a new density estimator function with the default settings. A density estimator function estimates the density for the given set of data. Syntax: d3.contourDensity(); Parameters: This function does not take any parameters. Return Value: This func 3 min read D3.js density.x() FunctionThe density.x() function is used to set the x-coordinate accessor. If the x is not specified then this function returns the current x-coordinate accessor. Syntax: d3.contourDensity.x([x]); Parameters: This function takes one parameter as given above and described below: x: It is the value for the x- 4 min read D3.js density.weight() FunctionThe density.weight() function is used to set the weight accessor of the density contour estimator function. If the weight is given then this function sets the accessor for the point weights else it sets the accessor to the default value of 1. Syntax: d3.contourDensity.x().y().weight([weight]); Param 4 min read D3.js density.size() FunctionThe density.size() function is used to set the size of the density estimator function. The size is given in the form of range as shown in the below-given examples. If the size is not specified it returns the current default size i.e [960, 500]. Syntax: d3.contourDensity.x().y().size([size]); Paramet 4 min read D3.js density.cellSize() FunctionThe density.cellSize() function is used to set the cell size of the density estimator function. If the cell size is given that this function sets the size of the individual cell. If the size of the cell is not given then it returns the current cell size which is equal to 4. Please note that, smaller 4 min read D3.js density.thresholds() FunctionThe density.thresholds() function is used to set the thresholds of the density estimator function. If the threshold is given then this sets the threshold generator to the specified function or array. If the thresholds are not given then this function returns the default threshold to the contour gene 4 min read D3.js density.bandwidth() FunctionThe density.bandwidth() function is used to set the bandwidth of the density estimator function. If the bandwidth is not specified then it sets the default bandwidth which is equal to 20.4939. If the bandwidth is specified then it sets the bandwidth of the gaussian kernel and returns the estimate. S 4 min read D3.js Contours API Complete ReferenceThe 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. Contours: D3.js contours() FunctionD3.js contours.contour() FunctionD3.js contours.size() Fun 1 min read d3-delaunayD3.js Delaunay.trianglePolygons() MethodD3.js is a strong JavaScript framework for data visualization, and one of its modules, Delaunay, supports Delaunay triangulation. The Delaunay.trianglePolygons() Method returns an iterable over the polygons for each triangle, in order. Syntax:Delaunay.trianglePolygons()Parameters: This method takes 2 min read D3.js Delaunay.find() MethodD3.js is a strong JavaScript framework for data visualization, and one of its modules, Delaunay, supports Delaunay triangulation. The delaunay.find() method returns the index of the input point that is closest to the specified point (x, y). Syntax: delaunay.find(x, y[, i])Parameters:x: The x-coordin 2 min read D3.js Delaunay.from() MethodThe delaunay.from() method returns the Delaunay triangulation for the given array of points or the function that returns the points. This method takes an array of points and optional accessors for x and y coordinates. It returns a Delaunay object that provides various methods for working with triang 3 min read D3.js Delaunay.hull PropertyThe Delaunay.hull property returns an Int32Array of point indices that form the convex hull in the counterclockwise order. If the points are collinear, then it returns them ordered. Syntax:delaunay.hullParameters:It takes nothing as the parameter. Return Value:This property returns an array. Example 2 min read D3.js Delaunay.halfedges PropertyThe Delaunay.halfedges property returns the half-edge indices as an Int32Array [j0, j1, â¦]. For every index value between 0 and the length of the half-edges array (exclusive), there is a connection from a vertex of a triangle to another vertex. Syntax:delaunay.halfedgesParameters:It takes nothing as 3 min read D3.js Delaunay.hullPolygon() MethodThe Delaunay.hullPolygon() Method returns the closed polygon [[x0, y0], [x1, y1], â¦, [x0, y0]] representing the convex hull. Syntax:Delaunay.hullPolygon()Parameters: This method takes no parameters. Return Value:This method returns an Array of polygons that represents a convex hull. Example 1: The b 2 min read D3.js voronoi.extent() FunctionThe voronoi.extent() function is used to set the extent of the Voronoi generator function. The given extent value is used to set the clip extent of the Voronoi layout within the given bounds. The bounds are given as a 2-d array that looks like [[x0, y0], [x1, y1]]. If the extent is not specified the 3 min read D3.js voronoi.y() FunctionThe voronoi.y() function is used to set the y-coordinate accessor. If y is not specified then this function returns the current y-coordinate accessor to the Voronoi generator function. Syntax: d3.voronoi.y([y]); Parameters: This function takes one parameter as given above and described below: y: It 2 min read d3-hierarchyD3.js hierarchy() FunctionThe d3.hierarchy() function in D3.js library is used to construct a root node data from a given hierarchical data. The data that is given must be of an object and must represent a root node. Syntax: d3.hierarchy(data[, children]); Parameters: This function takes a single parameter as given above and 2 min read D3.js node.ancestors() FunctionThe node.ancestors() function returns an array of ancestors nodes, starting with the given node, then followed by each parent up to the root. Syntax: node.ancestors(); Parameters: This method takes no parameters. Return Values: This method returns an array of ancestors nodes. Example 1: HTML <!DO 1 min read D3.js node.descendants() FunctionThe node.descendants() function in d3.js library is used to generate and return an array of descendant nodes. Syntax: node.descendants(); Parameters: This function does not accept any parameters. Return Values: This function returns an array. Below given are a few examples of the function given abov 2 min read D3.js node.leaves() FunctionThe node.leaves() function in d3.js is used to return an array of leaf nodes of the given hierarchical data in traversal order. Syntax: node.leaves(); Parameters: This function does not accept any parameters. Return Values: This function return an array. Note: Leaf nodes are those nodes which have n 2 min read D3.js node.path() FunctionThe node.path() function in d3.js is used return the shortest path between the source and destination node. Syntax: node.path(target); Parameters: This function accepts single parameter as given above and described below: target: This parameter accepts a destination node. Return Value: This function 2 min read D3.js node.links() FunctionThe node.links() function returns an array of links to the children of the node object, each link object has a source and a target field that hold references to child nodes. Syntax: node.links(); Parameters: This method does not accept any parameters. Return Values: This method returns an array of l 1 min read D3.js node.sum() FunctionThe node.sum() function in d3.js is used to evaluate the specified value function for a particular node. The node.value property of this function contains the value returned by the specified function. Syntax: node.sum(value); Parameters: This function accepts a single parameter as mentioned above an 2 min read D3.js node.count() FunctionThe node.count() function of D3.js library is used to count the number of leaves under a particular node and append it as a value property to the object. If the node given is itself a leaf node then the count is one. Syntax: node.count(); Parameters: This function does not take any parameter. Return 2 min read D3.js node.sort() FunctionThe node.sort() function in D3.js is used to sort the children at each level of the given hierarchical data. The comparator function can be used to define the basis on which the sorting would be done. Syntax: node.sort( compare ) Parameters: This function accepts a single parameter as mentioned abov 2 min read D3.js node.each() FunctionThe node.each() function is used to evaluate a function for each node in Breadth First Order. In this, every node is visited exactly one time. This function is called repeatedly for each descendant node. Syntax: node.each(function); Parameters: This function accepts a single parameter as mentioned a 2 min read D3.js node.eachAfter() FunctionThe node.eachAfter() function is used to invoke a particular function for each node but in a post-order-traversal order. It visits each node in post-traversal order and performs an operation on that particular node and each of its descendants. Syntax: node.eachAfter(function); Parameters: This funct 2 min read D3.js node.eachBefore() FunctionThe node.eachBefore() function is used to invoke a particular function for each node but in a pre-order-traversal order. It visits each node in pre-traversal order and performs an operation on that particular node and each of its descendants. Syntax: node.eachBefore(function); Parameters: This funct 2 min read D3.js stratify() FunctionThe d3.stratify() function is used to construct and return a new stratify operator. This operator has its own default settings. This function is used to convert a tree form link representation to a hierarchy. Syntax: d3.stratify(); Parameters: This function does not accept any parameter. Return Valu 2 min read d3-scaleD3.js scaleDiverging() FunctionThe d3.scaleDiverging() function in D3.js is used to construct and return a diverging scale with specified domain and fixed range. The diverging scales are very 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 2 min read D3.js diverging.domain() FunctionThe 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 numeri 2 min read D3.js diverging.interpolator() FunctionThe 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.interpolate() the function is used to configure the interpolator of the diverging scale. If the i 2 min read D3.js diverging.copy() FunctionThe 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.copy() function in d3.js is used to construct and return the exact copy of the original scale. An 2 min read D3.js Diverging Scales API Complete ReferenceThe 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. Diverging Scales: D3.js scaleDiverging() FunctionD3.js diverging() FunctionD3.js diverging.do 1 min read D3.js scaleQuantile() FunctionThe d3.scaleQuantile() function in D3.js is used to create and return a new quantile scale that has the specified domain and range. In case the domain or the range is not specified, each value is set to empty array by default. Syntax: d3.scaleQuantile( domain, range ) Parameters: This function accep 2 min read D3.js d3.quantile() FunctionThe d3.quantile() function in D3.js is used to returns the p-quantile of the given sorted array of elements. Where p is the number lies in the range[0, 1]. Syntax: d3.quantile(Array, p) Parameters: This function accept two parameters as mentioned above and described below: Array: It holds the sorted 2 min read D3.js quantile.invertExtent() FunctionThe quantile.invertExtent() function in d3.js is used to return the extent of the values that are present in the specified domain for the corresponding value in the range. Syntax: quantile.invertExtent( value ) Parameters: This function accepts a single parameter as given above and described below: 2 min read D3.js quantile.domain() FunctionThe quantile.domain() function is used to set the domain for the quantile scale. The given domain array must not be empty and must contain at least one numeric value. Syntax: quantile.domain([domain]); Parameters: This function takes only one parameter as given above and described below. domain: Thi 2 min read D3.js quantile.range() FunctionThe quantile.range() function is used to set the range for the quantile scale. The number of values in the range array determines the number of quantiles that are created by this function. Syntax: quantile.range([range]); Parameters: This function accepts single parameter as mentioned above and desc 2 min read D3.js quantile.copy() FunctionThe quantile.copy() function returns the exact copy of the original scale. Any changes if made in either of the scale will not affect the other scale. Syntax: quantile.copy(); Parameters: This function does not accept any parameter. Return Values: This function returns the copy of the original scale 2 min read D3.js Quantize Scales API Complete ReferenceThe 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. Qunatize Scales: D3.js scaleQuantize() FunctionD3.js quantize() FunctionD3.js quantize.invert 1 min read d3-scale-chromaticD3.js schemeCategory10 MethodThe d3.schemeCategory10 method in D3.js is used to return an array of ten categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeCategory10 Parameters: This function does not accept any parameter. Return Value: It returns an RGB hexadecimal string. Below examples illustrat 2 min read D3.js schemeAccent MethodThe d3.schemeAccent method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeAccent Parameters: This function does not accept any parameter. Return Value: It returns an RGB hexadecimal string. Below examples illustrate the 2 min read D3.js schemeDark2 MethodThe d3.schemeDark2 method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeDark2 Parameters: This function does not accept any parameter. Return Value: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE htm 2 min read D3.js schemePaired MethodThe d3.schemePaired method in D3.js is used to return an array of twelve categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemePaired Parameters: This function does not accept any parameter. Return Value: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE 2 min read D3.js schemePastel1 MethodThe d3.schemePastel1 method in D3.js is used to return an array of nine categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemePastel1 Parameters: This function does not accept any parameter. Return Value: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE 2 min read D3.js schemePastel2 MethodThe d3.schemePastel2 Method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemePastel2 Parameters: This method does not accept any parameter. Return Values: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE 2 min read D3.js schemeSet1 MethodThe d3.schemeSet1 Method in D3.js is used to return an array of nine categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeSet1 Parameters: This method does not accept any parameter. Return Values: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE html 2 min read D3.js schemeSet2 MethodThe d3.schemeSet2 Method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeSet2 Parameters: This method does not accept any parameter. Return Values: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE html 2 min read D3.js schemeSet3 MethodThe d3.schemeSet3 Method in D3.js is used to return an array of twelve categorical colors which is returned as RGB hexadecimal strings. Syntax: d3.schemeSet3 Parameters: This method does not accept any parameter. Return Values: It returns an RGB hexadecimal string. Example 1: HTML <!DOCTYPE html 2 min read D3.js schemeTableau10 MethodThe d3.schemeTableau10 Method in D3.js is used to return an array of ten categorical colors authored by Tableau as part of Tableau 10 which is returned as RGB hexadecimal strings. Syntax: d3.schemeTableau10 Parameters: This method does not accept any parameter. Return Values: It returns an RGB hexad 2 min read D3.js Color Schemes Categorical API Complete ReferenceThe 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. Color Schemes Categorical Description D3.js schemeCategory10() FunctionThe d3.schemeCategory1 2 min read Like