@oliasoft-open-source/charts-library 5.3.0 → 5.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19797,14 +19797,20 @@ var wrapText = (words, maxWidth, ctx) => {
19797
19797
  var renderWrappedText = (ctx, options) => {
19798
19798
  if (!ctx) return;
19799
19799
  const { text, maxWidth, fontSize, lineHeight, x, y, position } = options ?? {};
19800
- const wrappedLines = wrapText(getWords(text), maxWidth, ctx);
19800
+ let lines = [];
19801
+ if (Array.isArray(text)) text.forEach((item) => {
19802
+ const wrapped = wrapText(getWords(item), maxWidth, ctx);
19803
+ lines.push(...wrapped);
19804
+ });
19805
+ else if (typeof text === "string") lines = wrapText(getWords(text), maxWidth, ctx);
19806
+ if (!lines.length) return;
19801
19807
  ctx?.save?.();
19802
19808
  ctx.font = `${fontSize}px Arial`;
19803
19809
  ctx.fillStyle = SEMI_TRANSPARENT;
19804
19810
  ctx.textAlign = getTextAlign(position);
19805
19811
  drawText({
19806
19812
  ctx,
19807
- lines: wrappedLines,
19813
+ lines,
19808
19814
  lineHeight,
19809
19815
  x,
19810
19816
  y,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "resolutions": {