@d3plus/core 3.1.1 → 3.1.3

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/README.md +5092 -5092
  2. package/es/index.js +2 -0
  3. package/es/index.js.map +1 -0
  4. package/es/src/charts/AreaPlot.js +2 -0
  5. package/es/src/charts/AreaPlot.js.map +1 -0
  6. package/es/src/charts/BarChart.js +2 -0
  7. package/es/src/charts/BarChart.js.map +1 -0
  8. package/es/src/charts/BoxWhisker.js +2 -0
  9. package/es/src/charts/BoxWhisker.js.map +1 -0
  10. package/es/src/charts/BumpChart.js +2 -0
  11. package/es/src/charts/BumpChart.js.map +1 -0
  12. package/es/src/charts/Donut.js +2 -0
  13. package/es/src/charts/Donut.js.map +1 -0
  14. package/es/src/charts/Geomap.js +2 -0
  15. package/es/src/charts/Geomap.js.map +1 -0
  16. package/es/src/charts/LinePlot.js +2 -0
  17. package/es/src/charts/LinePlot.js.map +1 -0
  18. package/es/src/charts/Matrix.js +2 -0
  19. package/es/src/charts/Matrix.js.map +1 -0
  20. package/es/src/charts/Network.js +2 -0
  21. package/es/src/charts/Network.js.map +1 -0
  22. package/es/src/charts/Pack.js +2 -0
  23. package/es/src/charts/Pack.js.map +1 -0
  24. package/es/src/charts/Pie.js +2 -0
  25. package/es/src/charts/Pie.js.map +1 -0
  26. package/es/src/charts/Plot.js +2 -0
  27. package/es/src/charts/Plot.js.map +1 -0
  28. package/es/src/charts/Priestley.js +2 -0
  29. package/es/src/charts/Priestley.js.map +1 -0
  30. package/es/src/charts/Radar.js +2 -0
  31. package/es/src/charts/Radar.js.map +1 -0
  32. package/es/src/charts/RadialMatrix.js +2 -0
  33. package/es/src/charts/RadialMatrix.js.map +1 -0
  34. package/es/src/charts/Rings.js +2 -0
  35. package/es/src/charts/Rings.js.map +1 -0
  36. package/es/src/charts/Sankey.js +2 -0
  37. package/es/src/charts/Sankey.js.map +1 -0
  38. package/es/src/charts/StackedArea.js +2 -0
  39. package/es/src/charts/StackedArea.js.map +1 -0
  40. package/es/src/charts/Tree.js +2 -0
  41. package/es/src/charts/Tree.js.map +1 -0
  42. package/es/src/charts/Treemap.js +2 -0
  43. package/es/src/charts/Treemap.js.map +1 -0
  44. package/es/src/charts/Viz.js +2 -0
  45. package/es/src/charts/Viz.js.map +1 -0
  46. package/es/src/charts/drawSteps/drawAttribution.js +2 -0
  47. package/es/src/charts/drawSteps/drawAttribution.js.map +1 -0
  48. package/es/src/charts/drawSteps/drawBack.js +2 -0
  49. package/es/src/charts/drawSteps/drawBack.js.map +1 -0
  50. package/es/src/charts/drawSteps/drawColorScale.js +2 -0
  51. package/es/src/charts/drawSteps/drawColorScale.js.map +1 -0
  52. package/es/src/charts/drawSteps/drawLegend.js +2 -0
  53. package/es/src/charts/drawSteps/drawLegend.js.map +1 -0
  54. package/es/src/charts/drawSteps/drawSubtitle.js +2 -0
  55. package/es/src/charts/drawSteps/drawSubtitle.js.map +1 -0
  56. package/es/src/charts/drawSteps/drawTimeline.js +2 -0
  57. package/es/src/charts/drawSteps/drawTimeline.js.map +1 -0
  58. package/es/src/charts/drawSteps/drawTitle.js +2 -0
  59. package/es/src/charts/drawSteps/drawTitle.js.map +1 -0
  60. package/es/src/charts/drawSteps/drawTotal.js +2 -0
  61. package/es/src/charts/drawSteps/drawTotal.js.map +1 -0
  62. package/es/src/charts/drawSteps/zoomControls.js +2 -0
  63. package/es/src/charts/drawSteps/zoomControls.js.map +1 -0
  64. package/es/src/charts/events/click.legend.js +2 -0
  65. package/es/src/charts/events/click.legend.js.map +1 -0
  66. package/es/src/charts/events/click.shape.js +2 -0
  67. package/es/src/charts/events/click.shape.js.map +1 -0
  68. package/es/src/charts/events/mouseenter.js +2 -0
  69. package/es/src/charts/events/mouseenter.js.map +1 -0
  70. package/es/src/charts/events/mouseleave.js +2 -0
  71. package/es/src/charts/events/mouseleave.js.map +1 -0
  72. package/es/src/charts/events/mousemove.legend.js +2 -0
  73. package/es/src/charts/events/mousemove.legend.js.map +1 -0
  74. package/es/src/charts/events/mousemove.shape.js +2 -0
  75. package/es/src/charts/events/mousemove.shape.js.map +1 -0
  76. package/es/src/charts/events/touchstart.body.js +2 -0
  77. package/es/src/charts/events/touchstart.body.js.map +1 -0
  78. package/es/src/charts/helpers/matrixData.js +2 -0
  79. package/es/src/charts/helpers/matrixData.js.map +1 -0
  80. package/es/src/charts/helpers/tileAttributions.js +2 -0
  81. package/es/src/charts/helpers/tileAttributions.js.map +1 -0
  82. package/es/src/charts/index.js +2 -0
  83. package/es/src/charts/index.js.map +1 -0
  84. package/es/src/charts/plotBuffers/Bar.js +2 -0
  85. package/es/src/charts/plotBuffers/Bar.js.map +1 -0
  86. package/es/src/charts/plotBuffers/Box.js +2 -0
  87. package/es/src/charts/plotBuffers/Box.js.map +1 -0
  88. package/es/src/charts/plotBuffers/Circle.js +2 -0
  89. package/es/src/charts/plotBuffers/Circle.js.map +1 -0
  90. package/es/src/charts/plotBuffers/Line.js +2 -0
  91. package/es/src/charts/plotBuffers/Line.js.map +1 -0
  92. package/es/src/charts/plotBuffers/Rect.js +2 -0
  93. package/es/src/charts/plotBuffers/Rect.js.map +1 -0
  94. package/es/src/charts/plotBuffers/discreteBuffer.js +2 -0
  95. package/es/src/charts/plotBuffers/discreteBuffer.js.map +1 -0
  96. package/es/src/charts/plotBuffers/numericBuffer.js +2 -0
  97. package/es/src/charts/plotBuffers/numericBuffer.js.map +1 -0
  98. package/es/src/components/Axis.js +2 -0
  99. package/es/src/components/Axis.js.map +1 -0
  100. package/es/src/components/AxisBottom.js +2 -0
  101. package/es/src/components/AxisBottom.js.map +1 -0
  102. package/es/src/components/AxisLeft.js +2 -0
  103. package/es/src/components/AxisLeft.js.map +1 -0
  104. package/es/src/components/AxisRight.js +2 -0
  105. package/es/src/components/AxisRight.js.map +1 -0
  106. package/es/src/components/AxisTop.js +2 -0
  107. package/es/src/components/AxisTop.js.map +1 -0
  108. package/es/src/components/ColorScale.js +2 -0
  109. package/es/src/components/ColorScale.js.map +1 -0
  110. package/es/src/components/Legend.js +2 -0
  111. package/es/src/components/Legend.js.map +1 -0
  112. package/es/src/components/Message.js +2 -0
  113. package/es/src/components/Message.js.map +1 -0
  114. package/es/src/components/TextBox.js +2 -0
  115. package/es/src/components/TextBox.js.map +1 -0
  116. package/es/src/components/Timeline.js +2 -0
  117. package/es/src/components/Timeline.js.map +1 -0
  118. package/es/src/components/Tooltip.js +2 -0
  119. package/es/src/components/Tooltip.js.map +1 -0
  120. package/es/src/components/index.js +2 -0
  121. package/es/src/components/index.js.map +1 -0
  122. package/es/src/shapes/Area.js +2 -0
  123. package/es/src/shapes/Area.js.map +1 -0
  124. package/es/src/shapes/Bar.js +2 -0
  125. package/es/src/shapes/Bar.js.map +1 -0
  126. package/es/src/shapes/Box.js +2 -0
  127. package/es/src/shapes/Box.js.map +1 -0
  128. package/es/src/shapes/Circle.js +2 -0
  129. package/es/src/shapes/Circle.js.map +1 -0
  130. package/es/src/shapes/Image.js +2 -0
  131. package/es/src/shapes/Image.js.map +1 -0
  132. package/es/src/shapes/Line.js +2 -0
  133. package/es/src/shapes/Line.js.map +1 -0
  134. package/es/src/shapes/Path.js +2 -0
  135. package/es/src/shapes/Path.js.map +1 -0
  136. package/es/src/shapes/Rect.js +2 -0
  137. package/es/src/shapes/Rect.js.map +1 -0
  138. package/es/src/shapes/Shape.js +2 -0
  139. package/es/src/shapes/Shape.js.map +1 -0
  140. package/es/src/shapes/Whisker.js +2 -0
  141. package/es/src/shapes/Whisker.js.map +1 -0
  142. package/es/src/shapes/index.js +2 -0
  143. package/es/src/shapes/index.js.map +1 -0
  144. package/es/src/utils/AccessorFn.js +2 -0
  145. package/es/src/utils/AccessorFn.js.map +1 -0
  146. package/es/src/utils/BaseClass.js +2 -0
  147. package/es/src/utils/BaseClass.js.map +1 -0
  148. package/es/src/utils/D3plusConfig.js +2 -0
  149. package/es/src/utils/D3plusConfig.js.map +1 -0
  150. package/es/src/utils/RESET.js +2 -0
  151. package/es/src/utils/RESET.js.map +1 -0
  152. package/es/src/utils/accessor.js +2 -0
  153. package/es/src/utils/accessor.js.map +1 -0
  154. package/es/src/utils/configPrep.js +2 -0
  155. package/es/src/utils/configPrep.js.map +1 -0
  156. package/es/src/utils/constant.js +2 -0
  157. package/es/src/utils/constant.js.map +1 -0
  158. package/es/src/utils/getProp.js +2 -0
  159. package/es/src/utils/getProp.js.map +1 -0
  160. package/es/src/utils/index.js +2 -0
  161. package/es/src/utils/index.js.map +1 -0
  162. package/package.json +8 -8
  163. package/umd/d3plus-core.full.js +4197 -507
  164. package/umd/d3plus-core.full.js.map +1 -1
  165. package/umd/d3plus-core.full.min.js +792 -765
  166. package/umd/d3plus-core.js +1 -1
  167. package/umd/d3plus-core.min.js +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shapes/Path.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport {largestRect, path2polygon} from \"@d3plus/math\";\nimport {accessor, constant} from \"../utils/index.js\";\nimport type {AccessorFn} from \"../utils/index.js\";\n\nimport Shape, {type ShapeAes} from \"./Shape.js\";\n\n/**\n Creates SVG Paths based on an array of data.\n*/\nexport default class Path extends Shape {\n _d: AccessorFn;\n declare _labelBounds:\n | ((\n d: DataPoint,\n i: number,\n aes: ShapeAes,\n ) => Record<string, unknown> | null | false)\n | null;\n declare _name: string;\n declare _labelConfig: Record<string, unknown>;\n\n /**\n Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.\n @private\n*/\n constructor() {\n super(\"path\");\n this._d = accessor(\"path\");\n this._labelBounds = (\n d: DataPoint,\n i: number,\n aes: ShapeAes,\n ) => {\n const r = largestRect(aes.points as unknown as [number, number][], {\n angle: (this._labelConfig as Record<string, unknown>).rotate\n ? ((\n (this._labelConfig as Record<string, unknown>)\n .rotate as AccessorFn\n )(d, i) as number)\n : 0,\n });\n return r\n ? {\n angle: r.angle,\n width: r.width,\n height: r.height,\n x: r.cx - r.width / 2,\n y: r.cy - r.height / 2,\n }\n : false;\n };\n this._name = \"Path\";\n this._labelConfig = Object.assign(this._labelConfig, {\n textAnchor: \"middle\",\n verticalAlign: \"middle\",\n });\n }\n\n /**\n Given a specific data point and index, returns the aesthetic properties of the shape.\n @param data point*\n @param index @private\n*/\n _aes(d: DataPoint, i: number): ShapeAes {\n return {points: path2polygon(this._d(d, i) as string)};\n }\n\n /**\n Draws the paths.\n @param callback Optional callback invoked after rendering completes.\n*/\n render(callback?: () => void): this {\n super.render(callback);\n\n const enter = this._enter\n .attr(\"d\", this._d as never)\n .call(this._applyStyle.bind(this));\n\n let update: D3Selection = this._update;\n\n if (this._duration) {\n enter.attr(\"opacity\", 0).transition(this._transition).attr(\"opacity\", 1);\n update = update.transition(this._transition) as unknown as D3Selection;\n this._exit.transition(this._transition).attr(\"opacity\", 0);\n }\n\n update.call(this._applyStyle.bind(this)).attr(\"d\", this._d as never);\n\n return this;\n }\n\n /**\n The \"d\" attribute.\n\n@example\nfunction(d) {\n return d.path;\n}\n*/\n d(): AccessorFn;\n d(_: AccessorFn | string): this;\n d(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._d = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._d;\n }\n}\n"],"names":["largestRect","path2polygon","accessor","constant","Shape","Path","_d","_labelBounds","d","i","aes","r","points","angle","_labelConfig","rotate","width","height","x","cx","y","cy","_name","Object","assign","textAnchor","verticalAlign","_aes","render","callback","enter","_enter","attr","call","_applyStyle","bind","update","_update","_duration","transition","_transition","_exit","_","arguments","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAQA,WAAW,EAAEC,YAAY,QAAO,eAAe;AACvD,SAAQC,QAAQ,EAAEC,QAAQ,QAAO,oBAAoB;A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E;oBAClBR,MAAME,IAAI,CAAC,WAAW,GAAGO,UAAU,CAAC,IAAI,CAACC,WAAW,EAAER,IAAI,CAAC,WAAW;oBACtEI,SAASA,OAAOG,UAAU,CAAC,IAAI,CAACC,WAAW;oBAC3C,IAAI,CAACC,KAAK,CAACF,UAAU,CAAC,IAAI,CAACC,WAAW,EAAER,IAAI,CAAC,WAAW;gBAC1D;gBAEAI,OAAOH,IAAI,CAAC,IAAI,CAACC,WAAW,CAACC,IAAI,CAAC,IAAI,GAAGH,IAAI,CAAC,KAAK,IAAI,CAAC1B,EAAE;gBAE1D,OAAO,IAAI;YACb;;;YAYAE,KAAAA;mBAAAA,SAAAA,EAAEkC,CAAuB;gBACvB,OAAOC,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACtC,EAAE,GAAG,OAAOoC,MAAM,aAAaA,IAAIvC,SAASuC,IAA8B,IAAI,AAAD,IACpF,IAAI,CAACpC,EAAE;YACb;;;WAhGmBD;EAAaD;AAHlC;;AAEA,GACA,SAAqBC,kBAiGpB"}
@@ -201,3 +201,5 @@ var Rect = /*#__PURE__*/ function(Shape) {
201
201
  /**
202
202
  Creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-shape/getting-started/) for help getting started using the rectangle generator.
203
203
  */ export { Rect as default };
204
+
205
+ //# sourceMappingURL=Rect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shapes/Rect.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport {accessor, constant} from \"../utils/index.js\";\nimport type {AccessorFn} from \"../utils/index.js\";\nimport Shape, {type ShapeAes} from \"./Shape.js\";\n\n/**\n Creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-shape/getting-started/) for help getting started using the rectangle generator.\n*/\nexport default class Rect extends Shape {\n _height: AccessorFn;\n declare _labelBounds:\n | ((\n d: DataPoint,\n i: number,\n aes: ShapeAes,\n ) => Record<string, unknown> | null | false)\n | null;\n declare _name: string;\n _width: AccessorFn;\n\n /**\n Invoked when creating a new class instance, and overrides any default parameters inherited from Shape.\n @private\n*/\n constructor() {\n super(\"rect\");\n this._height = accessor(\"height\");\n this._labelBounds = (\n _d: DataPoint,\n _i: number,\n s: ShapeAes,\n ) => ({\n width: s.width,\n height: s.height,\n x: -(s.width as number) / 2,\n y: -(s.height as number) / 2,\n });\n this._name = \"Rect\";\n this._width = accessor(\"width\");\n }\n\n /**\n Draws the rectangles.\n @param callback Optional callback invoked after rendering completes.\n*/\n render(callback?: () => void): this {\n super.render(callback);\n\n let enter: D3Selection = this._enter\n .attr(\"width\", 0)\n .attr(\"height\", 0)\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .call(this._applyStyle.bind(this));\n\n let update: D3Selection = this._update;\n\n if (this._duration) {\n enter = enter.transition(this._transition) as unknown as D3Selection;\n update = update.transition(this._transition) as unknown as D3Selection;\n this._exit\n .transition(this._transition)\n .attr(\"width\", 0)\n .attr(\"height\", 0)\n .attr(\"x\", 0)\n .attr(\"y\", 0);\n }\n\n enter.call(this._applyPosition.bind(this));\n\n update\n .call(this._applyStyle.bind(this))\n .call(this._applyPosition.bind(this));\n\n return this;\n }\n\n /**\n Given a specific data point and index, returns the aesthetic properties of the shape.\n @param data point*\n @param index @private\n*/\n _aes(d: DataPoint, i: number): ShapeAes {\n return {\n width: this._width(d, i) as number,\n height: this._height(d, i) as number,\n };\n }\n\n /**\n Provides the default positioning to the <rect> elements.\n @param elem @private\n*/\n _applyPosition(elem: D3Selection): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (elem as any)\n .attr(\"width\", (d: DataPoint, i: number) => this._width(d, i))\n .attr(\"height\", (d: DataPoint, i: number) => this._height(d, i))\n .attr(\n \"x\",\n (d: DataPoint, i: number) => -(this._width(d, i) as number) / 2,\n )\n .attr(\n \"y\",\n (d: DataPoint, i: number) => -(this._height(d, i) as number) / 2,\n );\n }\n\n /**\n The height accessor for each rectangle.\n\n@example\nfunction(d) {\n return d.height;\n}\n*/\n height(): AccessorFn;\n height(_: AccessorFn | number): this;\n height(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._height = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._height;\n }\n\n /**\n The width accessor for each rectangle.\n\n@example\nfunction(d) {\n return d.width;\n}\n*/\n width(): AccessorFn;\n width(_: AccessorFn | number): this;\n width(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._width = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._width;\n }\n}\n"],"names":["accessor","constant","Shape","Rect","_height","_width","_labelBounds","_d","_i","s","width","height","x","y","_name","render","callback","enter","_enter","attr","call","_applyStyle","bind","update","_update","_duration","transition","_transition","_exit","_applyPosition","_aes","d","i","elem","_","arguments","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAQA,QAAQ,EAAEC,QAAQ,QAAO,oBAAoB;AAErD,OAAOC,WAA4B,aAAa;AAKjC,IAAA,AAAMC,qBAAN;;cAAMA;aAAAA;gCAAAA;;gBAiBjB,kBAjBiBA;YAiBX;YAhBRC,wBAAAA,WAAAA,KAAAA,IASAC,wBAAAA,UAAAA,KAAAA;QAQE,MAAKD,OAAO,GAAGJ,SAAS;QACxB,MAAKM,YAAY,GAAG,SAClBC,IACAC,IACAC;mBACI;gBACJC,OAAOD,EAAEC,KAAK;gBACdC,QAAQF,EAAEE,MAAM;gBAChBC,GAAG,CAAEH,EAAEC,KAAK,GAAc;gBAC1BG,GAAG,CAAEJ,EAAEE,MAAM,GAAc;YAC7B;;QACA,MAAKG,KAAK,GAAG;QACb,MAAKT,MAAM,GAAGL,SAAS;;;kBA9BNG;;YAiCnB;;;AAGF,GACEY,KAAAA;mB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C,UAAU,SAACY,GAAcC;2BAAc,MAAK5B,OAAO,CAAC2B,GAAGC;mBAC5Db,IAAI,CACH,KACA,SAACY,GAAcC;2BAAc,CAAE,MAAK3B,MAAM,CAAC0B,GAAGC,KAAgB;mBAE/Db,IAAI,CACH,KACA,SAACY,GAAcC;2BAAc,CAAE,MAAK5B,OAAO,CAAC2B,GAAGC,KAAgB;;YAErE;;;YAYArB,KAAAA;mBAAAA,SAAAA,OAAOuB,CAAuB;gBAC5B,OAAOC,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAAChC,OAAO,GAAG,OAAO8B,MAAM,aAAaA,IAAIjC,SAASiC,IAA8B,IAAI,AAAD,IACzF,IAAI,CAAC9B,OAAO;YAClB;;;YAYAM,KAAAA;mBAAAA,SAAAA,MAAMwB,CAAuB;gBAC3B,OAAOC,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAAC/B,MAAM,GAAG,OAAO6B,MAAM,aAAaA,IAAIjC,SAASiC,IAA8B,IAAI,AAAD,IACxF,IAAI,CAAC7B,MAAM;YACjB;;;WAlImBF;EAAaD;AAHlC;;AAEA,GACA,SAAqBC,kBAmIpB"}
@@ -964,3 +964,5 @@ var Shape = /*#__PURE__*/ function(BaseClass) {
964
964
  /**
965
965
  An abstracted class for generating shapes.
966
966
  */ export { Shape as default };
967
+
968
+ //# sourceMappingURL=Shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shapes/Shape.ts"],"sourcesContent":["import {min} from \"d3-array\";\nimport {color} from \"d3-color\";\nimport {pointer, select, selectAll} from \"d3-selection\";\nimport * as paths from \"d3-shape\";\nimport {transition} from \"d3-transition\";\nimport textures from \"textures\";\n\nimport {colorContrast} from \"@d3plus/color\";\nimport type {DataPoint} from \"@d3plus/data\";\nimport {unique} from \"@d3plus/data\";\nimport {assign, attrize, elem, isObject} from \"@d3plus/dom\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport {pointDistance} from \"@d3plus/math\";\nimport {strip} from \"@d3plus/text\";\n\nimport {TextBox} from \"../components/index.js\";\nimport {accessor, BaseClass, configPrep, constant} from \"../utils/index.js\";\nimport type {AccessorFn} from \"../utils/index.js\";\n\nexport interface ShapeAes {\n width?: number;\n height?: number;\n points?: [number, number][];\n r?: number;\n x?: number;\n y?: number;\n}\n\n/**\n * @param {*} nodeList\n * @param {*} classNames\n * @private\n*/\nfunction findLastIndexWithClass(\n nodeList: NodeListOf<ChildNode>,\n classNames: string[],\n): number {\n for (let x = 0; x < classNames.length; x++) {\n const className = classNames[x];\n for (let i = nodeList.length - 1; i >= 0; i--) {\n // Iterate backwards\n if ((nodeList[i] as Element).classList.contains(className)) {\n // Check for the class\n return i; // Return the index if found\n }\n }\n }\n return -1; // Return -1 if no element is found with the class\n}\n\nimport Image from \"./Image.js\";\n\n/**\n An abstracted class for generating shapes.\n*/\nexport default class Shape extends BaseClass {\n _activeOpacity: number;\n _activeStyle: Record<string, unknown>;\n _ariaLabel: AccessorFn;\n _backgroundImage: AccessorFn;\n _backgroundImageClass: Image;\n _data: DataPoint[];\n _duration: number;\n _fill: AccessorFn;\n _fillOpacity: AccessorFn;\n _hoverOpacity: number;\n _hoverStyle: Record<string, unknown>;\n _id: AccessorFn;\n _label: AccessorFn;\n _labelClass: TextBox;\n _labelConfig: Record<string, unknown>;\n _labelBounds!:\n | ((\n d: DataPoint,\n i: number,\n aes: ShapeAes,\n ) => Record<string, unknown> | null | false)\n | null;\n _name: string;\n _opacity: AccessorFn;\n _pointerEvents: AccessorFn;\n _role: AccessorFn;\n _rotate: AccessorFn;\n _rx: AccessorFn;\n _ry: AccessorFn;\n _scale: AccessorFn;\n _shapeRendering: AccessorFn;\n _stroke: AccessorFn;\n _strokeDasharray: AccessorFn;\n _strokeLinecap: AccessorFn;\n _strokeOpacity: AccessorFn;\n _strokeWidth: AccessorFn;\n _tagName: string;\n _textAnchor: AccessorFn;\n _texture: AccessorFn;\n _textureDefault: Record<string, unknown>;\n _textureDefs: Record<string, Record<string, unknown>>;\n _vectorEffect: AccessorFn;\n _verticalAlign: AccessorFn;\n _x: AccessorFn;\n _y: AccessorFn;\n _select!: D3Selection;\n _transition!: ReturnType<typeof transition>;\n /** @param data The raw data array to filter. */\n _dataFilter?(data: DataPoint[]): DataPoint[];\n _sort!: ((a: DataPoint, b: DataPoint) => number) | null;\n _group!: D3Selection;\n _update!: D3Selection;\n _enter!: D3Selection;\n _exit!: D3Selection;\n _hoverGroup!: D3Selection;\n _activeGroup!: D3Selection;\n _hitArea!:\n | ((d: DataPoint, i: number, aes: ShapeAes) => Record<string, unknown>)\n | null;\n _active!: ((d: DataPoint, i: number) => boolean) | null;\n _hover!: ((d: DataPoint, i: number) => boolean) | null;\n _discrete: string | undefined;\n _path!: Record<string, unknown>;\n _defined!: AccessorFn;\n _curve!: AccessorFn;\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n*/\n constructor(tagName: string = \"g\") {\n super();\n\n this._activeOpacity = 0.25;\n this._activeStyle = {\n stroke: (d: DataPoint, i: number) => {\n let c = this._fill(d, i) as string;\n if ([\"transparent\", \"none\"].includes(c))\n c = this._stroke(d, i) as string;\n return color(c)!.darker(1);\n },\n \"stroke-width\": (d: DataPoint, i: number) => {\n const s = (this._strokeWidth(d, i) as number) || 1;\n return s * 3;\n },\n };\n this._ariaLabel = constant(\"\");\n this._backgroundImage = constant(false);\n this._backgroundImageClass = new Image();\n this._data = [];\n this._duration = 600;\n this._fill = constant(\"black\");\n this._fillOpacity = constant(1);\n\n this._hoverOpacity = 0.5;\n this._hoverStyle = {\n stroke: (d: DataPoint, i: number) => {\n let c = this._fill(d, i) as string;\n if ([\"transparent\", \"none\"].includes(c))\n c = this._stroke(d, i) as string;\n return color(c)!.darker(0.5);\n },\n \"stroke-width\": (d: DataPoint, i: number) => {\n const s = (this._strokeWidth(d, i) as number) || 1;\n return s * 2;\n },\n };\n this._id = (d: DataPoint, i?: number) => (d.id !== void 0 ? d.id : i!);\n this._label = constant(false);\n this._labelClass = new TextBox();\n this._labelConfig = {\n fontColor: (d: DataPoint, i: number) =>\n colorContrast(this._fill(d, i) as string),\n fontSize: 12,\n padding: 5,\n };\n this._name = \"Shape\";\n this._opacity = constant(1);\n this._pointerEvents = constant(\"visiblePainted\");\n this._role = constant(\"presentation\");\n this._rotate = constant(0);\n this._rx = constant(0);\n this._ry = constant(0);\n this._scale = constant(1);\n this._shapeRendering = constant(\"geometricPrecision\");\n this._stroke = (d: DataPoint, i?: number) =>\n color(this._fill(d, i) as string)!\n .darker(1)\n .formatHex();\n this._strokeDasharray = constant(\"0\");\n this._strokeLinecap = constant(\"butt\");\n this._strokeOpacity = constant(1);\n this._strokeWidth = constant(0);\n this._tagName = tagName;\n this._textAnchor = constant(\"start\");\n this._texture = constant(false);\n this._textureDefault = {};\n this._textureDefs = {};\n this._vectorEffect = constant(\"non-scaling-stroke\");\n this._verticalAlign = constant(\"top\");\n\n this._x = accessor(\"x\", 0);\n this._y = accessor(\"y\", 0);\n }\n\n /**\n Given a specific data point and index, returns the aesthetic properties of the shape.\n @param data point*\n @param index @private\n*/\n _aes(_d?: DataPoint, _i?: number): ShapeAes {\n return {};\n }\n\n /**\n Adds event listeners to each shape group or hit area.\n @private\n*/\n _applyEvents(handler: D3Selection): void {\n const events = Object.keys(this._on);\n for (let e = 0; e < events.length; e++) {\n handler.on(events[e], (event: Event, d: DataPoint) => {\n let i: number = 0;\n if (!this._on[events[e]]) return;\n if (d.i !== void 0) i = d.i as number;\n if (d.nested && d.values) {\n const calcPoint = (d: DataPoint, i: number): [number, number] => {\n if (this._discrete === \"x\")\n return [this._x(d, i) as number, cursor[1]];\n else if (this._discrete === \"y\")\n return [cursor[0], this._y(d, i) as number];\n else return [this._x(d, i) as number, this._y(d, i) as number];\n };\n const cursor = pointer(event, this._select.node()),\n values = (d.values as unknown as DataPoint[]).map((d: DataPoint) =>\n pointDistance(cursor, calcPoint(d, i)),\n );\n i = values.indexOf(min(values)!);\n d = (d.values as unknown as DataPoint[])[i];\n }\n this._on[events[e]].bind(this)(d, i, undefined, event);\n });\n }\n }\n\n /**\n Provides the updated styling to the given shape elements.\n\n @private\n*/\n _updateStyle(elem: D3Selection, style: Record<string, unknown>): void {\n const that = this;\n\n if (elem.size() && elem.node()!.tagName === \"g\")\n elem = elem.selectAll(\"*\") as unknown as D3Selection;\n\n /**\n Determines whether a shape is a nested collection of data points, and uses the appropriate data and index for the given function context.\n @param d data point\n @param i index\n @private\n*/\n function styleLogic(this: unknown, d: DataPoint, i: number): unknown {\n return typeof this !== \"function\"\n ? this\n : d.nested && d.key && d.values\n ? this(\n (d.values as unknown as DataPoint[])[0],\n that._data.indexOf((d.values as unknown as DataPoint[])[0]),\n )\n : this(d, i);\n }\n\n const styleObject: Record<string, unknown> = {};\n for (const key in style) {\n if ({}.hasOwnProperty.call(style, key)) {\n styleObject[key] = styleLogic.bind(style[key]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (elem as any).transition().duration(0).call(attrize, styleObject);\n }\n\n /**\n Provides the default styling to the shape elements.\n @param elem @private\n*/\n _applyStyle(elem: D3Selection): void {\n const that = this;\n\n if (elem.size() && elem.node()!.tagName === \"g\")\n elem = elem.selectAll(\"*\") as unknown as D3Selection;\n\n /**\n Determines whether a shape is a nested collection of data points, and uses the appropriate data and index for the given function context.\n @param d data point\n @param i index\n @private\n*/\n function styleLogic(this: unknown, d: DataPoint, i: number): unknown {\n return typeof this !== \"function\"\n ? this\n : d.nested && d.key && d.values\n ? this(\n (d.values as unknown as DataPoint[])[0],\n that._data.indexOf((d.values as unknown as DataPoint[])[0]),\n )\n : this(d, i);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (elem as any)\n .attr(\"fill\", (d: DataPoint, i: number) => {\n const texture = this._getTextureKey.bind(this)(d, i);\n return texture\n ? (\n this._textureDefs[texture] as Record<string, unknown> & {\n url: () => string;\n }\n ).url()\n : styleLogic.bind(this._fill)(d, i);\n })\n .attr(\"fill-opacity\", styleLogic.bind(this._fillOpacity))\n .attr(\"rx\", styleLogic.bind(this._rx))\n .attr(\"ry\", styleLogic.bind(this._ry))\n .attr(\"stroke\", styleLogic.bind(this._stroke))\n .attr(\"stroke-dasharray\", styleLogic.bind(this._strokeDasharray))\n .attr(\"stroke-linecap\", styleLogic.bind(this._strokeLinecap))\n .attr(\"stroke-opacity\", styleLogic.bind(this._strokeOpacity))\n .attr(\"stroke-width\", styleLogic.bind(this._strokeWidth))\n .attr(\"vector-effect\", styleLogic.bind(this._vectorEffect));\n }\n\n /**\n Calculates the transform for the group elements.\n @param elem @private\n*/\n _applyTransform(elem: D3Selection): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (elem as any).attr(\n \"transform\",\n (d: DataPoint, i: number) => `\n translate(${\n d.__d3plusShape__\n ? d.translate\n ? d.translate\n : `${this._x(d.data as DataPoint, d.i as number)},${this._y(d.data as DataPoint, d.i as number)}`\n : `${this._x(d, i)},${this._y(d, i)}`\n })\n scale(${\n d.__d3plusShape__\n ? d.scale || this._scale(d.data as DataPoint, d.i as number)\n : this._scale(d, i)\n })\n rotate(${\n d.__d3plusShape__\n ? d.rotate\n ? d.rotate\n : this._rotate((d.data || d) as DataPoint, d.i as number)\n : this._rotate((d.data || d) as DataPoint, d.i as number)\n })`,\n );\n }\n\n /**\n Returns a full JSON string of the texture config for a given data point.\n\n @private\n*/\n _getTextureKey(d: DataPoint, i: number): string | false {\n const textureVal: unknown = this._texture(d, i);\n if (!textureVal) return false;\n\n /**\n Determines whether a shape is a nested collection of data points, and uses the appropriate data and index for the given function context.\n @private\n*/\n const styleLogic = (_: unknown): unknown => {\n return typeof _ !== \"function\"\n ? _\n : d.nested && d.key && d.values\n ? (_ as AccessorFn)(\n (d.values as unknown as DataPoint[])[0],\n this._data.indexOf((d.values as unknown as DataPoint[])[0]),\n )\n : (_ as AccessorFn)(d, i);\n };\n\n const fallback = this._textureDefault;\n\n let texture: Record<string, unknown>;\n if (!isObject(textureVal))\n texture = {texture: textureVal} as Record<string, unknown>;\n else texture = textureVal as Record<string, unknown>;\n if (!texture.background) texture.background = styleLogic(this._fill);\n if (!texture.stroke && !fallback.stroke)\n texture.stroke = styleLogic(this._stroke);\n const pathNames = [\n \"squares\",\n \"nylon\",\n \"waves\",\n \"woven\",\n \"crosses\",\n \"caps\",\n \"hexagons\",\n ];\n if (\n pathNames.includes(texture.texture as string) ||\n typeof texture.texture === \"function\"\n ) {\n texture.d = texture.texture;\n texture.texture = \"paths\";\n } else if (texture.texture === \"grid\") {\n if (!texture.orientation && !fallback.orientation)\n texture.orientation = [\"vertical\", \"horizontal\"];\n texture.texture = \"lines\";\n }\n if (!texture.fill && texture.texture !== \"paths\")\n texture.fill = texture.stroke;\n const retObj = assign({}, fallback, texture);\n if (typeof retObj.d === \"function\") {\n retObj.d = retObj.d(retObj.size || 20);\n }\n return JSON.stringify(retObj);\n }\n\n /**\n Checks for nested data and uses the appropriate variables for accessor functions.\n @param elem @private\n*/\n _nestWrapper(\n method: AccessorFn,\n ): (d: DataPoint, i: number) => DataPoint[keyof DataPoint] {\n return (d: DataPoint, i: number) =>\n method(\n d.__d3plusShape__ ? (d.data as DataPoint) : d,\n d.__d3plusShape__ ? (d.i as number) : i,\n );\n }\n\n /**\n Modifies existing shapes to show active status.\n @private\n*/\n _renderActive(): void {\n const that = this;\n\n this._group\n .selectAll(\".d3plus-Shape, .d3plus-Image, .d3plus-textBox\")\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .each(function (this: any, _d: unknown, i: number) {\n let d = (_d || {}) as DataPoint;\n if (!d.parentNode)\n d.parentNode = (this as Element)\n .parentNode as unknown as DataPoint[keyof DataPoint];\n const parent = d.parentNode as unknown as Node;\n\n if (select(this).classed(\"d3plus-textBox\")) d = d.data as DataPoint;\n if (d.__d3plusShape__ || d.__d3plus__) {\n while (d && (d.__d3plusShape__ || d.__d3plus__)) {\n i = d.i as number;\n d = d.data as DataPoint;\n }\n } else i = that._data.indexOf(d);\n\n const group: Node =\n !that._active ||\n typeof that._active !== \"function\" ||\n !that._active(d, i)\n ? parent\n : that._activeGroup.node();\n if (group !== (this as Element).parentNode) {\n group.appendChild(this as Element);\n if ((this as SVGElement).className.baseVal.includes(\"d3plus-Shape\")) {\n if (parent === group)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n select(this).call(that._applyStyle.bind(that) as any);\n else\n select(this).call(\n that._updateStyle.bind(that, select(this), that._activeStyle),\n );\n }\n }\n });\n\n // this._renderImage();\n // this._renderLabels();\n\n this._group\n .selectAll(\n `g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text`,\n )\n .attr(\n \"opacity\",\n this._hover\n ? this._hoverOpacity\n : this._active\n ? this._activeOpacity\n : 1,\n );\n }\n\n /**\n Modifies existing shapes to show hover status.\n @private\n*/\n _renderHover(): void {\n const that = this;\n\n this._group\n .selectAll(\n `g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text, g.d3plus-${this._name}-hover`,\n )\n .selectAll(\".d3plus-Shape, .d3plus-Image, .d3plus-textBox\")\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .each(function (this: any, _d: unknown, i: number) {\n let d = (_d || {}) as DataPoint;\n if (!d.parentNode)\n d.parentNode = (this as Element)\n .parentNode as unknown as DataPoint[keyof DataPoint];\n const parent = d.parentNode as unknown as Node;\n\n const d3plusType = select(this).classed(\"d3plus-textBox\")\n ? \"textBox\"\n : select(this).classed(\"d3plus-Image\")\n ? \"Image\"\n : \"Shape\";\n\n if (d3plusType === \"textBox\") d = d.data as DataPoint;\n if (d.__d3plusShape__ || d.__d3plus__) {\n while (d && (d.__d3plusShape__ || d.__d3plus__)) {\n i = d.i as number;\n d = d.data as DataPoint;\n }\n } else i = that._data.indexOf(d);\n\n const notHovering =\n !that._hover ||\n typeof that._hover !== \"function\" ||\n !that._hover(d, i);\n const group = notHovering ? parent : that._hoverGroup.node();\n if (group !== (this as Element).parentNode) {\n const afterIndex =\n d3plusType === \"textBox\"\n ? findLastIndexWithClass(group.childNodes, [\n \"d3plus-Image\",\n \"d3plus-Shape\",\n ])\n : d3plusType === \"Image\"\n ? findLastIndexWithClass(group.childNodes, [\"d3plus-Shape\"])\n : -1;\n if (notHovering) group.appendChild(this as Element);\n else if (afterIndex === -1) group.prepend(this as Element);\n else group.childNodes[afterIndex].after(this as Element);\n }\n if ((this as SVGElement).className.baseVal.includes(\"d3plus-Shape\")) {\n if (parent === group)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n select(this).call(that._applyStyle.bind(that) as any);\n else\n select(this).call(\n that._updateStyle.bind(\n that,\n select(this),\n that._hoverStyle,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) as any,\n );\n }\n });\n\n // this._renderImage();\n // this._renderLabels();\n\n this._group\n .selectAll(\n `g.d3plus-${this._name}-shape, g.d3plus-${this._name}-image, g.d3plus-${this._name}-text`,\n )\n .attr(\n \"opacity\",\n this._hover\n ? this._hoverOpacity\n : this._active\n ? this._activeOpacity\n : 1,\n );\n }\n\n /**\n Adds background image to each shape group.\n @private\n*/\n _renderImage(): void {\n const imageData: DataPoint[] = [];\n\n this._update\n .merge(this._enter)\n .data()\n .forEach((datum: DataPoint, i: number) => {\n const aes = this._aes(datum, i);\n\n if (aes.r || (aes.width && aes.height)) {\n let d: DataPoint = datum;\n if (datum.nested && datum.key && datum.values) {\n d = (datum.values as unknown as DataPoint[])[0];\n i = this._data.indexOf(d);\n }\n\n const height = aes.r ? (aes.r as number) * 2 : (aes.height as number),\n url = this._backgroundImage(d, i),\n width = aes.r ? (aes.r as number) * 2 : (aes.width as number);\n\n if (url) {\n let x: number = d.__d3plusShape__\n ? d.translate\n ? (d.translate as unknown as number[])[0]\n : (this._x(d.data as DataPoint, d.i as number) as number)\n : (this._x(d, i) as number),\n y: number = d.__d3plusShape__\n ? d.translate\n ? (d.translate as unknown as number[])[1]\n : (this._y(d.data as DataPoint, d.i as number) as number)\n : (this._y(d, i) as number);\n\n if (aes.x) x += aes.x as number;\n if (aes.y) y += aes.y as number;\n\n if (d.__d3plusShape__) {\n d = d.data as DataPoint;\n i = d.i as number;\n }\n\n imageData.push({\n __d3plus__: true,\n data: d,\n height,\n i,\n id: this._id(d, i),\n url,\n width,\n x: x + -width / 2,\n y: y + -height / 2,\n } as unknown as DataPoint);\n }\n }\n });\n\n this._backgroundImageClass\n .data(imageData)\n .duration(this._duration)\n .opacity(this._nestWrapper(this._opacity) as AccessorFn)\n .pointerEvents(\"none\")\n .select(\n elem(`g.d3plus-${this._name}-image`, {\n parent: this._group,\n update: {opacity: this._active ? this._activeOpacity : 1},\n }).node(),\n )\n .render();\n }\n\n /**\n Adds labels to each shape group.\n @private\n*/\n _renderLabels(): void {\n const labelData: DataPoint[] = [];\n\n this._update\n .merge(this._enter)\n .data()\n .forEach((datum: DataPoint, i: number) => {\n let d: DataPoint = datum;\n if (datum.nested && datum.key && datum.values) {\n d = (datum.values as unknown as DataPoint[])[0];\n i = this._data.indexOf(d);\n }\n\n let labels: unknown = this._label(d, i);\n\n if (\n this._labelBounds &&\n labels !== false &&\n labels !== undefined &&\n labels !== null\n ) {\n const bounds = this._labelBounds.bind(this)(\n d,\n i,\n this._aes(datum, i),\n ) as Record<string, unknown>;\n\n if (bounds) {\n if ((labels as unknown[]).constructor !== Array) labels = [labels];\n\n const x: number = d.__d3plusShape__\n ? d.translate\n ? (d.translate as unknown as number[])[0]\n : (this._x(d.data as DataPoint, d.i as number) as number)\n : (this._x(d, i) as number),\n y: number = d.__d3plusShape__\n ? d.translate\n ? (d.translate as unknown as number[])[1]\n : (this._y(d.data as DataPoint, d.i as number) as number)\n : (this._y(d, i) as number);\n\n if (d.__d3plusShape__) {\n d = d.data as DataPoint;\n i = d.i as number;\n }\n\n for (let l = 0; l < (labels as unknown[]).length; l++) {\n const b = (\n bounds.constructor === Array\n ? (bounds as unknown as Record<string, unknown>[])[l]\n : Object.assign({}, bounds)\n ) as Record<string, number>;\n const rotate = this._rotate(d, i) as number;\n const labelConfig = d.labelConfig as DataPoint | undefined;\n let r: number =\n labelConfig && labelConfig.rotate\n ? (labelConfig.rotate as number)\n : bounds.angle !== undefined\n ? (bounds.angle as number)\n : 0;\n r += rotate;\n const rotateAnchor =\n rotate !== 0\n ? [b.x * -1 || 0, b.y * -1 || 0]\n : [b.width / 2, b.height / 2];\n\n labelData.push({\n __d3plus__: true,\n data: d,\n height: b.height,\n l,\n id: `${this._id(d, i)}_${l}`,\n r,\n rotateAnchor,\n text: (labels as unknown[])[l],\n width: b.width,\n x: x + b.x,\n y: y + b.y,\n } as unknown as DataPoint);\n }\n }\n }\n });\n\n this._labelClass\n .data(labelData)\n .duration(this._duration)\n .fontOpacity(this._nestWrapper(this._opacity) as unknown as number)\n .pointerEvents(\"none\")\n .rotate(\n ((d: DataPoint) =>\n (d.__d3plus__\n ? d.r\n : (d.data as DataPoint)\n .r) as unknown as number) as unknown as number,\n )\n .rotateAnchor(\n (d: DataPoint) =>\n (d.__d3plus__\n ? d.rotateAnchor\n : (d.data as DataPoint).rotateAnchor) as unknown as [\n number,\n number,\n ],\n )\n .select(\n elem(`g.d3plus-${this._name}-text`, {\n parent: this._group,\n update: {opacity: this._active ? this._activeOpacity : 1},\n }).node(),\n )\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .config(configPrep.bind(this as any)(this._labelConfig)!)\n .render();\n }\n\n /**\n Renders the current Shape to the page. If a *callback* is specified, it will be called once the shapes are done drawing.\n @param callback Optional callback invoked after rendering completes.\n*/\n render(callback?: () => void): this {\n if (this._select === void 0) {\n this.select(\n select(\"body\")\n .append(\"svg\")\n .style(\"width\", `${window.innerWidth}px`)\n .style(\"height\", `${window.innerHeight}px`)\n .style(\"display\", \"block\")\n .node(),\n );\n }\n\n this._transition = transition(this._uuid).duration(this._duration);\n\n let data: DataPoint[] & {key?: AccessorFn} = this._data,\n key: AccessorFn = this._id;\n if (this._dataFilter) {\n data = this._dataFilter(data) as DataPoint[] & {key?: AccessorFn};\n if (data.key) key = data.key;\n }\n\n if (this._sort) {\n data = data.sort((a: DataPoint, b: DataPoint) => {\n while (a.__d3plusShape__ || a.__d3plus__) a = a.data as DataPoint;\n while (b.__d3plusShape__ || b.__d3plus__) b = b.data as DataPoint;\n return this._sort!(a, b);\n });\n }\n\n const textureSet = unique(\n data.map(\n this._getTextureKey.bind(this) as (\n d: DataPoint,\n i: number,\n ) => string | false,\n ),\n ).filter(Boolean) as string[];\n\n const existingTextureDefs = Object.keys(this._textureDefs);\n\n existingTextureDefs.forEach(key => {\n if (!textureSet.includes(key)) {\n select(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this._select as any)\n .select(\n `pattern#${(this._textureDefs[key] as Record<string, unknown> & {id: () => string}).id()}`,\n )\n .node().parentNode,\n ).remove();\n delete this._textureDefs[key];\n }\n });\n\n textureSet.forEach((key: string) => {\n if (!existingTextureDefs.includes(key)) {\n const config = JSON.parse(key);\n const textureClass = config.texture;\n delete config.texture;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const t = (textures as any)[textureClass]();\n for (const k in config) {\n if ({}.hasOwnProperty.call(t, k) && k in t) {\n if (k === \"d\" && typeof k === \"function\") t[k](() => config[k]);\n else\n config[k] instanceof Array\n ? t[k].apply(null, config[k])\n : t[k](config[k]);\n }\n }\n this._select.call(t);\n this._textureDefs[key] = t;\n }\n });\n\n selectAll(\n `g.d3plus-${this._name}-hover > *, g.d3plus-${this._name}-active > *`,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ).each(function (this: any, d: unknown) {\n const dp = d as DataPoint;\n if (dp && dp.parentNode)\n (dp.parentNode as unknown as Node).appendChild(this);\n else this.parentNode!.removeChild(this);\n });\n\n // Makes the update state of the group selection accessible.\n this._group = elem(`g.d3plus-${this._name}-group`, {parent: this._select});\n const update = (this._update = elem(`g.d3plus-${this._name}-shape`, {\n parent: this._group,\n update: {opacity: this._active ? this._activeOpacity : 1},\n })\n .selectAll(`.d3plus-${this._name}`)\n .data(data, key as never));\n\n // Orders and transforms the updating Shapes.\n update.order();\n if (this._duration) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n update.transition(this._transition).call(this._applyTransform.bind(this) as any);\n } else {\n update.call(this._applyTransform.bind(this));\n }\n\n // Makes the enter state of the group selection accessible.\n const enter = (this._enter = update\n .enter()\n .append(this._tagName)\n .attr(\n \"class\",\n (d: DataPoint, i: number) =>\n `d3plus-Shape d3plus-${this._name} d3plus-id-${strip(this._nestWrapper(this._id)(d, i) as string)}`,\n )\n .call(this._applyTransform.bind(this))\n .attr(\"aria-label\", this._ariaLabel as never)\n .attr(\"role\", this._role as never)\n .attr(\"opacity\", this._nestWrapper(this._opacity) as never));\n\n const enterUpdate = enter.merge(update);\n\n let enterUpdateRender = enterUpdate.attr(\n \"shape-rendering\",\n this._nestWrapper(this._shapeRendering) as never,\n );\n\n if (this._duration) {\n enterUpdateRender = enterUpdateRender\n .attr(\"pointer-events\", \"none\")\n .transition(this._transition)\n .transition()\n .delay(100)\n .attr(\n \"pointer-events\",\n this._pointerEvents as never,\n ) as unknown as D3Selection;\n }\n\n enterUpdateRender.attr(\n \"opacity\",\n this._nestWrapper(this._opacity) as never,\n );\n\n // Makes the exit state of the group selection accessible.\n const exit = (this._exit = update.exit());\n if (this._duration) exit.transition().delay(this._duration).remove();\n else exit.remove();\n\n this._renderImage();\n this._renderLabels();\n\n this._hoverGroup = elem(`g.d3plus-${this._name}-hover`, {\n parent: this._group,\n });\n this._activeGroup = elem(`g.d3plus-${this._name}-active`, {\n parent: this._group,\n });\n\n const hitAreas = this._group\n .selectAll(\".d3plus-HitArea\")\n .data(\n this._hitArea && Object.keys(this._on).length ? data : [],\n key as never,\n );\n\n hitAreas.order().call(this._applyTransform.bind(this));\n\n const isLine = this._name === \"Line\";\n\n if (isLine) {\n const curve = this._curve.bind(this)(\n this.config() as DataPoint,\n ) as string;\n isLine &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this._path as any)\n .curve(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (paths as any)[\n `curve${curve.charAt(0).toUpperCase()}${curve.slice(1)}`\n ],\n )\n .defined(this._defined)\n .x(this._x)\n .y(this._y);\n }\n\n const hitEnter = hitAreas\n .enter()\n .append(isLine ? \"path\" : \"rect\")\n .attr(\n \"class\",\n (d: DataPoint, i: number) =>\n `d3plus-HitArea d3plus-id-${strip(this._nestWrapper(this._id)(d, i) as string)}`,\n )\n .attr(\"fill\", \"black\")\n .attr(\"stroke\", \"black\")\n .attr(\"pointer-events\", \"painted\")\n .attr(\"opacity\", 0)\n .call(this._applyTransform.bind(this));\n\n const that = this;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hitUpdates = hitAreas.merge(hitEnter as any).each(function (\n this: any,\n d: DataPoint,\n ) {\n const i = that._data.indexOf(d);\n const h = that._hitArea!(d, i, that._aes(d, i));\n return h &&\n !(\n that._name === \"Line\" &&\n parseFloat(that._strokeWidth(d, i) as string) > 10\n )\n ? select(this).call(\n attrize,\n h as Record<string, string | number | boolean>,\n )\n : select(this).remove();\n });\n\n hitAreas.exit().remove();\n\n this._applyEvents(this._hitArea ? hitUpdates : enterUpdate);\n\n setTimeout(() => {\n if (this._active) this._renderActive();\n else if (this._hover) this._renderHover();\n if (callback) callback();\n }, this._duration + 100);\n\n return this;\n }\n\n /**\n The active callback function for highlighting shapes.\n*/\n active(): ((d: DataPoint, i: number) => boolean) | null;\n active(_: ((d: DataPoint, i: number) => boolean) | null): this;\n active(\n _?: ((d: DataPoint, i: number) => boolean) | null,\n ): ((d: DataPoint, i: number) => boolean) | null | this {\n if (!arguments.length || _ === undefined) return this._active;\n this._active = _;\n if (this._group) {\n // this._renderImage();\n // this._renderLabels();\n this._renderActive();\n }\n return this;\n }\n\n /**\n When shapes are active, this is the opacity of any shape that is not active.\n*/\n activeOpacity(): number;\n activeOpacity(_: number): this;\n activeOpacity(_?: number): number | this {\n return arguments.length\n ? ((this._activeOpacity = _!), this)\n : this._activeOpacity;\n }\n\n /**\n The style to apply to active shapes.\n*/\n activeStyle(): Record<string, unknown>;\n activeStyle(_: Record<string, unknown>): this;\n activeStyle(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._activeStyle = assign({}, this._activeStyle, _!)), this)\n : this._activeStyle;\n }\n\n /**\n The aria-label attribute for each shape.\n*/\n ariaLabel(): AccessorFn;\n ariaLabel(_: AccessorFn | string): this;\n ariaLabel(_?: AccessorFn | string): AccessorFn | this {\n return _ !== undefined\n ? ((this._ariaLabel = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._ariaLabel;\n }\n\n /**\n The background-image accessor for each shape.\n*/\n backgroundImage(): AccessorFn;\n backgroundImage(_: AccessorFn | string): this;\n backgroundImage(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._backgroundImage = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._backgroundImage;\n }\n\n /**\n The data array used to create shapes. A shape will be drawn for each object in the array.\n*/\n data(): DataPoint[];\n data(_: DataPoint[]): this;\n data(_?: DataPoint[]): DataPoint[] | this {\n return arguments.length ? ((this._data = _!), this) : this._data;\n }\n\n /**\n 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.\n*/\n discrete(): string | undefined;\n discrete(_: string): this;\n discrete(_?: string): string | undefined | this {\n return arguments.length ? ((this._discrete = _), this) : this._discrete;\n }\n\n /**\n The animation duration in milliseconds.\n*/\n duration(): number;\n duration(_: number): this;\n duration(_?: number): number | this {\n return arguments.length ? ((this._duration = _!), this) : this._duration;\n }\n\n /**\n The fill color accessor for each shape.\n*/\n fill(): AccessorFn;\n fill(_: AccessorFn | string): this;\n fill(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._fill = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._fill;\n }\n\n /**\n Defines the \"fill-opacity\" attribute for the shapes.\n*/\n fillOpacity(): AccessorFn;\n fillOpacity(_: AccessorFn | number): this;\n fillOpacity(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._fillOpacity = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._fillOpacity;\n }\n\n /**\n The hover callback function for highlighting shapes on mouseover.\n*/\n hover(): ((d: DataPoint, i: number) => boolean) | null;\n hover(_: ((d: DataPoint, i: number) => boolean) | null): this;\n hover(\n _?: ((d: DataPoint, i: number) => boolean) | null,\n ): ((d: DataPoint, i: number) => boolean) | null | this {\n if (!arguments.length || _ === void 0) return this._hover;\n this._hover = _;\n if (this._group) {\n // this._renderImage();\n // this._renderLabels();\n this._renderHover();\n }\n return this;\n }\n\n /**\n The style to apply to hovered shapes.\n*/\n hoverStyle(): Record<string, unknown>;\n hoverStyle(_: Record<string, unknown>): this;\n hoverStyle(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._hoverStyle = assign({}, this._hoverStyle, _!)), this)\n : this._hoverStyle;\n }\n\n /**\n The opacity of non-hovered shapes when any shape is hovered.\n*/\n hoverOpacity(): number;\n hoverOpacity(_: number): this;\n hoverOpacity(_?: number): number | this {\n return arguments.length\n ? ((this._hoverOpacity = _!), this)\n : this._hoverOpacity;\n }\n\n /**\n The mouse hit area accessor function.\n @example\nfunction(d, i, shape) {\n return {\n \"width\": shape.width,\n \"height\": shape.height,\n \"x\": -shape.width / 2,\n \"y\": -shape.height / 2\n };\n}\n*/\n hitArea():\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown>)\n | null;\n hitArea(\n _:\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown>)\n | Record<string, unknown>,\n ): this;\n hitArea(\n _?:\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown>)\n | Record<string, unknown>,\n ):\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown>)\n | null\n | this {\n return arguments.length\n ? ((this._hitArea = (typeof _ === \"function\" ? _ : constant(_)) as unknown as (d: DataPoint, i: number, aes: ShapeAes) => Record<string, unknown>), this)\n : this._hitArea;\n }\n\n /**\n The unique id accessor for each shape.\n*/\n id(): AccessorFn;\n id(_: AccessorFn): this;\n id(_?: AccessorFn): AccessorFn | this {\n return arguments.length ? ((this._id = _!), this) : this._id;\n }\n\n /**\n The text label accessor for each shape.\n*/\n label(): AccessorFn;\n label(_: AccessorFn | string | string[]): this;\n label(_?: AccessorFn | string | string[]): AccessorFn | this {\n return arguments.length\n ? ((this._label =\n typeof _ === \"function\" ? _ : (constant(_) as unknown as AccessorFn)),\n this)\n : this._label;\n }\n\n /**\n The label bounds accessor function.\n @example\nfunction(d, i, shape) {\n return {\n \"width\": shape.width,\n \"height\": shape.height,\n \"x\": -shape.width / 2,\n \"y\": -shape.height / 2\n };\n}\n*/\n labelBounds():\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown> | null | false)\n | null;\n labelBounds(\n _:\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown> | null | false)\n | Record<string, unknown>,\n ): this;\n labelBounds(\n _?:\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown> | null | false)\n | Record<string, unknown>,\n ):\n | ((\n d: DataPoint,\n i: number,\n aes: Record<string, unknown>,\n ) => Record<string, unknown> | null | false)\n | null\n | this {\n return arguments.length\n ? ((this._labelBounds = (typeof _ === \"function\" ? _ : constant(_)) as unknown as typeof this._labelBounds), this)\n : this._labelBounds;\n }\n\n /**\n A pass-through to the config method of the TextBox class used to create a shape's labels.\n*/\n labelConfig(): Record<string, unknown>;\n labelConfig(_: Record<string, unknown>): this;\n labelConfig(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._labelConfig = assign(this._labelConfig, _!)), this)\n : this._labelConfig;\n }\n\n /**\n The opacity accessor for each shape.\n*/\n opacity(): AccessorFn;\n opacity(_: AccessorFn | number): this;\n opacity(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._opacity = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._opacity;\n }\n\n /**\n The pointer-events CSS property for each shape.\n*/\n pointerEvents(): AccessorFn;\n pointerEvents(_: AccessorFn | string): this;\n pointerEvents(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._pointerEvents = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._pointerEvents;\n }\n\n /**\n The role attribute.\n*/\n role(): AccessorFn;\n role(_: AccessorFn | string): this;\n role(_?: AccessorFn | string): AccessorFn | this {\n return _ !== undefined\n ? ((this._role = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._role;\n }\n\n /**\n The rotation angle in degrees for each shape.\n*/\n rotate(): AccessorFn;\n rotate(_: AccessorFn | number): this;\n rotate(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._rotate = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._rotate;\n }\n\n /**\n Defines the \"rx\" attribute for the shapes.\n*/\n rx(): AccessorFn;\n rx(_: AccessorFn | number): this;\n rx(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._rx = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._rx;\n }\n\n /**\n Defines the \"rx\" attribute for the shapes.\n*/\n ry(): AccessorFn;\n ry(_: AccessorFn | number): this;\n ry(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._ry = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._ry;\n }\n\n /**\n The scale transform accessor for each shape.\n*/\n scale(): AccessorFn;\n scale(_: AccessorFn | number): this;\n scale(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._scale = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._scale;\n }\n\n /**\n The SVG container element as a d3 selector or DOM element.\n*/\n select(): D3Selection;\n select(_: string | HTMLElement | SVGElement | null): this;\n select(_?: string | HTMLElement | SVGElement | null): D3Selection | this {\n return arguments.length\n ? ((this._select = select(_ as string) as unknown as D3Selection), this)\n : this._select;\n }\n\n /**\n The shape-rendering.\n\n@example\nfunction(d) {\n return d.x;\n}\n*/\n shapeRendering(): AccessorFn;\n shapeRendering(_: AccessorFn | string): this;\n shapeRendering(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._shapeRendering = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._shapeRendering;\n }\n\n /**\n A comparator function used to sort shapes for layering order.\n*/\n sort(): ((a: DataPoint, b: DataPoint) => number) | null;\n sort(_: ((a: DataPoint, b: DataPoint) => number) | null): this;\n sort(\n _?: ((a: DataPoint, b: DataPoint) => number) | null,\n ): ((a: DataPoint, b: DataPoint) => number) | null | this {\n return arguments.length ? ((this._sort = _ ?? null), this) : this._sort;\n }\n\n /**\n The stroke color accessor for each shape.\n*/\n stroke(): AccessorFn;\n stroke(_: AccessorFn | string): this;\n stroke(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._stroke = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._stroke;\n }\n\n /**\n Defines the \"stroke-dasharray\" attribute for the shapes.\n*/\n strokeDasharray(): AccessorFn;\n strokeDasharray(_: AccessorFn | string): this;\n strokeDasharray(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._strokeDasharray = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._strokeDasharray;\n }\n\n /**\n Defines the \"stroke-linecap\" attribute for the shapes. Accepted values are `\"butt\"`, `\"round\"`, and `\"square\"`.\n*/\n strokeLinecap(): AccessorFn;\n strokeLinecap(_: AccessorFn | string): this;\n strokeLinecap(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._strokeLinecap = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._strokeLinecap;\n }\n\n /**\n Defines the \"stroke-opacity\" attribute for the shapes.\n*/\n strokeOpacity(): AccessorFn;\n strokeOpacity(_: AccessorFn | number): this;\n strokeOpacity(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._strokeOpacity = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._strokeOpacity;\n }\n\n /**\n The stroke-width.\n*/\n strokeWidth(): AccessorFn;\n strokeWidth(_: AccessorFn | number): this;\n strokeWidth(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._strokeWidth = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._strokeWidth;\n }\n\n /**\n The text-anchor.\n*/\n textAnchor(): AccessorFn;\n textAnchor(_: AccessorFn | string): this;\n textAnchor(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._textAnchor = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._textAnchor;\n }\n\n /**\n Defines the texture used inside of each shape. This uses the [textures.js](https://riccardoscalco.it/textures/) 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.\n*/\n texture(): AccessorFn;\n texture(_: AccessorFn | string | Record<string, unknown>): this;\n texture(\n _?: AccessorFn | string | Record<string, unknown>,\n ): AccessorFn | this {\n return arguments.length\n ? ((this._texture =\n typeof _ === \"function\" ? _ : (constant(_) as unknown as AccessorFn)),\n this)\n : this._texture;\n }\n\n /**\n A series of global texture methods to be used for all textures (ie. `{stroke: \"darkorange\", strokeWidth: 2}`).\n*/\n textureDefault(): Record<string, unknown>;\n textureDefault(_: Record<string, unknown>): this;\n textureDefault(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._textureDefault = assign(this._textureDefault, _!)), this)\n : this._textureDefault;\n }\n\n /**\n The vector-effect.\n*/\n vectorEffect(): AccessorFn;\n vectorEffect(_: AccessorFn | string): this;\n vectorEffect(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._vectorEffect = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._vectorEffect;\n }\n\n /**\n The vertical alignment.\n*/\n verticalAlign(): AccessorFn;\n verticalAlign(_: AccessorFn | string): this;\n verticalAlign(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._verticalAlign = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn),\n this)\n : this._verticalAlign;\n }\n\n /**\n The x position accessor for each shape.\n\n@example\nfunction(d) {\n return d.x;\n}\n*/\n x(): AccessorFn;\n x(_: AccessorFn | number): this;\n x(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._x = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._x;\n }\n\n /**\n The y position accessor for each shape.\n\n@example\nfunction(d) {\n return d.y;\n}\n*/\n y(): AccessorFn;\n y(_: AccessorFn | number): this;\n y(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._y = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._y;\n }\n}\n"],"names":["min","color","pointer","select","selectAll","paths","transition","textures","colorContrast","unique","assign","attrize","elem","isObject","pointDistance","strip","TextBox","accessor","BaseClass","configPrep","constant","findLastIndexWithClass","nodeList","classNames","x","length","className","i","classList","contains","Image","Shape","tagName","_activeOpacity","_activeStyle","_ariaLabel","_backgroundImage","_backgroundImageClass","_data","_duration","_fill","_fillOpacity","_hoverOpacity","_hoverStyle","_id","_label","_labelClass","_labelConfig","_labelBounds","_name","_opacity","_pointerEvents","_role","_rotate","_rx","_ry","_scale","_shapeRendering","_stroke","_strokeDasharray","_strokeLinecap","_strokeOpacity","_strokeWidth","_tagName","_textAnchor","_texture","_textureDefault","_textureDefs","_vectorEffect","_verticalAlign","_x","_y","_select","_transition","_sort","_group","_update","_enter","_exit","_hoverGroup","_activeGroup","_hitArea","_active","_hover","_discrete","_path","_defined","_curve","stroke","d","c","includes","darker","s","id","fontColor","fontSize","padding","formatHex","_aes","_d","_i","_applyEvents","handler","on","events","e","event","_on","nested","values","calcPoint","cursor","node","map","indexOf","bind","undefined","Object","keys","_updateStyle","style","that","size","styleLogic","key","styleObject","hasOwnProperty","call","duration","_applyStyle","attr","texture","_getTextureKey","url","_applyTransform","__d3plusShape__","translate","data","scale","rotate","textureVal","_","fallback","background","pathNames","orientation","fill","retObj","JSON","stringify","_nestWrapper","method","_renderActive","each","parentNode","parent","classed","__d3plus__","group","appendChild","baseVal","_renderHover","d3plusType","notHovering","afterIndex","childNodes","prepend","after","_renderImage","imageData","merge","forEach","datum","aes","r","width","height","y","push","opacity","pointerEvents","update","render","_renderLabels","labelData","labels","bounds","Array","l","b","labelConfig","angle","rotateAnchor","text","fontOpacity","config","callback","append","window","innerWidth","innerHeight","_uuid","_dataFilter","sort","a","textureSet","filter","Boolean","existingTextureDefs","remove","t","k","apply","parse","textureClass","dp","removeChild","order","enter","enterUpdate","enterUpdateRender","delay","exit","hitAreas","isLine","curve","charAt","toUpperCase","slice","defined","hitEnter","hitUpdates","h","parseFloat","setTimeout","active","arguments","activeOpacity","activeStyle","ariaLabel","backgroundImage","discrete","fillOpacity","hover","hoverStyle","hoverOpacity","hitArea","label","labelBounds","role","rx","ry","shapeRendering","strokeDasharray","strokeLinecap","strokeOpacity","strokeWidth","textAnchor","textureDefault","vectorEffect","verticalAlign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,GAAG,QAAO,WAAW;AAC7B,SAAQ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CAAA,AAAC,IAAI,CAACyC,eAAe,GAAGxD,OAAO,IAAI,CAACwD,eAAe,EAAE4E,IAAM,IAAI,AAAD,IAC/D,IAAI,CAAC5E,eAAe;YAC1B;;;YAOAkM,KAAAA;mBAAAA,SAAAA,aAAatH,CAAuB;gBAClC,OAAO+F,UAAUpN,MAAM,GAClB,CAAA,AAAC,IAAI,CAAC2C,aAAa,GAAG,OAAO0E,MAAM,aAAaA,IAAI1H,SAAS0H,IAA8B,IAAI,AAAD,IAC/F,IAAI,CAAC1E,aAAa;YACxB;;;YAOAiM,KAAAA;mBAAAA,SAAAA,cAAcvH,CAAuB;gBACnC,OAAO+F,UAAUpN,MAAM,GAClB,CAAA,AAAC,IAAI,CAAC4C,cAAc,GAAG,OAAOyE,MAAM,aAAaA,IAAI1H,SAAS0H,IAC/D,IAAI,AAAD,IACH,IAAI,CAACzE,cAAc;YACzB;;;YAYA7C,KAAAA;mBAAAA,SAAAA,EAAEsH,CAAuB;gBACvB,OAAO+F,UAAUpN,MAAM,GAClB,CAAA,AAAC,IAAI,CAAC6C,EAAE,GAAG,OAAOwE,MAAM,aAAaA,IAAI1H,SAAS0H,IAA8B,IAAI,AAAD,IACpF,IAAI,CAACxE,EAAE;YACb;;;YAYA4G,KAAAA;mBAAAA,SAAAA,EAAEpC,CAAuB;gBACvB,OAAO+F,UAAUpN,MAAM,GAClB,CAAA,AAAC,IAAI,CAAC8C,EAAE,GAAG,OAAOuE,MAAM,aAAaA,IAAI1H,SAAS0H,IAA8B,IAAI,AAAD,IACpF,IAAI,CAACvE,EAAE;YACb;;;WAp+CmBxC;EAAcb;AAHnC;;AAEA,GACA,SAAqBa,mBAq+CpB"}
@@ -327,3 +327,5 @@ var Whisker = /*#__PURE__*/ function(BaseClass) {
327
327
  /**
328
328
  Creates SVG whisker based on an array of data.
329
329
  */ export { Whisker as default };
330
+
331
+ //# sourceMappingURL=Whisker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shapes/Whisker.ts"],"sourcesContent":["import {groups} from \"d3-array\";\nimport {select} from \"d3-selection\";\n\nimport type {DataPoint} from \"@d3plus/data\";\nimport {assign, elem} from \"@d3plus/dom\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport {accessor, BaseClass, configPrep, constant} from \"../utils/index.js\";\nimport type {AccessorFn} from \"../utils/index.js\";\n\nimport Circle from \"./Circle.js\";\nimport Line from \"./Line.js\";\nimport Rect from \"./Rect.js\";\n\nconst shapes: Record<string, typeof Circle | typeof Rect> = {Circle, Rect};\n\n/**\n Creates SVG whisker based on an array of data.\n*/\nexport default class Whisker extends BaseClass {\n _endpoint: AccessorFn;\n _endpointConfig: Record<string, unknown>;\n _length: AccessorFn;\n _lineConfig: Record<string, unknown>;\n _orient: AccessorFn;\n _x: AccessorFn;\n _y: AccessorFn;\n _data!: DataPoint[];\n _select!: D3Selection;\n _line!: Line;\n _whiskerEndpoint: (Circle | Rect)[];\n\n /**\n Invoked when creating a new class instance, and overrides any default parameters inherited from BaseClass.\n @private\n*/\n constructor() {\n super();\n\n this._endpoint = accessor(\"endpoint\", \"Rect\");\n this._endpointConfig = {\n Circle: {\n r: accessor(\"r\", 5),\n },\n };\n this._length = accessor(\"length\", 25);\n this._lineConfig = {};\n this._orient = accessor(\"orient\", \"top\");\n this._x = accessor(\"x\", 0);\n this._y = accessor(\"y\", 0);\n this._whiskerEndpoint = [];\n }\n\n /**\n Draws the whisker.\n @param callback Optional callback invoked after rendering completes.\n*/\n render(callback?: () => void): this {\n if (this._select === void 0) {\n this.select(\n select(\"body\")\n .append(\"svg\")\n .style(\"width\", `${window.innerWidth}px`)\n .style(\"height\", `${window.innerHeight}px`)\n .style(\"display\", \"block\")\n .node(),\n );\n }\n\n const lineData: DataPoint[] = [];\n this._data.forEach((d: DataPoint, i: number) => {\n const orient = this._orient(d, i) as string;\n const x = this._x(d, i) as number;\n const y = this._y(d, i) as number;\n\n let endpointX = x;\n if (orient === \"left\") endpointX -= this._length(d, i) as number;\n else if (orient === \"right\") endpointX += this._length(d, i) as number;\n\n let endpointY = y;\n if (orient === \"top\") endpointY -= this._length(d, i) as number;\n else if (orient === \"bottom\") endpointY += this._length(d, i) as number;\n\n lineData.push({\n __d3plus__: true,\n data: d,\n i,\n id: i,\n x,\n y,\n } as unknown as DataPoint);\n lineData.push({\n __d3plus__: true,\n data: d,\n i,\n id: i,\n x: endpointX,\n y: endpointY,\n } as unknown as DataPoint);\n });\n\n // Draw whisker line.\n this._line = new Line()\n .data(lineData)\n .select(elem(\"g.d3plus-Whisker\", {parent: this._select}).node())\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .config(configPrep.bind(this as any)(this._lineConfig, \"shape\")!)\n .render(callback);\n\n const whiskerData = this._data.map((d: DataPoint, i: number) => {\n const dataObj: DataPoint = {} as DataPoint;\n (dataObj as Record<string, unknown>).__d3plus__ = true;\n (dataObj as Record<string, unknown>).data = d;\n (dataObj as Record<string, unknown>).i = i;\n (dataObj as Record<string, unknown>).endpoint = this._endpoint(d, i);\n (dataObj as Record<string, unknown>).length = this._length(d, i);\n (dataObj as Record<string, unknown>).orient = this._orient(d, i);\n\n let endpointX = this._x(d, i) as number;\n if (dataObj.orient === \"left\") endpointX -= dataObj.length as number;\n else if (dataObj.orient === \"right\")\n endpointX += dataObj.length as number;\n\n let endpointY = this._y(d, i) as number;\n if (dataObj.orient === \"top\") endpointY -= dataObj.length as number;\n else if (dataObj.orient === \"bottom\")\n endpointY += dataObj.length as number;\n\n (dataObj as Record<string, unknown>).x = endpointX;\n (dataObj as Record<string, unknown>).y = endpointY;\n\n return dataObj;\n });\n\n // Draw whisker endpoint.\n this._whiskerEndpoint = [];\n groups(whiskerData, (d: DataPoint) => d.endpoint).forEach(\n ([shapeName, values]: [DataPoint[keyof DataPoint], DataPoint[]]) => {\n this._whiskerEndpoint.push(\n new shapes[shapeName as string]()\n .data(values)\n .select(\n elem(`g.d3plus-Whisker-Endpoint-${shapeName}`, {\n parent: this._select,\n }).node(),\n )\n .config({\n height: (d: DataPoint) =>\n d.orient === \"top\" || d.orient === \"bottom\" ? 5 : 20,\n width: (d: DataPoint) =>\n d.orient === \"top\" || d.orient === \"bottom\" ? 20 : 5,\n })\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .config(configPrep.bind(this as any)(this._endpointConfig, \"shape\", shapeName as string)!)\n .render(),\n );\n },\n );\n\n return this;\n }\n\n /**\n The active highlight state for all sub-shapes in this Whisker.\n*/\n active(_: ((d: DataPoint, i: number) => boolean) | null): void {\n if (this._line) this._line.active(_);\n if (this._whiskerEndpoint)\n this._whiskerEndpoint.forEach((endPoint: Circle | Rect) =>\n endPoint.active(_),\n );\n }\n\n /**\n The data array used to create shapes.\n*/\n data(): DataPoint[];\n data(_: DataPoint[]): this;\n data(_?: DataPoint[]): DataPoint[] | this {\n return arguments.length ? ((this._data = _!), this) : this._data;\n }\n\n /**\n The endpoint shape type for each whisker.\n*/\n endpoint(): AccessorFn;\n endpoint(_: AccessorFn | string): this;\n endpoint(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._endpoint = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._endpoint;\n }\n\n /**\n Configuration object for each endpoint.\n*/\n endpointConfig(): Record<string, unknown>;\n endpointConfig(_: Record<string, unknown>): this;\n endpointConfig(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._endpointConfig = assign(this._endpointConfig, _!)), this)\n : this._endpointConfig;\n }\n\n /**\n The hover highlight state for all sub-shapes in this Whisker.\n*/\n hover(_: ((d: DataPoint, i: number) => boolean) | null): void {\n if (this._line) this._line.hover(_);\n if (this._whiskerEndpoint)\n this._whiskerEndpoint.forEach((endPoint: Circle | Rect) =>\n endPoint.hover(_),\n );\n }\n\n /**\n Length accessor for whisker.\n*/\n length(): AccessorFn;\n length(_: AccessorFn | number): this;\n length(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._length = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._length;\n }\n\n /**\n Configuration object for the line shape.\n*/\n lineConfig(): Record<string, unknown>;\n lineConfig(_: Record<string, unknown>): this;\n lineConfig(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length\n ? ((this._lineConfig = assign(this._lineConfig, _!)), this)\n : this._lineConfig;\n }\n\n /**\n The orientation of the whisker shape.\n*/\n orient(): AccessorFn;\n orient(_: AccessorFn | string): this;\n orient(_?: AccessorFn | string): AccessorFn | this {\n return arguments.length\n ? ((this._orient = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._orient;\n }\n\n /**\n The SVG container element for this visualization. 3 selector or DOM element.\n*/\n select(): D3Selection;\n select(_: string | HTMLElement | SVGElement | null): this;\n select(_?: string | HTMLElement | SVGElement | null): D3Selection | this {\n return arguments.length\n ? ((this._select = select(_ as string) as unknown as D3Selection), this)\n : this._select;\n }\n\n /**\n The x position accessor for each whisker.\n\n@example\nfunction(d) {\n return d.x;\n}\n*/\n x(): AccessorFn;\n x(_: AccessorFn | number): this;\n x(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._x = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._x;\n }\n\n /**\n The y position accessor for each whisker.\n\n@example\nfunction(d) {\n return d.y;\n}\n*/\n y(): AccessorFn;\n y(_: AccessorFn | number): this;\n y(_?: AccessorFn | number): AccessorFn | this {\n return arguments.length\n ? ((this._y = typeof _ === \"function\" ? _ : constant(_) as unknown as AccessorFn), this)\n : this._y;\n }\n}\n"],"names":["groups","select","assign","elem","accessor","BaseClass","configPrep","constant","Circle","Line","Rect","shapes","Whisker","_endpoint","_endpointConfig","_length","_lineConfig","_orient","_x","_y","_data","_select","_line","_whiskerEndpoint","r","render","callback","append","style","window","innerWidth","innerHeight","node","lineData","forEach","d","i","orient","x","y","endpointX","endpointY","push","__d3plus__","data","id","parent","config","bind","whiskerData","map","dataObj","endpoint","length","shapeName","values","height","width","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AAAC,IAAI,CAACnC,EAAE,GAAG,OAAOyC,MAAM,aAAaA,IAAIpD,SAASoD,IAA8B,IAAI,AAAD,IACpF,IAAI,CAACzC,EAAE;YACb;;;YAYAqB,KAAAA;mBAAAA,SAAAA,EAAEoB,CAAuB;gBACvB,OAAOE,UAAUR,MAAM,GAClB,CAAA,AAAC,IAAI,CAAClC,EAAE,GAAG,OAAOwC,MAAM,aAAaA,IAAIpD,SAASoD,IAA8B,IAAI,AAAD,IACpF,IAAI,CAACxC,EAAE;YACb;;;WA9QmBP;EAAgBP;AAHrC;;AAEA,GACA,SAAqBO,qBA+QpB"}
@@ -8,3 +8,5 @@ export { default as Line } from "./Line.js";
8
8
  export { default as Path } from "./Path.js";
9
9
  export { default as Rect } from "./Rect.js";
10
10
  export { default as Whisker } from "./Whisker.js";
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shapes/index.ts"],"sourcesContent":["export {default as Shape, type ShapeAes} from \"./Shape.js\";\nexport {default as Area} from \"./Area.js\";\nexport {default as Bar} from \"./Bar.js\";\nexport {default as Box} from \"./Box.js\";\nexport {default as Circle} from \"./Circle.js\";\nexport {default as Image} from \"./Image.js\";\nexport {default as Line} from \"./Line.js\";\nexport {default as Path} from \"./Path.js\";\nexport {default as Rect} from \"./Rect.js\";\nexport {default as Whisker} from \"./Whisker.js\";\n"],"names":["default","Shape","Area","Bar","Box","Circle","Image","Line","Path","Rect","Whisker"],"mappings":"AAAA,SAAQA,WAAWC,KAAK,QAAsB,aAAa;AAC3D,SAAQD,WAAWE,IAAI,QAAO,YAAY;AAC1C,SAAQF,WAAWG,GAAG,QAAO,WAAW;AACxC,SAAQH,WAAWI,GAAG,QAAO,WAAW;AACxC,SAAQJ,WAAWK,MAAM,QAAO,cAAc;AAC9C,SAAQL,WAAWM,KAAK,QAAO,aAAa;AAC5C,SAAQN,WAAWO,IAAI,QAAO,YAAY;AAC1C,SAAQP,WAAWQ,IAAI,QAAO,YAAY;AAC1C,SAAQR,WAAWS,IAAI,QAAO,YAAY;AAC1C,SAAQT,WAAWU,OAAO,QAAO,eAAe"}
@@ -2,3 +2,5 @@
2
2
  @type AccessorFn
3
3
  A function that accesses a property from a DataPoint.
4
4
  */ export { };
5
+
6
+ //# sourceMappingURL=AccessorFn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/AccessorFn.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @type AccessorFn\n A function that accesses a property from a DataPoint.\n*/\nexport type AccessorFn = (\n d: DataPoint,\n i?: number,\n) => DataPoint[keyof DataPoint];\n"],"names":[],"mappings":"AAEA;;;AAGA,GACA,WAGgC"}
@@ -173,3 +173,5 @@ var BaseClass = /*#__PURE__*/ function() {
173
173
  /**
174
174
  Provides shared configuration, event handling, and locale management inherited by all d3plus classes.
175
175
  */ export { BaseClass as default };
176
+
177
+ //# sourceMappingURL=BaseClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/BaseClass.ts"],"sourcesContent":["import {assign, isObject} from \"@d3plus/dom\";\nimport {\n findLocale,\n translateLocale as dictionaries,\n type TranslationStrings,\n} from \"@d3plus/locales\";\n\nimport type {D3plusConfig} from \"./D3plusConfig.js\";\nimport RESET from \"./RESET.js\";\n\n/**\n Recursive function that resets nested Object configs.\n\n @private\n*/\nfunction nestedReset(\n obj: Record<string, unknown>,\n defaults: Record<string, unknown> | undefined,\n): void {\n if (isObject(obj)) {\n for (const nestedKey in obj) {\n if (\n {}.hasOwnProperty.call(obj, nestedKey) &&\n !nestedKey.startsWith(\"_\")\n ) {\n const defaultValue =\n defaults && isObject(defaults) ? defaults[nestedKey] : undefined;\n if (obj[nestedKey] === RESET) {\n if (defaultValue) obj[nestedKey] = defaultValue;\n else delete obj[nestedKey];\n } else if (isObject(obj[nestedKey])) {\n nestedReset(\n obj[nestedKey] as Record<string, unknown>,\n defaultValue as Record<string, unknown> | undefined,\n );\n }\n }\n }\n }\n}\n\n/**\n finds all prototype methods of a class and it's parent classes\n @param obj\n @private\n*/\nfunction getAllMethods(obj: object): string[] {\n let props: string[] = [];\n do {\n props = props.concat(Object.getOwnPropertyNames(obj));\n obj = Object.getPrototypeOf(obj);\n } while (obj && obj !== Object.prototype);\n return props.filter(\n e =>\n e.indexOf(\"_\") !== 0 &&\n ![\"config\", \"constructor\", \"parent\", \"render\"].includes(e),\n );\n}\n\n/**\n Provides shared configuration, event handling, and locale management inherited by all d3plus classes.\n*/\nexport default class BaseClass {\n _locale: string;\n _on: Record<string, (...args: unknown[]) => unknown>;\n _parent: Record<string, unknown>;\n _translate: (d: string, locale?: string) => string;\n _uuid: string;\n _configDefault?: D3plusConfig;\n _shapeConfig?: D3plusConfig;\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n*/\n constructor() {\n this._locale = \"en-US\";\n this._on = {};\n this._parent = {};\n this._translate = (d: string, locale: string = this._locale): string => {\n const dictionary: TranslationStrings | undefined = dictionaries[locale];\n const key = d as keyof TranslationStrings;\n return dictionary && dictionary[key] ? dictionary[key] : d;\n };\n this._uuid = crypto.randomUUID();\n }\n\n /**\n Methods that correspond to the key/value pairs and returns this class.\n*/\n config(): D3plusConfig;\n config(_: D3plusConfig): this;\n config(_?: D3plusConfig): D3plusConfig | this {\n if (!this._configDefault) {\n const config: D3plusConfig = {};\n getAllMethods(Object.getPrototypeOf(this)).forEach(k => {\n const v = (this as unknown as Record<string, () => unknown>)[k]();\n if (v !== this) config[k] = isObject(v) ? assign({}, v as Record<string, unknown>) : v;\n });\n this._configDefault = config;\n }\n\n if (arguments.length) {\n for (const k in _) {\n if ({}.hasOwnProperty.call(_, k)) {\n if (k in this) {\n const v = _![k];\n if (v === RESET) {\n if (k === \"on\")\n this._on = this._configDefault![k] as typeof this._on;\n else\n (this as unknown as Record<string, (v: unknown) => unknown>)[k](\n this._configDefault![k],\n );\n } else {\n nestedReset(\n v as Record<string, unknown>,\n this._configDefault![k] as Record<string, unknown>,\n );\n (this as unknown as Record<string, (v: unknown) => unknown>)[k](\n v,\n );\n }\n } else {\n // console.warn(\n // `${this.constructor.name}.config() received unknown property \"${k}\".`,\n // );\n }\n }\n }\n return this;\n } else {\n const config: D3plusConfig = {};\n getAllMethods(Object.getPrototypeOf(this)).forEach(k => {\n config[k] = (this as unknown as Record<string, () => unknown>)[k]();\n });\n return config;\n }\n }\n\n /**\n The locale used for all text and number formatting. Supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). 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.\n\n@example\n {\n separator: \"\",\n suffixes: [\"y\", \"z\", \"a\", \"f\", \"p\", \"n\", \"\\u00b5\", \"m\", \"\", \"k\", \"M\", \"B\", \"t\", \"q\", \"Q\", \"Z\", \"Y\"],\n grouping: [3],\n delimiters: {\n thousands: \",\",\n decimal: \".\"\n },\n currency: [\"$\", \"\"]\n }\n*/\n locale(): string;\n locale(_: string | object): this;\n locale(_?: string | object): string | this {\n return arguments.length\n ? ((this._locale = findLocale(_ as string)), this)\n : this._locale;\n }\n\n /**\n Event listener for the specified event *typenames*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior.\n\n@example <caption>By default, listeners apply globally to all objects, however, passing a namespace with the class name gives control over specific elements:</caption>\nnew Plot\n .on(\"click.Shape\", function(d) {\n console.log(\"data for shape clicked:\", d);\n })\n .on(\"click.Legend\", function(d) {\n console.log(\"data for legend clicked:\", d);\n })\n*/\n on(): Record<string, (...args: unknown[]) => unknown>;\n on(_: string): ((...args: unknown[]) => unknown) | undefined;\n on(_: string, f: (...args: unknown[]) => unknown): this;\n on(_: Record<string, (...args: unknown[]) => unknown>): this;\n on(\n _?: string | Record<string, (...args: unknown[]) => unknown>,\n f?: (...args: unknown[]) => unknown,\n ):\n | Record<string, (...args: unknown[]) => unknown>\n | ((...args: unknown[]) => unknown)\n | undefined\n | this {\n return arguments.length === 2\n ? ((this._on[_ as string] = f!), this)\n : arguments.length\n ? typeof _ === \"string\"\n ? this._on[_]\n : ((this._on = Object.assign({}, this._on, _)), this)\n : this._on;\n }\n\n /**\n Parent config used by the wrapper.\n*/\n parent(): Record<string, unknown>;\n parent(_: Record<string, unknown>): this;\n parent(_?: Record<string, unknown>): Record<string, unknown> | this {\n return arguments.length ? ((this._parent = _!), this) : this._parent;\n }\n\n /**\n 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.\n\n@example <caption>For example, if we wanted to only change the string \"Back\" and allow all other string to return in English:</caption>\n.translate(function(d) {\n return d === \"Back\" ? \"Get outta here\" : d;\n})\n*/\n translate(): (d: string, locale?: string) => string;\n translate(_: (d: string, locale?: string) => string): this;\n translate(\n _?: (d: string, locale?: string) => string,\n ): ((d: string, locale?: string) => string) | this {\n return arguments.length ? ((this._translate = _!), this) : this._translate;\n }\n\n /**\n Configuration object with key/value pairs applied as method calls on each shape.\n*/\n shapeConfig(): D3plusConfig;\n shapeConfig(_: D3plusConfig): this;\n shapeConfig(_?: D3plusConfig): D3plusConfig | this {\n return arguments.length\n ? ((this._shapeConfig = assign(this._shapeConfig ?? {}, _!) as D3plusConfig), this)\n : this._shapeConfig!;\n }\n}\n"],"names":["assign","isObject","findLocale","translateLocale","dictionaries","RESET","nestedReset","obj","defaults","nestedKey","hasOwnProperty","call","startsWith","defaultValue","undefined","getAllMethods","props","concat","Object","getOwnPropertyNames","getPrototypeOf","prototype","filter","e","indexOf","includes","BaseClass","_locale","_on","_parent","_translate","_uuid","_configDefault","_shapeConfig","d","locale","dictionary","key","crypto","randomUUID","config","_","forEach","k","v","arguments","length","on","f","parent","translate","shapeConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,MAAM,EAAEC,QAAQ,QAAO,cAAc;AAC7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AC5E;;;YAOAqB,KAAAA;mBAAAA,SAAAA,YAAYV,CAAgB;oBAEO;gBADjC,OAAOI,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACb,YAAY,GAAGjC,QAAO,qBAAA,IAAI,CAACiC,YAAY,cAAjB,gCAAA,qBAAqB,CAAC,GAAGQ,IAAsB,IAAI,AAAD,IAC/E,IAAI,CAACR,YAAY;YACvB;;;WAxKmBP;;AAHrB;;AAEA,GACA,SAAqBA,uBAyKpB"}
@@ -1 +1,3 @@
1
1
  export { };
2
+
3
+ //# sourceMappingURL=D3plusConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n gridConfig?: Record<string, string | number>;\n label?: string;\n labels?: unknown[];\n labelOffset?: false | number;\n maxSize?: number;\n scale?: AxisScale;\n tickFormat?: (d: number | string) => string | number;\n ticks?: unknown[];\n tickSize?: number;\n title?: string;\n}\n\nexport interface TooltipConfig {\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Position of the color scale, or false to hide it. */\n colorScalePosition?: false | Position;\n /** Column key for matrix-style layouts. */\n column?: string;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Label accessor for shapes. */\n label?: string | ((...args: unknown[]) => string);\n /** Whether to show the legend. */\n legend?: boolean;\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Position of the legend. */\n legendPosition?: Position;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator. */\n loadingHTML?: string;\n /** Metric key for the visualization. */\n metric?: string;\n /** Ocean color for geomaps (any CSS value including 'transparent'). */\n ocean?: string;\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /** Size accessor key. */\n size?: string;\n /** Whether to stack series. */\n stacked?: boolean;\n /** Custom order for stacked series. */\n stackOrder?: string[];\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group. */\n thresholdName?: string;\n /** URL to XYZ map tiles. */\n tileUrl?: string;\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether to show tooltips. */\n tooltip?: boolean;\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((...args: unknown[]) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((...args: unknown[]) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Set to false to disable zooming on geomaps. */\n zoom?: false;\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AAwEA,WA8IC"}
@@ -1,2 +1,4 @@
1
1
  /** String constant used to reset an individual config property. */ var RESET = "D3PLUS-COMMON-RESET";
2
2
  export default RESET;
3
+
4
+ //# sourceMappingURL=RESET.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/RESET.ts"],"sourcesContent":["/** String constant used to reset an individual config property. */\nconst RESET: string = \"D3PLUS-COMMON-RESET\";\nexport default RESET;\n"],"names":["RESET"],"mappings":"AAAA,iEAAiE,GACjE,IAAMA,QAAgB;AACtB,eAAeA,MAAM"}
@@ -16,3 +16,5 @@ function(d) {
16
16
  return d[key] === undefined ? def : d[key];
17
17
  };
18
18
  }
19
+
20
+ //# sourceMappingURL=accessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/accessor.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n Wraps an object key in a simple accessor function.\n @param key The key to be returned from each Object passed to the function.\n @param def A default value to be returned if the key is not present.\n @example <caption>this</caption>\naccessor(\"id\");\n @example <caption>returns this</caption>\nfunction(d) {\n return d[\"id\"];\n}\n*/\nexport default function accessor(\n key: string,\n def?: DataPoint[keyof DataPoint],\n): (d: DataPoint) => DataPoint[keyof DataPoint] {\n if (def === undefined) return (d: DataPoint) => d[key];\n return (d: DataPoint) => (d[key] === undefined ? def : d[key]);\n}\n"],"names":["accessor","key","def","undefined","d"],"mappings":"AAEA;;;;;;;;;;AAUA,GACA,eAAe,SAASA,SACtBC,GAAW,EACXC,GAAgC;IAEhC,IAAIA,QAAQC,WAAW,OAAO,SAACC;eAAiBA,CAAC,CAACH,IAAI;;IACtD,OAAO,SAACG;eAAkBA,CAAC,CAACH,IAAI,KAAKE,YAAYD,MAAME,CAAC,CAACH,IAAI;;AAC/D"}
@@ -75,3 +75,5 @@ function _type_of(obj) {
75
75
  }
76
76
  return newConfig;
77
77
  }
78
+
79
+ //# sourceMappingURL=configPrep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n _shapeConfig: ConfigObject;\n _duration: number;\n _on: Record<string, DataAccessor>;\n [key: string]: unknown;\n}\n\n/**\n Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.\n @param config The configuration object to parse.\n @param type The event classifier to user for \"on\" events. For example, the default event type of \"shape\" will apply all events in the \"on\" config object with that key, like \"click.shape\" and \"mouseleave.shape\", in addition to any gloval events like \"click\" and \"mouseleave\".\n @param nest An optional nested key to bubble up to the parent config level.\n*/\nexport default function configPrep(\n this: VizContext,\n config: ConfigObject = this._shapeConfig,\n type: string = \"shape\",\n nest: string | false = false,\n): ConfigObject {\n const newConfig: ConfigObject = {duration: this._duration, on: {}};\n\n const wrapFunction =\n (func: DataAccessor) =>\n (\n d: DataPoint | D3PlusWrapped,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n ): DataPoint[keyof DataPoint] => {\n if (!func) return func as unknown as DataPoint[keyof DataPoint];\n let parent: D3PlusWrapped | undefined;\n while ((d as D3PlusWrapped).__d3plus__) {\n if (parent) (d as D3PlusWrapped).__d3plusParent__ = parent;\n parent = d as D3PlusWrapped;\n i = (d as D3PlusWrapped).i!;\n d = ((d as D3PlusWrapped).data || (d as D3PlusWrapped).feature)!;\n }\n return func.bind(this)(d as DataPoint, i, s || parent, e);\n };\n\n const parseEvents = (\n newObj: ConfigObject,\n on: Record<string, DataAccessor>,\n ): void => {\n for (const event in on) {\n if (\n ({}.hasOwnProperty.call(on, event) && !event.includes(\".\")) ||\n event.includes(`.${type}`)\n ) {\n (newObj.on as unknown as Record<string, DataAccessor>)[event] = wrapFunction(on[event]);\n }\n }\n };\n\n const arrayEval = (arr: ConfigValue[]): ConfigValue[] =>\n arr.map((d: ConfigValue) => {\n if (d instanceof Array) return arrayEval(d);\n else if (typeof d === \"object\")\n return keyEval({} as ConfigObject, d as ConfigObject);\n else if (typeof d === \"function\") return wrapFunction(d as DataAccessor);\n else return d;\n });\n\n const keyEval = (newObj: ConfigObject, obj: ConfigObject): ConfigObject => {\n for (const key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n if (key === \"on\")\n parseEvents(newObj, obj[key] as unknown as Record<string, DataAccessor>);\n else if (typeof obj[key] === \"function\") {\n newObj[key] = wrapFunction(obj[key] as DataAccessor);\n } else if (obj[key] instanceof Array) {\n newObj[key] = arrayEval(obj[key] as ConfigValue[]);\n } else if (typeof obj[key] === \"object\") {\n if (!newObj[key]) newObj[key] = {} as ConfigObject;\n (newObj[key] as ConfigObject).on = {};\n keyEval(newObj[key] as ConfigObject, obj[key] as ConfigObject);\n } else newObj[key] = obj[key];\n }\n }\n\n return newObj;\n };\n\n keyEval(newConfig, config);\n if (this._on) parseEvents(newConfig, this._on as unknown as Record<string, DataAccessor>);\n if (nest && config[nest]) {\n keyEval(newConfig, config[nest] as ConfigObject);\n if ((config[nest] as ConfigObject).on)\n parseEvents(newConfig, (config[nest] as ConfigObject).on as unknown as Record<string, DataAccessor>);\n }\n\n return newConfig;\n}\n"],"names":["configPrep","config","_shapeConfig","type","nest","newConfig","duration","_duration","on","wrapFunction","func","d","i","s","e","parent","__d3plus__","__d3plusParent__","data","feature","bind","parseEvents","newObj","event","hasOwnProperty","call","includes","arrayEval","arr","map","Array","keyEval","obj","key","_on"],"mappings":";;;;;;;;;;;;AAoCA;;;;;AAKA,GACA,eAAe,SAASA;;QAEtBC,SAAAA,iEAAuB,IAAI,CAACC,YAAY,EACxCC,OAAAA,iEAAe,SACfC,OAAAA,iEAAuB;IAEvB,IAAMC,YAA0B;QAACC,UAAU,IAAI,CAACC,SAAS;QAAEC,IAAI,CAAC;IAAC;IAEjE,IAAMC,eACJ,sBAACC;eACD,SACEC,GACAC,GACAC,GACAC;YAEA,IAAI,CAACJ,MAAM,OAAOA;YAClB,IAAIK;YACJ,MAAO,AAACJ,EAAoBK,UAAU,CAAE;gBACtC,IAAID,QAAQ,AAACJ,EAAoBM,gBAAgB,GAAGF;gBACpDA,SAASJ;gBACTC,IAAI,AAACD,EAAoBC,CAAC;gBAC1BD,IAAK,AAACA,EAAoBO,IAAI,IAAI,AAACP,EAAoBQ,OAAO;YAChE;YACA,OAAOT,KAAKU,IAAI,QAAOT,GAAgBC,GAAGC,KAAKE,QAAQD;QACzD;;IAEF,IAAMO,cAAc,qBAClBC,QACAd;QAEA,IAAK,IAAMe,SAASf,GAAI;YACtB,IACE,AAAC,CAAA,CAAC,CAAA,EAAEgB,cAAc,CAACC,IAAI,CAACjB,IAAIe,UAAU,CAACA,MAAMG,QAAQ,CAAC,QACtDH,MAAMG,QAAQ,CAAC,AAAC,IAAQ,OAALvB,QACnB;gBACCmB,OAAOd,EAAE,AAA4C,CAACe,MAAM,GAAGd,aAAaD,EAAE,CAACe,MAAM;YACxF;QACF;IACF;IAEA,IAAMI,YAAY,oBAACC;eACjBA,IAAIC,GAAG,CAAC,S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EACnCa,YAAYhB,WAAW,AAACJ,MAAM,CAACG,KAAK,CAAkBI,EAAE;IAC5D;IAEA,OAAOH;AACT"}
@@ -12,3 +12,5 @@ function() {
12
12
  return value;
13
13
  };
14
14
  }
15
+
16
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/constant.ts"],"sourcesContent":["/**\n Wraps non-function variables in a simple return function.\n @param value The value to wrap in a return function.\n @example <caption>this</caption>\nconstant(42);\n @example <caption>returns this</caption>\nfunction() {\n return 42;\n}\n*/\nexport default function <T>(value: T): () => T {\n return function constant(): T {\n return value;\n };\n}\n"],"names":["value","constant"],"mappings":"AAAA;;;;;;;;;AASA,GACA,eAAe,SAAaA,KAAQ;IAClC,OAAO,SAASC;QACd,OAAOD;IACT;AACF"}
@@ -7,3 +7,5 @@
7
7
  */ export default function getProp(type, d, i) {
8
8
  return d[type] || this["_".concat(type)](d, i);
9
9
  }
10
+
11
+ //# sourceMappingURL=getProp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/getProp.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\n/**\n @module getProp\n @param type\n @param d\n @param i\n @private\n*/\nexport default function getProp(\n this: Record<string, (d: DataPoint, i: number) => DataPoint[keyof DataPoint]>,\n type: string,\n d: DataPoint,\n i: number,\n): DataPoint[keyof DataPoint] {\n return d[type] || this[`_${type}`](d, i);\n}\n"],"names":["getProp","type","d","i"],"mappings":"AAEA;;;;;;AAMA,GACA,eAAe,SAASA,QAEtBC,IAAY,EACZC,CAAY,EACZC,CAAS;IAET,OAAOD,CAAC,CAACD,KAAK,IAAI,IAAI,CAAC,AAAC,IAAQ,OAALA,MAAO,CAACC,GAAGC;AACxC"}
@@ -4,3 +4,5 @@ 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
+
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {D3plusConfig, AxisConfig, TooltipConfig} from \"./D3plusConfig.js\";\nexport {default as configPrep} from \"./configPrep.js\";\nexport {default as constant} from \"./constant.js\";\nexport {default as getProp} from \"./getProp.js\";\nexport {default as RESET} from \"./RESET.js\";\n"],"names":["default","accessor","BaseClass","configPrep","constant","getProp","RESET"],"mappings":"AACA,SAAQA,WAAWC,QAAQ,QAAO,gBAAgB;AAClD,SAAQD,WAAWE,SAAS,QAAO,iBAAiB;AAEpD,SAAQF,WAAWG,UAAU,QAAO,kBAAkB;AACtD,SAAQH,WAAWI,QAAQ,QAAO,gBAAgB;AAClD,SAAQJ,WAAWK,OAAO,QAAO,eAAe;AAChD,SAAQL,WAAWM,KAAK,QAAO,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
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",
@@ -58,13 +58,13 @@
58
58
  "open-color": "^1.9.1",
59
59
  "textures": "^1.2.3",
60
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"
61
+ "@d3plus/dom": "3.1.3",
62
+ "@d3plus/format": "3.1.3",
63
+ "@d3plus/locales": "3.1.3",
64
+ "@d3plus/data": "3.1.3",
65
+ "@d3plus/math": "3.1.3",
66
+ "@d3plus/text": "3.1.3",
67
+ "@d3plus/color": "3.1.3"
68
68
  },
69
69
  "scripts": {
70
70
  "build:esm": "node ../../scripts/build-esm.js",