chartjs-plugin-chart2music 0.2.0 → 0.4.0

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
@@ -43,6 +43,7 @@ The following plugin options are available:
43
43
  * `cc` - the equivalent of the [chart2music option `cc`](https://chart2music.com/docs/API/Config#axes)
44
44
  * `audioEngine` - the equivalent of the [chart2music option `audioEngine`](https://chart2music.com/docs/API/Config#cc)
45
45
  * `axes` - the equivalent of the [chart2music option `axes`](https://chart2music.com/docs/API/Config#axes)
46
+ * `lang` - the language your user speaks. The available languages that Chart2Music supports are: "en", "de", "es", "fr", "it". The default is "en". If you would like to add translations for another language, [Chart2Music is open to PRs](https://github.com/julianna-langston/chart2music).
46
47
 
47
48
  Here's an example for providing options:
48
49
  ```js
@@ -96,7 +97,6 @@ Things we plan to support in the future:
96
97
  * Complex `parsing` options for data
97
98
  * Date/Time support for axes
98
99
  * Subtitle
99
- * Locale
100
100
  * Dataset visibility (when you show/hide a category from the legend)
101
101
  * Radar charts
102
102
  * Custom formatting for axis tick values
package/dist/plugin.cjs CHANGED
@@ -416,6 +416,9 @@ var generateChart = function generateChart(chart, options) {
416
416
  if (c2mOptions.data.length === 0) {
417
417
  return;
418
418
  }
419
+ if (options.lang) {
420
+ c2mOptions.lang = options.lang;
421
+ }
419
422
  var _c2mChart = (0, _chart2music["default"])(c2mOptions),
420
423
  err = _c2mChart.err,
421
424
  c2m = _c2mChart.data;
package/dist/plugin.js CHANGED
@@ -364,6 +364,9 @@ var chartjs2music = (function (c2mChart) {
364
364
  if (c2mOptions.data.length === 0) {
365
365
  return;
366
366
  }
367
+ if (options.lang) {
368
+ c2mOptions.lang = options.lang;
369
+ }
367
370
  const { err, data: c2m } = c2mChart(c2mOptions);
368
371
  /* istanbul-ignore-next */
369
372
  if (err) {
package/dist/plugin.mjs CHANGED
@@ -363,6 +363,9 @@ const generateChart = (chart, options) => {
363
363
  if (c2mOptions.data.length === 0) {
364
364
  return;
365
365
  }
366
+ if (options.lang) {
367
+ c2mOptions.lang = options.lang;
368
+ }
366
369
  const { err, data: c2m } = c2mChart(c2mOptions);
367
370
  /* istanbul-ignore-next */
368
371
  if (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chartjs-plugin-chart2music",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Chart.js plugin for Chart2Music. Turns chart.js charts into music so the blind can hear data.",
6
6
  "main": "dist/plugin.js",
@@ -44,8 +44,8 @@
44
44
  "@babel/preset-env": "^7.23.9",
45
45
  "@rollup/plugin-typescript": "11.1.6",
46
46
  "@sgratzl/chartjs-chart-boxplot": "4.2.8",
47
- "@types/jest": "29.5.11",
48
- "canvas": "2.11.2",
47
+ "@types/jest": "29.5.12",
48
+ "canvas": "^2.11.2",
49
49
  "chartjs-chart-wordcloud": "4.3.3",
50
50
  "chartjs-plugin-a11y-legend": "0.1.1",
51
51
  "cross-env": "7.0.3",
@@ -53,14 +53,14 @@
53
53
  "jest": "29.7.0",
54
54
  "jest-environment-jsdom": "29.7.0",
55
55
  "rimraf": "5.0.5",
56
- "rollup": "4.9.6",
56
+ "rollup": "4.12.0",
57
57
  "ts-jest": "29.1.2",
58
58
  "tslib": "2.6.2",
59
59
  "typescript": "5.3.3",
60
- "vite": "5.0.12"
60
+ "vite": "5.1.4"
61
61
  },
62
62
  "dependencies": {
63
63
  "chart.js": "4.4.1",
64
- "chart2music": "1.13.0"
64
+ "chart2music": "1.15.1"
65
65
  }
66
66
  }