@d3plus/core
v3.1.5
Published
Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
Maintainers
Readme
@d3plus/core
Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
Installing
If using npm, npm install @d3plus/core. Otherwise, you can download the latest release from GitHub or load from a CDN.
import {*} from "@d3plus/core";In a vanilla environment, a d3plus global is exported from the pre-bundled version:
<script src="https://cdn.jsdelivr.net/npm/@d3plus/core"></script>
<script>
console.log(d3plus);
</script>Examples
Live examples can be found on d3plus.org, which includes a collection of example visualizations using @d3plus/react.
API Reference
| Classes | Description |
| --- | --- |
| Area | Creates SVG areas based on an array of data. |
| AreaPlot | Creates an area plot based on an array of data. |
| Axis | Creates an SVG scale based on an array of data. |
| AxisBottom | Shorthand method for creating an axis where the ticks are drawn below the horizontal domain path. Extends all functional |
| AxisLeft | Shorthand method for creating an axis where the ticks are drawn to the left of the vertical domain path. Extends all fun |
| AxisRight | Shorthand method for creating an axis where the ticks are drawn to the right of the vertical domain path. Extends all fu |
| AxisTop | Shorthand method for creating an axis where the ticks are drawn above the vertical domain path. Extends all functionalit |
| Bar | Creates SVG areas based on an array of data. |
| BarChart | Creates a bar chart based on an array of data. |
| BaseClass | Provides shared configuration, event handling, and locale management inherited by all d3plus classes. |
| Box | Creates SVG box based on an array of data. |
| BoxWhisker | Creates a simple box and whisker based on an array of data. |
| BumpChart | Creates a bump chart based on an array of data. |
| Circle | Creates SVG circles based on an array of data. |
| ColorScale | Creates an SVG color scale based on an array of data. |
| Donut | Extends the Pie visualization to create a donut chart. |
| Geomap | Creates a geographical map with zooming, panning, image tiles, and the ability to layer choropleth paths and coordinate |
| Image | Creates SVG images based on an array of data. |
| Legend | Creates an SVG legend based on an array of data. |
| Line | Creates SVG lines based on an array of data. |
| LinePlot | Creates a line plot based on an array of data. |
| Matrix | Creates a simple rows/columns Matrix view of any dataset. See [this example](https://d3plus.org/examples/d3plus-matrix/g |
| Network | Creates a network visualization based on a defined set of nodes and edges. [Click here](http://d3plus.org/examples/d3plu |
| Pack | Uses the d3 pack layout to creates Circle Packing chart based on an array of |
| Path | Creates SVG Paths based on an array of data. |
| Pie | Uses the d3 pie layout to creates SVG arcs based on an array of data. |
| Plot | Creates an x/y plot based on an array of data. |
| Priestley | Creates a priestley timeline based on an array of data. |
| Radar | Creates a radar visualization based on an array of data. |
| RadialMatrix | Creates a radial layout of a rows/columns Matrix of any dataset. See [this example](https://d3plus.org/examples/d3plus-m |
| Rect | Creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-shape/getting-st |
| Rings | Creates a ring visualization based on a defined set of nodes and edges. [Click here](http://d3plus.org/examples/d3plus-n |
| Sankey | Creates a sankey visualization based on a defined set of nodes and links. [Click here](http://d3plus.org/examples/d3plus |
| Shape | An abstracted class for generating shapes. |
| StackedArea | Creates a stacked area plot based on an array of data. |
| TextBox | Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-tex |
| Timeline | Creates an interactive timeline brush component for selecting time periods within a visualization. |
| Tooltip | Creates HTML tooltips in the body of a webpage. |
| Tree | Uses d3's tree layout to create a tidy tree chart based on an array of data. |
| Treemap | Uses the d3 treemap layout to creates SVG rectangles based on an a |
| Viz | Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-sta |
| Whisker | Creates SVG whisker based on an array of data. |
| Functions | Description |
| --- | --- |
| accessor | Wraps an object key in a simple accessor function. |
| configPrep | Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you m |
| constant | Wraps non-function variables in a simple return function. |
| Variables | Description |
| --- | --- |
| RESET | String constant used to reset an individual config property. |
| Interfaces | Description |
| --- | --- |
| AxisConfig | |
| D3plusConfig | |
| TooltipConfig | |
Classes
Area
Defined in: shapes/Area.ts:17
Creates SVG areas based on an array of data.
Extends
Methods
active()
Call Signature
active(): ((
d:DataPoint,i:number) =>boolean) |null
Defined in: shapes/Shape.ts:1019
The active callback function for highlighting shapes.
Returns
((d: DataPoint, i: number) => boolean) | null
Inherited from
Call Signature
active(
_: ((d:DataPoint,i:number) =>boolean) |null):this
Defined in: shapes/Shape.ts:1020
The active callback function for highlighting shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | ((d: DataPoint, i: number) => boolean) | null |
Returns
this
Inherited from
activeOpacity()
Call Signature
activeOpacity():
number
Defined in: shapes/Shape.ts:1037
When shapes are active, this is the opacity of any shape that is not active.
Returns
number
Inherited from
Call Signature
activeOpacity(
_:number):this
Defined in: shapes/Shape.ts:1038
When shapes are active, this is the opacity of any shape that is not active.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number |
Returns
this
Inherited from
activeStyle()
Call Signature
activeStyle():
Record<string,unknown>
Defined in: shapes/Shape.ts:1048
The style to apply to active shapes.
Returns
Record<string, unknown>
Inherited from
Call Signature
activeStyle(
_:Record<string,unknown>):this
Defined in: shapes/Shape.ts:1049
The style to apply to active shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> |
Returns
this
Inherited from
ariaLabel()
Call Signature
ariaLabel():
AccessorFn
Defined in: shapes/Shape.ts:1059
The aria-label attribute for each shape.
Returns
AccessorFn
Inherited from
Call Signature
ariaLabel(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1060
The aria-label attribute for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
backgroundImage()
Call Signature
backgroundImage():
AccessorFn
Defined in: shapes/Shape.ts:1070
The background-image accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
backgroundImage(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1071
The background-image accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
config()
Call Signature
config():
D3plusConfig
Defined in: utils/BaseClass.ts:91
Methods that correspond to the key/value pairs and returns this class.
Returns
Inherited from
Call Signature
config(
_:D3plusConfig):this
Defined in: utils/BaseClass.ts:92
Methods that correspond to the key/value pairs and returns this class.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | D3plusConfig |
Returns
this
Inherited from
curve()
Call Signature
curve():
AccessorFn
Defined in: shapes/Area.ts:282
The d3 curve function used to interpolate the area.
Returns
AccessorFn
Call Signature
curve(
_:string|AccessorFn):this
Defined in: shapes/Area.ts:283
The d3 curve function used to interpolate the area.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
data()
Call Signature
data():
DataPoint[]
Defined in: shapes/Shape.ts:1082
The data array used to create shapes. A shape will be drawn for each object in the array.
Returns
DataPoint[]
Inherited from
Call Signature
data(
_:DataPoint[]):this
Defined in: shapes/Shape.ts:1083
The data array used to create shapes. A shape will be drawn for each object in the array.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | DataPoint[] |
Returns
this
Inherited from
defined()
Call Signature
defined(): (
d:DataPoint) =>boolean
Defined in: shapes/Area.ts:293
An accessor function that determines whether a data point is defined (not a gap in the area).
Returns
(d: DataPoint) => boolean
Call Signature
defined(
_: (d:DataPoint) =>boolean):this
Defined in: shapes/Area.ts:294
An accessor function that determines whether a data point is defined (not a gap in the area).
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | (d: DataPoint) => boolean |
Returns
this
discrete()
Call Signature
discrete():
string|undefined
Defined in: shapes/Shape.ts:1091
Determines if either the X or Y position is discrete along a Line, which helps in determining the nearest data point on a line for a hit area event.
Returns
string | undefined
Inherited from
Call Signature
discrete(
_:string):this
Defined in: shapes/Shape.ts:1092
Determines if either the X or Y position is discrete along a Line, which helps in determining the nearest data point on a line for a hit area event.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string |
Returns
this
Inherited from
duration()
Call Signature
duration():
number
Defined in: shapes/Shape.ts:1100
The animation duration in milliseconds.
Returns
number
Inherited from
Call Signature
duration(
_:number):this
Defined in: shapes/Shape.ts:1101
The animation duration in milliseconds.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number |
Returns
this
Inherited from
fill()
Call Signature
fill():
AccessorFn
Defined in: shapes/Shape.ts:1109
The fill color accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
fill(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1110
The fill color accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
fillOpacity()
Call Signature
fillOpacity():
AccessorFn
Defined in: shapes/Shape.ts:1120
Defines the "fill-opacity" attribute for the shapes.
Returns
AccessorFn
Inherited from
Call Signature
fillOpacity(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1121
Defines the "fill-opacity" attribute for the shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
hitArea()
Call Signature
hitArea(): ((
d:DataPoint,i:number,aes:Record<string,unknown>) =>Record<string,unknown>) |null
Defined in: shapes/Shape.ts:1180
The mouse hit area accessor function.
Returns
((d: DataPoint, i: number, aes: Record<string, unknown>) => Record<string, unknown>) | null
Example
function(d, i, shape) {
return {
"width": shape.width,
"height": shape.height,
"x": -shape.width / 2,
"y": -shape.height / 2
};
}Inherited from
Call Signature
hitArea(
_:Record<string,unknown> | ((d:DataPoint,i:number,aes:Record<string,unknown>) =>Record<string,unknown>)):this
Defined in: shapes/Shape.ts:1187
The mouse hit area accessor function.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> | ((d: DataPoint, i: number, aes: Record<string, unknown>) => Record<string, unknown>) |
Returns
this
Example
function(d, i, shape) {
return {
"width": shape.width,
"height": shape.height,
"x": -shape.width / 2,
"y": -shape.height / 2
};
}Inherited from
hover()
Call Signature
hover(): ((
d:DataPoint,i:number) =>boolean) |null
Defined in: shapes/Shape.ts:1131
The hover callback function for highlighting shapes on mouseover.
Returns
((d: DataPoint, i: number) => boolean) | null
Inherited from
Call Signature
hover(
_: ((d:DataPoint,i:number) =>boolean) |null):this
Defined in: shapes/Shape.ts:1132
The hover callback function for highlighting shapes on mouseover.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | ((d: DataPoint, i: number) => boolean) | null |
Returns
this
Inherited from
hoverOpacity()
Call Signature
hoverOpacity():
number
Defined in: shapes/Shape.ts:1160
The opacity of non-hovered shapes when any shape is hovered.
Returns
number
Inherited from
Call Signature
hoverOpacity(
_:number):this
Defined in: shapes/Shape.ts:1161
The opacity of non-hovered shapes when any shape is hovered.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number |
Returns
this
Inherited from
hoverStyle()
Call Signature
hoverStyle():
Record<string,unknown>
Defined in: shapes/Shape.ts:1149
The style to apply to hovered shapes.
Returns
Record<string, unknown>
Inherited from
Call Signature
hoverStyle(
_:Record<string,unknown>):this
Defined in: shapes/Shape.ts:1150
The style to apply to hovered shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> |
Returns
this
Inherited from
id()
Call Signature
id():
AccessorFn
Defined in: shapes/Shape.ts:1220
The unique id accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
id(
_:AccessorFn):this
Defined in: shapes/Shape.ts:1221
The unique id accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | AccessorFn |
Returns
this
Inherited from
label()
Call Signature
label():
AccessorFn
Defined in: shapes/Shape.ts:1229
The text label accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
label(
_:string|string[] |AccessorFn):this
Defined in: shapes/Shape.ts:1230
The text label accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | string[] | AccessorFn |
Returns
this
Inherited from
labelBounds()
Call Signature
labelBounds(): ((
d:DataPoint,i:number,aes:Record<string,unknown>) =>false|Record<string,unknown> |null) |null
Defined in: shapes/Shape.ts:1251
The label bounds accessor function.
Returns
((d: DataPoint, i: number, aes: Record<string, unknown>) => false | Record<string, unknown> | null) | null
Example
function(d, i, shape) {
return {
"width": shape.width,
"height": shape.height,
"x": -shape.width / 2,
"y": -shape.height / 2
};
}Inherited from
Call Signature
labelBounds(
_:Record<string,unknown> | ((d:DataPoint,i:number,aes:Record<string,unknown>) =>false|Record<string,unknown> |null)):this
Defined in: shapes/Shape.ts:1258
The label bounds accessor function.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> | ((d: DataPoint, i: number, aes: Record<string, unknown>) => false | Record<string, unknown> | null) |
Returns
this
Example
function(d, i, shape) {
return {
"width": shape.width,
"height": shape.height,
"x": -shape.width / 2,
"y": -shape.height / 2
};
}Inherited from
labelConfig()
Call Signature
labelConfig():
Record<string,unknown>
Defined in: shapes/Shape.ts:1291
A pass-through to the config method of the TextBox class used to create a shape's labels.
Returns
Record<string, unknown>
Inherited from
Call Signature
labelConfig(
_:Record<string,unknown>):this
Defined in: shapes/Shape.ts:1292
A pass-through to the config method of the TextBox class used to create a shape's labels.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> |
Returns
this
Inherited from
locale()
Call Signature
locale():
string
Defined in: utils/BaseClass.ts:156
The locale used for all text and number formatting. Supports the locales defined in d3plus-format. The locale can be a complex Object, a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale.
Returns
string
Example
{
separator: "",
suffixes: ["y", "z", "a", "f", "p", "n", "\u00b5", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"],
grouping: [3],
delimiters: {
thousands: ",",
decimal: "."
},
currency: ["$", ""]
}Inherited from
Call Signature
locale(
_:string|object):this
Defined in: utils/BaseClass.ts:157
The locale used for all text and number formatting. Supports the locales defined in d3plus-format. The locale can be a complex Object, a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | object |
Returns
this
Example
{
separator: "",
suffixes: ["y", "z", "a", "f", "p", "n", "\u00b5", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"],
grouping: [3],
delimiters: {
thousands: ",",
decimal: "."
},
currency: ["$", ""]
}Inherited from
on()
Call Signature
on():
Record<string, (...args:unknown[]) =>unknown>
Defined in: utils/BaseClass.ts:176
Event listener for the specified event typenames. Mirrors the core d3-selection behavior.
Returns
Record<string, (...args: unknown[]) => unknown>
Example
new Plot
.on("click.Shape", function(d) {
console.log("data for shape clicked:", d);
})
.on("click.Legend", function(d) {
console.log("data for legend clicked:", d);
})Inherited from
Call Signature
on(
_:string): ((...args:unknown[]) =>unknown) |undefined
Defined in: utils/BaseClass.ts:177
Event listener for the specified event typenames. Mirrors the core d3-selection behavior.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string |
Returns
((...args: unknown[]) => unknown) | undefined
Example
new Plot
.on("click.Shape", function(d) {
console.log("data for shape clicked:", d);
})
.on("click.Legend", function(d) {
console.log("data for legend clicked:", d);
})Inherited from
Call Signature
on(
_:string,f: (...args:unknown[]) =>unknown):this
Defined in: utils/BaseClass.ts:178
Event listener for the specified event typenames. Mirrors the core d3-selection behavior.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string |
| f | (...args: unknown[]) => unknown |
Returns
this
Example
new Plot
.on("click.Shape", function(d) {
console.log("data for shape clicked:", d);
})
.on("click.Legend", function(d) {
console.log("data for legend clicked:", d);
})Inherited from
Call Signature
on(
_:Record<string, (...args:unknown[]) =>unknown>):this
Defined in: utils/BaseClass.ts:179
Event listener for the specified event typenames. Mirrors the core d3-selection behavior.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, (...args: unknown[]) => unknown> |
Returns
this
Example
new Plot
.on("click.Shape", function(d) {
console.log("data for shape clicked:", d);
})
.on("click.Legend", function(d) {
console.log("data for legend clicked:", d);
})Inherited from
opacity()
Call Signature
opacity():
AccessorFn
Defined in: shapes/Shape.ts:1302
The opacity accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
opacity(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1303
The opacity accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
parent()
Call Signature
parent():
Record<string,unknown>
Defined in: utils/BaseClass.ts:200
Parent config used by the wrapper.
Returns
Record<string, unknown>
Inherited from
Call Signature
parent(
_:Record<string,unknown>):this
Defined in: utils/BaseClass.ts:201
Parent config used by the wrapper.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> |
Returns
this
Inherited from
pointerEvents()
Call Signature
pointerEvents():
AccessorFn
Defined in: shapes/Shape.ts:1313
The pointer-events CSS property for each shape.
Returns
AccessorFn
Inherited from
Call Signature
pointerEvents(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1314
The pointer-events CSS property for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
render()
render(
callback?: () =>void):this
Defined in: shapes/Area.ts:171
Draws the area polygons.
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| callback? | () => void | Optional callback invoked after rendering completes. |
Returns
this
Overrides
role()
Call Signature
role():
AccessorFn
Defined in: shapes/Shape.ts:1325
The role attribute.
Returns
AccessorFn
Inherited from
Call Signature
role(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1326
The role attribute.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
rotate()
Call Signature
rotate():
AccessorFn
Defined in: shapes/Shape.ts:1336
The rotation angle in degrees for each shape.
Returns
AccessorFn
Inherited from
Call Signature
rotate(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1337
The rotation angle in degrees for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
rx()
Call Signature
rx():
AccessorFn
Defined in: shapes/Shape.ts:1347
Defines the "rx" attribute for the shapes.
Returns
AccessorFn
Inherited from
Call Signature
rx(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1348
Defines the "rx" attribute for the shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
ry()
Call Signature
ry():
AccessorFn
Defined in: shapes/Shape.ts:1358
Defines the "rx" attribute for the shapes.
Returns
AccessorFn
Inherited from
Call Signature
ry(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1359
Defines the "rx" attribute for the shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
scale()
Call Signature
scale():
AccessorFn
Defined in: shapes/Shape.ts:1369
The scale transform accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
scale(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1370
The scale transform accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
select()
Call Signature
select():
Selection
Defined in: shapes/Shape.ts:1380
The SVG container element as a d3 selector or DOM element.
Returns
Selection
Inherited from
Call Signature
select(
_:string|HTMLElement|SVGElement|null):this
Defined in: shapes/Shape.ts:1381
The SVG container element as a d3 selector or DOM element.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | HTMLElement | SVGElement | null |
Returns
this
Inherited from
shapeConfig()
Call Signature
shapeConfig():
D3plusConfig
Defined in: utils/BaseClass.ts:225
Configuration object with key/value pairs applied as method calls on each shape.
Returns
Inherited from
Call Signature
shapeConfig(
_:D3plusConfig):this
Defined in: utils/BaseClass.ts:226
Configuration object with key/value pairs applied as method calls on each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | D3plusConfig |
Returns
this
Inherited from
shapeRendering()
Call Signature
shapeRendering():
AccessorFn
Defined in: shapes/Shape.ts:1396
The shape-rendering.
Returns
AccessorFn
Example
function(d) {
return d.x;
}Inherited from
Call Signature
shapeRendering(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1397
The shape-rendering.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Example
function(d) {
return d.x;
}Inherited from
sort()
Call Signature
sort(): ((
a:DataPoint,b:DataPoint) =>number) |null
Defined in: shapes/Shape.ts:1408
A comparator function used to sort shapes for layering order.
Returns
((a: DataPoint, b: DataPoint) => number) | null
Inherited from
Call Signature
sort(
_: ((a:DataPoint,b:DataPoint) =>number) |null):this
Defined in: shapes/Shape.ts:1409
A comparator function used to sort shapes for layering order.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | ((a: DataPoint, b: DataPoint) => number) | null |
Returns
this
Inherited from
stroke()
Call Signature
stroke():
AccessorFn
Defined in: shapes/Shape.ts:1419
The stroke color accessor for each shape.
Returns
AccessorFn
Inherited from
Call Signature
stroke(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1420
The stroke color accessor for each shape.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
strokeDasharray()
Call Signature
strokeDasharray():
AccessorFn
Defined in: shapes/Shape.ts:1430
Defines the "stroke-dasharray" attribute for the shapes.
Returns
AccessorFn
Inherited from
Call Signature
strokeDasharray(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1431
Defines the "stroke-dasharray" attribute for the shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
strokeLinecap()
Call Signature
strokeLinecap():
AccessorFn
Defined in: shapes/Shape.ts:1442
Defines the "stroke-linecap" attribute for the shapes. Accepted values are "butt", "round", and "square".
Returns
AccessorFn
Inherited from
Call Signature
strokeLinecap(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1443
Defines the "stroke-linecap" attribute for the shapes. Accepted values are "butt", "round", and "square".
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
strokeOpacity()
Call Signature
strokeOpacity():
AccessorFn
Defined in: shapes/Shape.ts:1454
Defines the "stroke-opacity" attribute for the shapes.
Returns
AccessorFn
Inherited from
Call Signature
strokeOpacity(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1455
Defines the "stroke-opacity" attribute for the shapes.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
strokeWidth()
Call Signature
strokeWidth():
AccessorFn
Defined in: shapes/Shape.ts:1466
The stroke-width.
Returns
AccessorFn
Inherited from
Call Signature
strokeWidth(
_:number|AccessorFn):this
Defined in: shapes/Shape.ts:1467
The stroke-width.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Inherited from
textAnchor()
Call Signature
textAnchor():
AccessorFn
Defined in: shapes/Shape.ts:1477
The text-anchor.
Returns
AccessorFn
Inherited from
Call Signature
textAnchor(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1478
The text-anchor.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
texture()
Call Signature
texture():
AccessorFn
Defined in: shapes/Shape.ts:1488
Defines the texture used inside of each shape. This uses the textures.js package, and expects either a simple string ("lines" or "circles") or a more complex Object containing the various properties of the texture (ie. {texture: "lines", orientation: "3/8", stroke: "darkorange"}). If multiple textures are necessary, provide an accsesor Function that returns the correct String/Object for each given data point and index.
Returns
AccessorFn
Inherited from
Call Signature
texture(
_:string|Record<string,unknown> |AccessorFn):this
Defined in: shapes/Shape.ts:1489
Defines the texture used inside of each shape. This uses the textures.js package, and expects either a simple string ("lines" or "circles") or a more complex Object containing the various properties of the texture (ie. {texture: "lines", orientation: "3/8", stroke: "darkorange"}). If multiple textures are necessary, provide an accsesor Function that returns the correct String/Object for each given data point and index.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | Record<string, unknown> | AccessorFn |
Returns
this
Inherited from
textureDefault()
Call Signature
textureDefault():
Record<string,unknown>
Defined in: shapes/Shape.ts:1503
A series of global texture methods to be used for all textures (ie. {stroke: "darkorange", strokeWidth: 2}).
Returns
Record<string, unknown>
Inherited from
Call Signature
textureDefault(
_:Record<string,unknown>):this
Defined in: shapes/Shape.ts:1504
A series of global texture methods to be used for all textures (ie. {stroke: "darkorange", strokeWidth: 2}).
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | Record<string, unknown> |
Returns
this
Inherited from
translate()
Call Signature
translate(): (
d:string,locale?:string) =>string
Defined in: utils/BaseClass.ts:214
Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.
Returns
(d: string, locale?: string) => string
Example
.translate(function(d) {
return d === "Back" ? "Get outta here" : d;
})Inherited from
Call Signature
translate(
_: (d:string,locale?:string) =>string):this
Defined in: utils/BaseClass.ts:215
Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | (d: string, locale?: string) => string |
Returns
this
Example
.translate(function(d) {
return d === "Back" ? "Get outta here" : d;
})Inherited from
vectorEffect()
Call Signature
vectorEffect():
AccessorFn
Defined in: shapes/Shape.ts:1514
The vector-effect.
Returns
AccessorFn
Inherited from
Call Signature
vectorEffect(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1515
The vector-effect.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
verticalAlign()
Call Signature
verticalAlign():
AccessorFn
Defined in: shapes/Shape.ts:1525
The vertical alignment.
Returns
AccessorFn
Inherited from
Call Signature
verticalAlign(
_:string|AccessorFn):this
Defined in: shapes/Shape.ts:1526
The vertical alignment.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | string | AccessorFn |
Returns
this
Inherited from
x()
Call Signature
x():
AccessorFn
Defined in: shapes/Area.ts:302
The x position accessor. Also sets x0 to the same value.
Returns
AccessorFn
Overrides
Call Signature
x(
_:number|AccessorFn):this
Defined in: shapes/Area.ts:303
The x position accessor. Also sets x0 to the same value.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Overrides
x0()
Call Signature
x0():
AccessorFn
Defined in: shapes/Area.ts:314
The x0 (left edge) position accessor for the area.
Returns
AccessorFn
Call Signature
x0(
_:number|AccessorFn):this
Defined in: shapes/Area.ts:315
The x0 (left edge) position accessor for the area.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
x1()
Call Signature
x1():
AccessorFn|null
Defined in: shapes/Area.ts:327
The x1 (right edge) position accessor for the area.
Returns
AccessorFn | null
Call Signature
x1(
_:number|AccessorFn|null):this
Defined in: shapes/Area.ts:328
The x1 (right edge) position accessor for the area.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn | null |
Returns
this
y()
Call Signature
y():
AccessorFn
Defined in: shapes/Area.ts:344
The y position accessor. Also sets y0 to the same value.
Returns
AccessorFn
Overrides
Call Signature
y(
_:number|AccessorFn):this
Defined in: shapes/Area.ts:345
The y position accessor. Also sets y0 to the same value.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
Overrides
y0()
Call Signature
y0():
AccessorFn
Defined in: shapes/Area.ts:356
The y0 (top edge) position accessor for the area.
Returns
AccessorFn
Call Signature
y0(
_:number|AccessorFn):this
Defined in: shapes/Area.ts:357
The y0 (top edge) position accessor for the area.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn |
Returns
this
y1()
Call Signature
y1():
AccessorFn|null
Defined in: shapes/Area.ts:369
The y1 (bottom edge) position accessor for the area.
Returns
AccessorFn | null
Call Signature
y1(
_:number|AccessorFn|null):this
Defined in: shapes/Area.ts:370
The y1 (bottom edge) position accessor for the area.
Parameters
| Parameter | Type |
| ------ | ------ |
| _ | number | AccessorFn | null |
Returns
this
Properties
| Property | Type | Overrides | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| _active | ((d: DataPoint, i: number) => boolean) | null | - | Shape._active | shapes/Shape.ts:116 |
| _activeGroup | Selection | - | Shape._activeGroup | shapes/Shape.ts:112 |
| _activeOpacity | number | - | Shape._activeOpacity | shapes/Shape.ts:57 |
| _activeStyle | Record<string, unknown> | - | Shape._activeStyle | shapes/Shape.ts:58 |
| _ariaLabel | AccessorFn | - | Shape._ariaLabel | shapes/Shape.ts:59 |
| _backgroundImage | AccessorFn | - | Shape._backgroundImage | shapes/Shape.ts:60 |
| _backgroundImageClass | Image | - | Shape._backgroundImageClass | shapes/Shape.ts:61 |
| _configDefault? | D3plusConfig | - | Shape._configDefault | utils/BaseClass.ts:69 |
| _curve | AccessorFn | Shape._curve | - | shapes/Area.ts:18 |
| _data | DataPoint[] | - | Shape._data | shapes/Shape.ts:62 |
| _defined | (d: DataPoint) => boolean | Shape._defined | - | shapes/Area.ts:19 |
| _discrete | string | required | - | Shape._discrete | shapes/Shape.ts:118 |
| _duration | number | - | Shape._duration | shapes/Shape.ts:63 |
| _enter | Selection | - | Shape._enter | shapes/Shape.ts:109 |
| _exit | Selection | - | Shape._exit | shapes/Shape.ts:110 |
| _fill | AccessorFn | - | Shape._fill | shapes/Shape.ts:64 |
| _fillOpacity | AccessorFn | - | Shape._fillOpacity | shapes/Shape.ts:65 |
| _group | Selection | - | Shape._group | shapes/Shape.ts:107 |
| _hitArea | ((d: DataPoint, i: number, aes: ShapeAes) => `Recor
