@d3plus/core 3.0.16 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88485 -2998
  3. package/es/index.js +1 -1
  4. package/es/src/charts/AreaPlot.js +1 -3
  5. package/es/src/charts/BarChart.js +1 -3
  6. package/es/src/charts/BoxWhisker.js +2 -4
  7. package/es/src/charts/BumpChart.js +4 -5
  8. package/es/src/charts/Donut.js +1 -3
  9. package/es/src/charts/Geomap.js +47 -88
  10. package/es/src/charts/LinePlot.js +1 -3
  11. package/es/src/charts/Matrix.js +27 -46
  12. package/es/src/charts/Network.js +87 -81
  13. package/es/src/charts/Pack.js +21 -34
  14. package/es/src/charts/Pie.js +12 -24
  15. package/es/src/charts/Plot.js +226 -321
  16. package/es/src/charts/Priestley.js +18 -36
  17. package/es/src/charts/Radar.js +100 -47
  18. package/es/src/charts/RadialMatrix.js +35 -47
  19. package/es/src/charts/Rings.js +99 -90
  20. package/es/src/charts/Sankey.js +85 -75
  21. package/es/src/charts/StackedArea.js +1 -3
  22. package/es/src/charts/Tree.js +27 -28
  23. package/es/src/charts/Treemap.js +117 -71
  24. package/es/src/charts/Viz.js +296 -492
  25. package/es/src/charts/drawSteps/drawAttribution.js +1 -1
  26. package/es/src/charts/drawSteps/drawBack.js +1 -2
  27. package/es/src/charts/drawSteps/drawColorScale.js +1 -2
  28. package/es/src/charts/drawSteps/drawLegend.js +8 -10
  29. package/es/src/charts/drawSteps/drawSubtitle.js +1 -3
  30. package/es/src/charts/drawSteps/drawTimeline.js +12 -9
  31. package/es/src/charts/drawSteps/drawTitle.js +1 -3
  32. package/es/src/charts/drawSteps/drawTotal.js +1 -3
  33. package/es/src/charts/drawSteps/zoomControls.js +19 -21
  34. package/es/src/charts/events/click.legend.js +2 -3
  35. package/es/src/charts/events/click.shape.js +2 -4
  36. package/es/src/charts/events/mouseenter.js +7 -8
  37. package/es/src/charts/events/mouseleave.js +1 -3
  38. package/es/src/charts/events/mousemove.legend.js +3 -4
  39. package/es/src/charts/events/mousemove.shape.js +2 -4
  40. package/es/src/charts/events/touchstart.body.js +1 -1
  41. package/es/src/charts/helpers/matrixData.js +11 -4
  42. package/es/src/charts/helpers/tileAttributions.js +2 -1
  43. package/es/src/charts/plotBuffers/Bar.js +55 -12
  44. package/es/src/charts/plotBuffers/Box.js +55 -12
  45. package/es/src/charts/plotBuffers/Circle.js +9 -11
  46. package/es/src/charts/plotBuffers/Line.js +4 -6
  47. package/es/src/charts/plotBuffers/Rect.js +10 -12
  48. package/es/src/charts/plotBuffers/discreteBuffer.js +4 -2
  49. package/es/src/charts/plotBuffers/numericBuffer.js +7 -6
  50. package/es/src/components/Axis.js +298 -426
  51. package/es/src/components/AxisBottom.js +1 -3
  52. package/es/src/components/AxisLeft.js +1 -3
  53. package/es/src/components/AxisRight.js +1 -3
  54. package/es/src/components/AxisTop.js +1 -3
  55. package/es/src/components/ColorScale.js +80 -197
  56. package/es/src/components/Legend.js +82 -135
  57. package/es/src/components/Message.js +27 -19
  58. package/es/src/components/TextBox.js +106 -262
  59. package/es/src/components/Timeline.js +88 -155
  60. package/es/src/components/Tooltip.js +301 -330
  61. package/es/src/shapes/Area.js +95 -74
  62. package/es/src/shapes/Bar.js +46 -86
  63. package/es/src/shapes/Box.js +104 -118
  64. package/es/src/shapes/Circle.js +29 -30
  65. package/es/src/shapes/Image.js +44 -102
  66. package/es/src/shapes/Line.js +74 -40
  67. package/es/src/shapes/Path.js +23 -25
  68. package/es/src/shapes/Rect.js +29 -41
  69. package/es/src/shapes/Shape.js +146 -363
  70. package/es/src/shapes/Whisker.js +89 -90
  71. package/es/src/utils/AccessorFn.js +4 -0
  72. package/es/src/utils/BaseClass.js +53 -82
  73. package/es/src/utils/D3plusConfig.js +1 -0
  74. package/es/src/utils/RESET.js +2 -4
  75. package/es/src/utils/accessor.js +4 -5
  76. package/es/src/utils/configPrep.js +13 -12
  77. package/es/src/utils/constant.js +2 -3
  78. package/es/src/utils/getProp.js +4 -4
  79. package/es/src/utils/index.js +0 -1
  80. package/package.json +30 -22
  81. package/types/index.d.ts +5 -0
  82. package/types/src/charts/AreaPlot.d.ts +16 -0
  83. package/types/src/charts/BarChart.d.ts +16 -0
  84. package/types/src/charts/BoxWhisker.d.ts +11 -0
  85. package/types/src/charts/BumpChart.d.ts +36 -0
  86. package/types/src/charts/Donut.d.ts +11 -0
  87. package/types/src/charts/Geomap.d.ts +120 -0
  88. package/types/src/charts/LinePlot.d.ts +15 -0
  89. package/types/src/charts/Matrix.d.ts +74 -0
  90. package/types/src/charts/Network.d.ts +78 -0
  91. package/types/src/charts/Pack.d.ts +47 -0
  92. package/types/src/charts/Pie.d.ts +44 -0
  93. package/types/src/charts/Plot.d.ts +199 -0
  94. package/types/src/charts/Priestley.d.ts +37 -0
  95. package/types/src/charts/Radar.d.ts +38 -0
  96. package/types/src/charts/RadialMatrix.d.ts +78 -0
  97. package/types/src/charts/Rings.d.ts +74 -0
  98. package/types/src/charts/Sankey.d.ts +81 -0
  99. package/types/src/charts/StackedArea.d.ts +14 -0
  100. package/types/src/charts/Tree.d.ts +33 -0
  101. package/types/src/charts/Treemap.d.ts +51 -0
  102. package/types/src/charts/Viz.d.ts +402 -0
  103. package/types/src/charts/drawSteps/drawAttribution.d.ts +7 -0
  104. package/types/src/charts/drawSteps/drawBack.d.ts +6 -0
  105. package/types/src/charts/drawSteps/drawColorScale.d.ts +6 -0
  106. package/types/src/charts/drawSteps/drawLegend.d.ts +12 -0
  107. package/types/src/charts/drawSteps/drawSubtitle.d.ts +7 -0
  108. package/types/src/charts/drawSteps/drawTimeline.d.ts +7 -0
  109. package/types/src/charts/drawSteps/drawTitle.d.ts +7 -0
  110. package/types/src/charts/drawSteps/drawTotal.d.ts +7 -0
  111. package/types/src/charts/drawSteps/zoomControls.d.ts +7 -0
  112. package/types/src/charts/events/click.legend.d.ts +8 -0
  113. package/types/src/charts/events/click.shape.d.ts +8 -0
  114. package/types/src/charts/events/mouseenter.d.ts +8 -0
  115. package/types/src/charts/events/mouseleave.d.ts +8 -0
  116. package/types/src/charts/events/mousemove.legend.d.ts +9 -0
  117. package/types/src/charts/events/mousemove.shape.d.ts +9 -0
  118. package/types/src/charts/events/touchstart.body.d.ts +7 -0
  119. package/types/src/charts/helpers/matrixData.d.ts +11 -0
  120. package/types/src/charts/helpers/tileAttributions.d.ts +6 -0
  121. package/types/src/charts/index.d.ts +21 -0
  122. package/types/src/charts/plotBuffers/Bar.d.ts +16 -0
  123. package/types/src/charts/plotBuffers/Box.d.ts +16 -0
  124. package/types/src/charts/plotBuffers/Circle.d.ts +20 -0
  125. package/types/src/charts/plotBuffers/Line.d.ts +16 -0
  126. package/types/src/charts/plotBuffers/Rect.d.ts +19 -0
  127. package/types/src/charts/plotBuffers/discreteBuffer.d.ts +7 -0
  128. package/types/src/charts/plotBuffers/numericBuffer.d.ts +5 -0
  129. package/types/src/components/Axis.d.ts +309 -0
  130. package/types/src/components/AxisBottom.d.ts +11 -0
  131. package/types/src/components/AxisLeft.d.ts +11 -0
  132. package/types/src/components/AxisRight.d.ts +11 -0
  133. package/types/src/components/AxisTop.d.ts +11 -0
  134. package/types/src/components/ColorScale.d.ts +208 -0
  135. package/types/src/components/Legend.d.ts +157 -0
  136. package/types/src/components/Message.d.ts +40 -0
  137. package/types/src/components/TextBox.d.ts +278 -0
  138. package/types/src/components/Timeline.d.ts +157 -0
  139. package/types/src/components/Tooltip.d.ts +297 -0
  140. package/types/src/components/index.d.ts +11 -0
  141. package/types/src/shapes/Area.d.ts +81 -0
  142. package/types/src/shapes/Bar.d.ts +104 -0
  143. package/types/src/shapes/Box.d.ts +121 -0
  144. package/types/src/shapes/Circle.d.ts +44 -0
  145. package/types/src/shapes/Image.d.ts +124 -0
  146. package/types/src/shapes/Line.d.ts +48 -0
  147. package/types/src/shapes/Path.d.ts +38 -0
  148. package/types/src/shapes/Rect.d.ts +54 -0
  149. package/types/src/shapes/Shape.d.ts +378 -0
  150. package/types/src/shapes/Whisker.d.ts +96 -0
  151. package/types/src/shapes/index.d.ts +10 -0
  152. package/types/src/utils/AccessorFn.d.ts +6 -0
  153. package/types/src/utils/BaseClass.d.ts +76 -0
  154. package/types/src/utils/D3plusConfig.d.ts +164 -0
  155. package/types/src/utils/RESET.d.ts +3 -0
  156. package/types/src/utils/accessor.d.ts +13 -0
  157. package/types/src/utils/configPrep.d.ts +28 -0
  158. package/types/src/utils/constant.d.ts +11 -0
  159. package/types/src/utils/getProp.d.ts +9 -0
  160. package/types/src/utils/index.d.ts +8 -0
  161. package/umd/d3plus-core.full.js +20127 -18701
  162. package/umd/d3plus-core.full.js.map +1 -1
  163. package/umd/d3plus-core.full.min.js +2920 -5394
  164. package/umd/d3plus-core.js +1920 -4074
  165. package/umd/d3plus-core.js.map +1 -1
  166. package/umd/d3plus-core.min.js +1605 -3937
  167. package/es/src/utils/uuid.js +0 -13
@@ -4,4 +4,3 @@ export { default as configPrep } from "./configPrep.js";
4
4
  export { default as constant } from "./constant.js";
5
5
  export { default as getProp } from "./getProp.js";
6
6
  export { default as RESET } from "./RESET.js";
7
- export { default as uuid } from "./uuid.js";
package/package.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "3.0.16",
3
+ "version": "3.1.1",
4
4
  "description": "Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "exports": "./es/index.js",
7
+ "types": "./types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./types/index.d.ts",
11
+ "default": "./es/index.js"
12
+ }
13
+ },
8
14
  "browser": "./umd/d3plus-core.full.js",
9
15
  "engines": {
10
- "node": ">=18"
16
+ "node": ">=20"
11
17
  },
12
18
  "sideEffects": false,
13
19
  "files": [
14
20
  "umd",
15
- "es"
21
+ "es",
22
+ "types"
16
23
  ],
17
24
  "homepage": "https://d3plus.org",
18
25
  "repository": {
@@ -27,43 +34,44 @@
27
34
  "data",
28
35
  "visualization"
29
36
  ],
30
- "scripts": {
31
- "build:esm": "node ../../scripts/build-esm.js",
32
- "build:umd": "node ../../scripts/build-umd.js",
33
- "dev": "node ../../scripts/dev.js",
34
- "test": "eslint index.js src/**/*.js && eslint --global=it test && mocha 'test/**/*-test.js'"
35
- },
36
37
  "dependencies": {
37
- "@d3plus/color": "3.0.16",
38
- "@d3plus/data": "3.0.16",
39
- "@d3plus/dom": "3.0.16",
40
- "@d3plus/format": "3.0.16",
41
- "@d3plus/locales": "3.0.16",
42
- "@d3plus/math": "3.0.16",
43
- "@d3plus/text": "3.0.16",
44
- "@popperjs/core": "^2.11.8",
38
+ "@floating-ui/dom": "^1.6.0",
45
39
  "d3-array": "^3.2.4",
46
40
  "d3-brush": "^3.0.0",
47
- "d3-collection": "^1.0.7",
48
41
  "d3-color": "^3.1.0",
49
42
  "d3-composite-projections": "^1.4.0",
50
43
  "d3-force": "^3.0.0",
51
44
  "d3-geo": "^3.1.1",
52
45
  "d3-geo-projection": "^4.0.0",
53
46
  "d3-hierarchy": "^3.1.2",
47
+ "d3-interpolate": "^3.0.1",
54
48
  "d3-interpolate-path": "^2.3.0",
55
49
  "d3-polygon": "^3.0.1",
56
- "d3-queue": "^3.0.7",
57
50
  "d3-sankey": "^0.12.3",
58
51
  "d3-scale": "^4.0.2",
59
52
  "d3-selection": "^3.0.0",
60
53
  "d3-shape": "^3.2.0",
61
54
  "d3-tile": "^1.0.0",
55
+ "d3-time-format": "^4.1.0",
62
56
  "d3-transition": "^3.0.1",
63
57
  "d3-zoom": "^3.0.0",
64
- "lrucache": "^1.0.3",
65
58
  "open-color": "^1.9.1",
66
59
  "textures": "^1.2.3",
67
- "topojson-client": "^3.1.0"
60
+ "topojson-client": "^3.1.0",
61
+ "@d3plus/dom": "3.1.1",
62
+ "@d3plus/locales": "3.1.1",
63
+ "@d3plus/format": "3.1.1",
64
+ "@d3plus/text": "3.1.1",
65
+ "@d3plus/data": "3.1.1",
66
+ "@d3plus/color": "3.1.1",
67
+ "@d3plus/math": "3.1.1"
68
+ },
69
+ "scripts": {
70
+ "build:esm": "node ../../scripts/build-esm.js",
71
+ "build:types": "tsc",
72
+ "build:umd": "node ../../scripts/build-umd.js",
73
+ "dev": "node ../../scripts/dev.js",
74
+ "test": "eslint index.ts src/**/*.ts && eslint --global=it test && mocha 'test/**/*-test.js'",
75
+ "test:coverage": "c8 -r text -r lcov --src src mocha 'test/**/*-test.js'"
68
76
  }
69
77
  }
@@ -0,0 +1,5 @@
1
+ export { AreaPlot, BarChart, BoxWhisker, BumpChart, Donut, Geomap, LinePlot, Matrix, Network, Pack, Pie, Plot, Priestley, Radar, RadialMatrix, Rings, Sankey, StackedArea, Tree, Treemap, Viz, } from "./src/charts/index.js";
2
+ export { Axis, AxisBottom, AxisLeft, AxisRight, AxisTop, ColorScale, Legend, Message, TextBox, Timeline, Tooltip, } from "./src/components/index.js";
3
+ export { Area, Bar, Box, Circle, Image, Line, Path, Rect, Shape, Whisker, } from "./src/shapes/index.js";
4
+ export { accessor, BaseClass, configPrep, constant, RESET, } from "./src/utils/index.js";
5
+ export type { D3plusConfig, AxisConfig, TooltipConfig, } from "./src/utils/index.js";
@@ -0,0 +1,16 @@
1
+ import { default as Plot } from "./Plot.js";
2
+ /**
3
+ Creates an area plot based on an array of data.
4
+ @example <caption>the equivalent of calling:</caption>
5
+ new d3plus.Plot()
6
+ .baseline(0)
7
+ .discrete("x")
8
+ .shape("Area")
9
+ */
10
+ export default class AreaPlot extends Plot {
11
+ /**
12
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
13
+ @private
14
+ */
15
+ constructor();
16
+ }
@@ -0,0 +1,16 @@
1
+ import { default as Plot } from "./Plot.js";
2
+ /**
3
+ Creates a bar chart based on an array of data.
4
+ @example <caption>the equivalent of calling:</caption>
5
+ new d3plus.Plot()
6
+ .baseline(0)
7
+ .discrete("x")
8
+ .shape("Bar")
9
+ */
10
+ export default class BarChart extends Plot {
11
+ /**
12
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
13
+ @private
14
+ */
15
+ constructor();
16
+ }
@@ -0,0 +1,11 @@
1
+ import { default as Plot } from "./Plot.js";
2
+ /**
3
+ Creates a simple box and whisker based on an array of data.
4
+ */
5
+ export default class BoxWhisker extends Plot {
6
+ /**
7
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
8
+ @private
9
+ */
10
+ constructor();
11
+ }
@@ -0,0 +1,36 @@
1
+ import { default as Plot } from "./Plot.js";
2
+ /**
3
+ Creates a bump chart based on an array of data.
4
+ @example <caption>the equivalent of calling:</caption>
5
+ new d3plus.Plot()
6
+ .discrete("x")
7
+ .shape("Line")
8
+ .y2(d => this._y(d))
9
+ .yConfig({
10
+ tickFormat: val => {
11
+ const data = this._formattedData;
12
+ const xDomain = this._xDomain;
13
+ const startData = data.filter(d => d.x === xDomain[0]);
14
+ const d = startData.find(d => d.y === val);
15
+ return this._drawLabel(d, d.i);
16
+ }
17
+ })
18
+ .y2Config({
19
+ tickFormat: val => {
20
+ const data = this._formattedData;
21
+ const xDomain = this._xDomain;
22
+ const endData = data.filter(d => d.x === xDomain[xDomain.length - 1]);
23
+ const d = endData.find(d => d.y === val);
24
+ return this._drawLabel(d, d.i);
25
+ }
26
+ })
27
+ .ySort((a, b) => b.y - a.y)
28
+ .y2Sort((a, b) => b.y - a.y)
29
+ */
30
+ export default class BumpChart extends Plot {
31
+ /**
32
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
33
+ @private
34
+ */
35
+ constructor();
36
+ }
@@ -0,0 +1,11 @@
1
+ import { default as Pie } from "./Pie.js";
2
+ /**
3
+ Extends the Pie visualization to create a donut chart.
4
+ */
5
+ export default class Donut extends Pie {
6
+ /**
7
+ Invoked when creating a new class instance, and sets any default parameters.
8
+ @private
9
+ */
10
+ constructor();
11
+ }
@@ -0,0 +1,120 @@
1
+ import { zoomTransform } from "d3-zoom";
2
+ import type { DataPoint } from "@d3plus/data";
3
+ import Viz from "./Viz.js";
4
+ /**
5
+ Creates a geographical map with zooming, panning, image tiles, and the ability to layer choropleth paths and coordinate points. See [this example](https://d3plus.org/examples/d3plus-geomap/getting-started/) for help getting started.
6
+ */
7
+ export default class Geomap extends Viz {
8
+ [key: string]: any;
9
+ /**
10
+ Invoked when creating a new class instance, and sets any default parameters.
11
+ @private
12
+ */
13
+ constructor();
14
+ /**
15
+ Renders map tiles based on the current zoom level.
16
+ @private
17
+ */
18
+ _renderTiles(transform?: ReturnType<typeof zoomTransform>, duration?: number): void;
19
+ /**
20
+ Extends the draw behavior of the abstract Viz class.
21
+ @private
22
+ */
23
+ _draw(callback?: () => void): this;
24
+ /**
25
+ Topojson files sometimes include small geographies that negatively impact how the library determines the default zoom level (for example, a small island or territory far off the coast that is barely visible to the eye). The fitFilter method can be used to remove specific geographies from the logic used to determine the zooming.
26
+
27
+ The *value* passed can be a single id to remove, an array of ids, or a filter function. Take a look at the [Choropleth Example](http://d3plus.org/examples/d3plus-geomap/getting-started/) to see it in action.
28
+ */
29
+ fitFilter(_?: string | string[] | ((d: Record<string, unknown>) => boolean)): this | ((d: Record<string, unknown>) => boolean);
30
+ /**
31
+ If the topojson being used to determine the zoom fit (either the main [topojson](#Geomap.topojson) object or the [fitObject](#Geomap.fitObject)) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use for the zoom fit.
32
+
33
+ If not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.
34
+ */
35
+ fitKey(_?: string): this | string;
36
+ /**
37
+ The topojson to be used for the initial projection [fit extent](https://github.com/d3/d3-geo#projection_fitExtent). The value passed should either be a valid Topojson *Object* or a *String* representing a filepath or URL to be loaded.
38
+
39
+ Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function needs to return the final Topojson *Object*.
40
+ @param _ `undefined`
41
+ @param f Topojson data or a URL to load.
42
+ */
43
+ fitObject(_?: Record<string, unknown> | string, f?: (data: unknown) => Record<string, unknown>): this | Record<string, unknown>;
44
+ /**
45
+ The color visible behind any shapes drawn on the map projection. By default, a color value matching the color used in the map tiles is used to help mask the loading time needed to render the tiles. Any value CSS color value may be used, including hexidecimal, rgb, rgba, and color strings like `"blue"` and `"transparent"`.
46
+ @param _ "#d4dadc"]
47
+ */
48
+ ocean(_?: string): this | string;
49
+ /**
50
+ The accessor to be used when detecting coordinate points in the objects passed to the [data](https://d3plus.org/docs/#Viz.data) method. Values are expected to be in the format `[longitude, latitude]`, which is in-line with d3's expected coordinate mapping.
51
+ */
52
+ point(_?: ((d: DataPoint, i: number) => number[]) | number[]): this | ((d: DataPoint, i: number) => number[]);
53
+ /**
54
+ The accessor or static value to be used for sizing coordinate points.
55
+ */
56
+ pointSize(_?: number | ((d: DataPoint, i: number) => number)): this | number | ((d: DataPoint, i: number) => number);
57
+ /**
58
+ The maximum pixel radius used in the scale for sizing coordinate points.
59
+ @param _ 10]
60
+ */
61
+ pointSizeMax(_?: number): this | number;
62
+ /**
63
+ The minimum pixel radius used in the scale for sizing coordinate points.
64
+ @param _ 5]
65
+ */
66
+ pointSizeMin(_?: number): this | number;
67
+ /**
68
+ The map projection used when displaying topojson and coordinate points. All projections from [d3-geo](https://github.com/d3/d3-geo#projections), [d3-geo-projection](https://github.com/d3/d3-geo-projection#api-reference), and [d3-composite-projections](http://geoexamples.com/d3-composite-projections/) are accepted, either as the string name (ie. "geoMercator") or the generator function itself. Map tiles are only usable when the projection is set to Mercator (the default).
69
+ @param _ "geoMercator"
70
+ */
71
+ projection(_?: string | ((...args: unknown[]) => unknown)): this | ((...args: unknown[]) => unknown);
72
+ /**
73
+ The outer padding between the edge of the visualization and the shapes drawn. The value passed can be either a single number to be used on all sides, or a CSS string pattern (ie. `"20px 0 10px"`).
74
+ @param _ 20]
75
+ */
76
+ projectionPadding(_?: number | string): this | Record<string, number>;
77
+ /**
78
+ An array that corresponds to the value passed to the projection's [rotate](https://github.com/d3/d3-geo#projection_rotate) function. Use this method to shift the centerpoint of a map.
79
+ @param _ [0, 0]]
80
+ */
81
+ projectionRotate(_?: number[]): this | number[];
82
+ /**
83
+ Toggles the visibility of the map tiles.
84
+ @param _ true]
85
+ */
86
+ tiles(_?: boolean): this | boolean;
87
+ /**
88
+ By default, d3plus uses the `light_all` style provided by [CARTO](https://carto.com/location-data-services/basemaps/) for it's map tiles. The [tileUrl](https://d3plus.org/docs/#Geomap.tileUrl) method changes the base URL used for fetching the tiles, as long as the string passed contains `{x}`, `{y}`, and `{z}` variables enclosed in curly brackets for the zoom logic to load the correct tiles.
89
+ @param _ "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"]
90
+ */
91
+ tileUrl(_?: string): this | string;
92
+ /**
93
+ The topojson to be used for drawing geographical paths. The value passed should either be a valid Topojson *Object* or a *String* representing a filepath or URL to be loaded.
94
+
95
+ Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final Topojson *Obejct*.
96
+ @param _ []
97
+ @param f Topojson data or a URL to load.
98
+ */
99
+ topojson(_?: Record<string, unknown> | string, f?: (data: unknown) => Record<string, unknown>): this | Record<string, unknown>;
100
+ /**
101
+ The function is used to set default color of the map.
102
+ @param _ string
103
+ */
104
+ topojsonFill(_?: string | ((d: DataPoint, i: number) => string)): this | string | ((d: DataPoint, i: number) => string);
105
+ /**
106
+ If the [topojson](#Geomap.topojson) being used contains boundaries that should not be shown, this method can be used to filter them out of the final output. The *value* passed can be a single id to remove, an array of ids, or a filter function.
107
+ */
108
+ topojsonFilter(_?: string | string[] | ((d: Record<string, unknown>) => boolean)): this | ((d: Record<string, unknown>) => boolean);
109
+ /**
110
+ If the [topojson](#Geomap.topojson) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use.
111
+
112
+ If not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.
113
+ */
114
+ topojsonKey(_?: string): this | string;
115
+ /**
116
+ The accessor used to map each topojson geometry to it's corresponding [data](https://d3plus.org/docs/#Viz.data) point.
117
+ @param _ "id"
118
+ */
119
+ topojsonId(_?: string | ((d: Record<string, unknown>) => string)): this | ((d: Record<string, unknown>) => string);
120
+ }
@@ -0,0 +1,15 @@
1
+ import { default as Plot } from "./Plot.js";
2
+ /**
3
+ Creates a line plot based on an array of data.
4
+ @example <caption>the equivalent of calling:</caption>
5
+ new d3plus.Plot()
6
+ .discrete("x")
7
+ .shape("Line")
8
+ */
9
+ export default class LinePlot extends Plot {
10
+ /**
11
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
12
+ @private
13
+ */
14
+ constructor();
15
+ }
@@ -0,0 +1,74 @@
1
+ import type { DataPoint } from "@d3plus/data";
2
+ import Viz from "./Viz.js";
3
+ /**
4
+ Creates a simple rows/columns Matrix view of any dataset. See [this example](https://d3plus.org/examples/d3plus-matrix/getting-started/) for help getting started using the Matrix class.
5
+ */
6
+ export default class Matrix extends Viz {
7
+ [key: string]: any;
8
+ /**
9
+ Invoked when creating a new class instance, and sets any default parameters.
10
+ @private
11
+ */
12
+ constructor();
13
+ /**
14
+ Extends the draw behavior of the abstract Viz class.
15
+ @private
16
+ */
17
+ _draw(callback?: () => void): this;
18
+ /**
19
+ The pixel padding in between each cell.
20
+ */
21
+ cellPadding(_?: number): this | number;
22
+ /**
23
+ Determines which key in your data should be used for each column in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's column value.
24
+
25
+ @example
26
+ function column(d) {
27
+ return d.name;
28
+ }
29
+ */
30
+ column(_?: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])): this | string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]);
31
+ /**
32
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the column labels.
33
+ */
34
+ columnConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
35
+ /**
36
+ A manual list of IDs to be used for columns.
37
+ */
38
+ columnList(_?: DataPoint[keyof DataPoint][]): this | DataPoint[keyof DataPoint][];
39
+ /**
40
+ A sort comparator function that is run on the unique set of column values.
41
+
42
+ @example
43
+ function column(a, b) {
44
+ return a.localeCompare(b);
45
+ }
46
+ */
47
+ columnSort(_?: (...args: unknown[]) => unknown): this | ((...args: unknown[]) => unknown);
48
+ /**
49
+ Determines which key in your data should be used for each row in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's row value.
50
+
51
+ @example
52
+ function row(d) {
53
+ return d.name;
54
+ }
55
+ */
56
+ row(_?: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])): this | string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]);
57
+ /**
58
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the row labels.
59
+ */
60
+ rowConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
61
+ /**
62
+ A manual list of IDs to be used for rows.
63
+ */
64
+ rowList(_?: DataPoint[keyof DataPoint][]): this | DataPoint[keyof DataPoint][];
65
+ /**
66
+ A sort comparator function that is run on the unique set of row values.
67
+
68
+ @example
69
+ function row(a, b) {
70
+ return a.localeCompare(b);
71
+ }
72
+ */
73
+ rowSort(_?: (...args: unknown[]) => unknown): this | ((...args: unknown[]) => unknown);
74
+ }
@@ -0,0 +1,78 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a network visualization based on a defined set of nodes and edges. [Click here](http://d3plus.org/examples/d3plus-network/getting-started/) for help getting started using the Network class.
4
+ */
5
+ export default class Network extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ The hover callback function for highlighting shapes on mouseover.
19
+ */
20
+ hover(_: any): this;
21
+ /**
22
+ A predefined *Array* of edges that connect each object passed to the [node](#Network.node) method. The `source` and `target` keys in each link need to map to the nodes in one of three ways:
23
+ 1. The index of the node in the nodes array (as in [this](http://d3plus.org/examples/d3plus-network/getting-started/) example).
24
+ 2. The actual node *Object* itself.
25
+ 3. A *String* value matching the `id` of the node.
26
+
27
+ The value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded. An optional formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final links *Array*.
28
+ @param f Array of link objects or a URL to load links from.
29
+ */
30
+ links(_: any, f?: any): any;
31
+ /**
32
+ Defines the thickness of the links connecting each node. The value provided can be either a pixel Number to be used for all links, or an accessor function that returns a specific data value to be used in an automatically calculated linear scale.
33
+ */
34
+ linkSize(_?: any): any;
35
+ /**
36
+ Defines the minimum pixel stroke width used in link sizing.
37
+ */
38
+ linkSizeMin(_?: any): any;
39
+ /**
40
+ The type of [continuous d3-scale](https://github.com/d3/d3-scale#continuous-scales) used when calculating the pixel size of links in the network.
41
+ */
42
+ linkSizeScale(_?: any): any;
43
+ /**
44
+ The node group accessor(s). This method overrides the default .groupBy() function from being used with the data passed to .nodes().
45
+ */
46
+ nodeGroupBy(_?: any): any;
47
+ /**
48
+ The list of nodes to be used for drawing the network. The value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded.
49
+
50
+ Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final node *Array*.
51
+ @param f Array of node objects or a URL to load nodes from.
52
+ */
53
+ nodes(_: any, f?: any): any;
54
+ /**
55
+ The size accessor for each node in the network.
56
+ */
57
+ size(_?: any): any;
58
+ /**
59
+ Defines the maximum pixel radius used in size scaling. By default, the maximum size is determined by half the distance of the two closest nodes.
60
+ */
61
+ sizeMax(_?: any): any;
62
+ /**
63
+ Defines the minimum pixel radius used in size scaling.
64
+ */
65
+ sizeMin(_?: any): any;
66
+ /**
67
+ The type of [continuous d3-scale](https://github.com/d3/d3-scale#continuous-scales) used when calculating the pixel size of nodes in the network.
68
+ */
69
+ sizeScale(_?: any): any;
70
+ /**
71
+ The x position accessor for each node. The data passed to .data() takes priority over the .nodes() data array. By default, the x and y positions are determined dynamically based on default force layout properties.
72
+ */
73
+ x(_?: any): any;
74
+ /**
75
+ The y position accessor for each node. The data passed to .data() takes priority over the .nodes() data array. By default, the x and y positions are determined dynamically based on default force layout properties.
76
+ */
77
+ y(_?: any): any;
78
+ }
@@ -0,0 +1,47 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Uses the [d3 pack layout](https://github.com/d3/d3-hierarchy#pack) to creates Circle Packing chart based on an array of data.
4
+ */
5
+ export default class Pack extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ The hover callback function for highlighting shapes on mouseover.
19
+ */
20
+ hover(_: any): this;
21
+ /**
22
+ The inner and outer padding for the pack layout.
23
+ */
24
+ layoutPadding(_: any): any;
25
+ /**
26
+ The opacity of nested circles within the pack layout.
27
+ */
28
+ packOpacity(_: any): any;
29
+ /**
30
+ Sort comparator function for the pack layout. Defaults to descending order by the associated input data's numeric value attribute.
31
+
32
+ @example
33
+ function comparator(a, b) {
34
+ return b.value - a.value;
35
+ }
36
+ */
37
+ sort(_: any): any;
38
+ /**
39
+ The sum accessor used for sizing each circle in the pack layout.
40
+
41
+ @example
42
+ function sum(d) {
43
+ return d.sum;
44
+ }
45
+ */
46
+ sum(_: any): any;
47
+ }
@@ -0,0 +1,44 @@
1
+ import type { DataPoint } from "@d3plus/data";
2
+ import Viz from "./Viz.js";
3
+ /**
4
+ Uses the [d3 pie layout](https://github.com/d3/d3-shape#pies) to creates SVG arcs based on an array of data.
5
+ */
6
+ export default class Pie extends Viz {
7
+ [key: string]: any;
8
+ /**
9
+ Invoked when creating a new class instance, and sets any default parameters.
10
+ @private
11
+ */
12
+ constructor();
13
+ /**
14
+ Extends the draw behavior of the abstract Viz class.
15
+ @private
16
+ */
17
+ _draw(callback?: () => void): this;
18
+ /**
19
+ The pixel value, or function that returns a pixel value, that is used as the inner radius of the Pie (creating a Donut).
20
+ */
21
+ innerRadius(_?: number | (() => number)): this | number | (() => number);
22
+ /**
23
+ The padding between each arc, set as a radian value between \`0\` and \`1\`.
24
+
25
+ If set, this will override any previously set padPixel value.
26
+ */
27
+ padAngle(_?: number): this | number;
28
+ /**
29
+ The padding between each arc, set as a pixel number value.
30
+
31
+ By default the value is \`0\`, which shows no padding between each arc.
32
+
33
+ If \`padAngle\` is defined, the \`padPixel\` value will not be considered.
34
+ */
35
+ padPixel(_?: number): this | number;
36
+ /**
37
+ A comparator function that sorts the Pie slices.
38
+ */
39
+ sort(_?: (...args: unknown[]) => unknown): this | ((...args: unknown[]) => unknown);
40
+ /**
41
+ The accessor key for each data point used to calculate the size of each Pie section.
42
+ */
43
+ value(_?: string | ((d: DataPoint, i: number) => number)): this | string | ((d: DataPoint, i: number) => number);
44
+ }