@d3plus/core 3.0.0 → 3.0.2

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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ import modules from "@d3plus/core";
13
13
  In vanilla JavaScript, a `d3plus` global is exported from the pre-bundled version:
14
14
 
15
15
  ```html
16
- <script src="https://cdn.jsdelivr.net/npm/@d3plus/core@3.0.0"></script>
16
+ <script src="https://cdn.jsdelivr.net/npm/@d3plus/core"></script>
17
17
  <script>
18
18
  console.log(d3plus);
19
19
  </script>
@@ -162,7 +162,7 @@ import { assign, parseSides } from "@d3plus/dom";
162
162
  import { pointDistance } from "@d3plus/math";
163
163
  import { Circle, Path } from "../shapes/index.js";
164
164
  import { accessor, configPrep, constant } from "../utils/index.js";
165
- import Viz from "./Viz";
165
+ import Viz from "./Viz.js";
166
166
  import attributions from "./helpers/tileAttributions.js";
167
167
  /**
168
168
  * @name findAttribution
@@ -112,7 +112,7 @@ import { addToQueue } from "@d3plus/data";
112
112
  import { largestRect, pointDistance, pointRotate } from "@d3plus/math";
113
113
  import * as shapes from "../shapes/index.js";
114
114
  import { accessor, configPrep, constant } from "../utils/index.js";
115
- import Viz from "./Viz";
115
+ import Viz from "./Viz.js";
116
116
  /**
117
117
  * Fetches the unique ID for a data point, whether it's defined by data or nodes.
118
118
  * @private
@@ -109,7 +109,7 @@ import { colorLegible } from "@d3plus/color";
109
109
  import { addToQueue } from "@d3plus/data";
110
110
  import * as shapes from "../shapes/index.js";
111
111
  import { accessor, configPrep, constant } from "../utils/index.js";
112
- import Viz from "./Viz";
112
+ import Viz from "./Viz.js";
113
113
  var Rings = /*#__PURE__*/ function(Viz) {
114
114
  "use strict";
115
115
  _inherits(Rings, Viz);
@@ -107,7 +107,7 @@ import { assign, elem } from "@d3plus/dom";
107
107
  import { accessor, configPrep, constant } from "../utils/index.js";
108
108
  import { Path } from "../shapes/index.js";
109
109
  import * as shapes from "../shapes/index.js";
110
- import Viz from "./Viz";
110
+ import Viz from "./Viz.js";
111
111
  var Sankey = /*#__PURE__*/ function(Viz) {
112
112
  "use strict";
113
113
  _inherits(Sankey, Viz);
@@ -1,21 +1,21 @@
1
- export { default as AreaPlot } from "./AreaPlot";
2
- export { default as BarChart } from "./BarChart";
3
- export { default as BoxWhisker } from "./BoxWhisker";
4
- export { default as BumpChart } from "./BumpChart";
5
- export { default as Donut } from "./Donut";
6
- export { default as Geomap } from "./Geomap";
7
- export { default as LinePlot } from "./LinePlot";
8
- export { default as Matrix } from "./Matrix";
9
- export { default as Network } from "./Network";
10
- export { default as Pack } from "./Pack";
11
- export { default as Pie } from "./Pie";
12
- export { default as Plot } from "./Plot";
13
- export { default as Priestley } from "./Priestley";
14
- export { default as Radar } from "./Radar";
15
- export { default as RadialMatrix } from "./RadialMatrix";
16
- export { default as Rings } from "./Rings";
17
- export { default as Sankey } from "./Sankey";
18
- export { default as StackedArea } from "./StackedArea";
19
- export { default as Tree } from "./Tree";
20
- export { default as Treemap } from "./Treemap";
21
- export { default as Viz } from "./Viz";
1
+ export { default as AreaPlot } from "./AreaPlot.js";
2
+ export { default as BarChart } from "./BarChart.js";
3
+ export { default as BoxWhisker } from "./BoxWhisker.js";
4
+ export { default as BumpChart } from "./BumpChart.js";
5
+ export { default as Donut } from "./Donut.js";
6
+ export { default as Geomap } from "./Geomap.js";
7
+ export { default as LinePlot } from "./LinePlot.js";
8
+ export { default as Matrix } from "./Matrix.js";
9
+ export { default as Network } from "./Network.js";
10
+ export { default as Pack } from "./Pack.js";
11
+ export { default as Pie } from "./Pie.js";
12
+ export { default as Plot } from "./Plot.js";
13
+ export { default as Priestley } from "./Priestley.js";
14
+ export { default as Radar } from "./Radar.js";
15
+ export { default as RadialMatrix } from "./RadialMatrix.js";
16
+ export { default as Rings } from "./Rings.js";
17
+ export { default as Sankey } from "./Sankey.js";
18
+ export { default as StackedArea } from "./StackedArea.js";
19
+ export { default as Tree } from "./Tree.js";
20
+ export { default as Treemap } from "./Treemap.js";
21
+ export { default as Viz } from "./Viz.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
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",
@@ -34,13 +34,13 @@
34
34
  "test": "eslint index.js src/**/*.js && eslint --global=it test && mocha 'test/**/*-test.js'"
35
35
  },
36
36
  "dependencies": {
37
- "@d3plus/color": "3.0.0",
38
- "@d3plus/data": "3.0.0",
39
- "@d3plus/dom": "3.0.0",
40
- "@d3plus/format": "3.0.0",
41
- "@d3plus/locales": "3.0.0",
42
- "@d3plus/math": "3.0.0",
43
- "@d3plus/text": "3.0.0",
37
+ "@d3plus/color": "3.0.2",
38
+ "@d3plus/data": "3.0.2",
39
+ "@d3plus/dom": "3.0.2",
40
+ "@d3plus/format": "3.0.2",
41
+ "@d3plus/locales": "3.0.2",
42
+ "@d3plus/math": "3.0.2",
43
+ "@d3plus/text": "3.0.2",
44
44
  "@popperjs/core": "^2.11.8",
45
45
  "d3-array": "^3.2.4",
46
46
  "d3-brush": "^3.0.0",
@@ -1,5 +1,5 @@
1
1
  /*
2
- @d3plus/core v3.0.0
2
+ @d3plus/core v3.0.2
3
3
  Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
4
4
  Copyright (c) 2025 D3plus - https://d3plus.org
5
5
  @license MIT
@@ -228,7 +228,7 @@
228
228
  date1.setFullYear(year1);
229
229
  return date1;
230
230
  }
231
- // tests for quarterly formats (ie. "QX YYYY")
231
+ // tests for quarterly formats (ie. "QX YYYY" and "YYYY QX")
232
232
  var quarterPrefix = new RegExp(/^([qQ]{1}[1-4]{1}|[1-4]{1}[qQ]{1})[\s|-]{0,1}(-*\d{1,4})$/g).exec(s);
233
233
  var quarterSuffix = new RegExp(/^(-*\d{1,4})[\s|-]{0,1}([qQ]{1}[1-4]{1}|[1-4]{1}[qQ]{1})$/g).exec(s);
234
234
  if (quarterPrefix || quarterSuffix) {
@@ -238,14 +238,24 @@
238
238
  date2.setFullYear(year2);
239
239
  return date2;
240
240
  }
241
+ // tests for monthly formats (ie. "MM-YYYY" and "YYYY-MM")
242
+ var monthPrefix = new RegExp(/^([-*\d]{1,2})\-(-*\d{1,4})$/g).exec(s);
243
+ var monthSuffix = new RegExp(/^(-*\d{1,4})\-([-*\d]{1,2})$/g).exec(s);
244
+ if (monthPrefix || monthSuffix) {
245
+ var month = +(monthPrefix ? monthPrefix[1] : monthSuffix[2]);
246
+ var year3 = +(monthPrefix ? monthPrefix[2] : monthSuffix[1]);
247
+ var date3 = new Date(year3, month - 1, 1);
248
+ date3.setFullYear(year3);
249
+ return date3;
250
+ }
241
251
  // detects if only passing a year value
242
252
  if (!s.includes("/") && !s.includes(" ") && (!s.includes("-") || !s.indexOf("-"))) {
243
- var date3 = new Date(+s, 0, 1);
244
- date3.setFullYear(d);
245
- return date3;
253
+ var date4 = new Date(+s, 0, 1);
254
+ date4.setFullYear(d);
255
+ return date4;
246
256
  }
247
- // falls back to Date object
248
- return new Date(s);
257
+ // falls back to Date object, replacing hyphens with slashes
258
+ return new Date(s.replace(/-/g, "/"));
249
259
  }
250
260
 
251
261
  var xhtml = "http://www.w3.org/1999/xhtml";