chartjs-chart-matrix 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * chartjs-chart-matrix v0.0.0-development
3
3
  * https://chartjs-chart-matrix.pages.dev/
4
- * (c) 2025 Jukka Kurkela
4
+ * (c) 2026 Jukka Kurkela
5
5
  * Released under the MIT license
6
6
  */
7
7
  (function (global, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * chartjs-chart-matrix v0.0.0-development
3
3
  * https://chartjs-chart-matrix.pages.dev/
4
- * (c) 2025 Jukka Kurkela
4
+ * (c) 2026 Jukka Kurkela
5
5
  * Released under the MIT license
6
6
  */
7
7
  import { DatasetController, Element } from 'chart.js';
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * chartjs-chart-matrix v0.0.0-development
3
3
  * https://chartjs-chart-matrix.pages.dev/
4
- * (c) 2025 Jukka Kurkela
4
+ * (c) 2026 Jukka Kurkela
5
5
  * Released under the MIT license
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("chart.js"),require("chart.js/helpers")):"function"==typeof define&&define.amd?define(["exports","chart.js","chart.js/helpers"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["chartjs-chart-matrix"]={},t.Chart,t.Chart.helpers)}(this,(function(t,e,r){"use strict";class i extends e.DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,r,i){const s="reset"===i,{xScale:a,yScale:h}=this._cachedMeta,l=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(l);for(let l=e;l<e+r;l++){const e=!s&&this.getParsed(l),r=s?a.getBasePixel():a.getPixelForValue(e.x),d=s?h.getBasePixel():h.getPixelForValue(e.y),u=this.resolveDataElementOptions(l,i),{width:c,height:g,anchorX:p,anchorY:f}=u,x={x:n(p,r,c),y:o(f,d,g),width:c,height:g,options:u};this.updateElement(t[l],l,x,i)}this.updateSharedOptions(d,i,l)}draw(){const t=this.chart.ctx,e=this.getMeta().data||[];let r,i;for(r=0,i=e.length;r<i;++r)e[r].draw(t)}}function n(t,e,r){return"left"===t||"start"===t?e:"right"===t||"end"===t?e-r:e-r/2}function o(t,e,r){return"top"===t||"start"===t?e:"bottom"===t||"end"===t?e-r:e-r/2}function s(t,e){const{x:r,y:i,width:n,height:o}=t.getProps(["x","y","width","height"],e);return{left:r,top:i,right:r+n,bottom:i+o}}function a(t,e,r){return Math.max(Math.min(t,r),e)}function h(t){const e=s(t,!1),i=e.right-e.left,n=e.bottom-e.top,o=function(t,e,i){const n=t.borderWidth;let o,s,h,l;return r.isObject(n)?(o=+n.top||0,s=+n.right||0,h=+n.bottom||0,l=+n.left||0):o=s=h=l=+n||0,{t:a(o,0,i),r:a(s,0,e),b:a(h,0,i),l:a(l,0,e)}}(t.options,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:n-o.t-o.b}}}function l(t,e,r,i){const n=null===e,o=null===r,a=!(!t||n&&o)&&s(t,i);return a&&(n||e>=a.left&&e<=a.right)&&(o||r>=a.top&&r<=a.bottom)}i.id="matrix",i.version="0.0.0-development",i.defaults={dataElementType:"matrix",animations:{numbers:{type:"number",properties:["x","y","width","height"]}}},i.overrides={interaction:{mode:"nearest",intersect:!0},scales:{x:{type:"linear",offset:!0},y:{type:"linear",reverse:!0}}};class d extends e.Element{draw(t){const e=this.options,{inner:i,outer:n}=h(this),o=r.toTRBLCorners(e.borderRadius);t.save(),n.w!==i.w||n.h!==i.h?(t.beginPath(),r.addRoundedRectPath(t,{x:n.x,y:n.y,w:n.w,h:n.h,radius:o}),r.addRoundedRectPath(t,{x:i.x,y:i.y,w:i.w,h:i.h,radius:o}),t.fillStyle=e.backgroundColor,t.fill(),t.fillStyle=e.borderColor,t.fill("evenodd")):(t.beginPath(),r.addRoundedRectPath(t,{x:i.x,y:i.y,w:i.w,h:i.h,radius:o}),t.fillStyle=e.backgroundColor,t.fill()),t.restore()}inRange(t,e,r){return l(this,t,e,r)}inXRange(t,e){return l(this,t,null,e)}inYRange(t,e){return l(this,null,t,e)}getCenterPoint(t){const{x:e,y:r,width:i,height:n}=this.getProps(["x","y","width","height"],t);return{x:e+i/2,y:r+n/2}}tooltipPosition(){return this.getCenterPoint()}getRange(t){return"x"===t?this.width/2:this.height/2}constructor(t){super(),t&&Object.assign(this,t)}}d.id="matrix",d.defaults={backgroundColor:void 0,borderColor:void 0,borderWidth:void 0,borderRadius:0,anchorX:"center",anchorY:"center",width:20,height:20},e.Chart.register(i,d),t.MatrixController=i,t.MatrixElement=d}));
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("chart.js"),require("chart.js/helpers")):"function"==typeof define&&define.amd?define(["exports","chart.js","chart.js/helpers"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["chartjs-chart-matrix"]={},t.Chart,t.Chart.helpers)}(this,function(t,e,r){"use strict";class i extends e.DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,r,i){const s="reset"===i,{xScale:a,yScale:h}=this._cachedMeta,l=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(l);for(let l=e;l<e+r;l++){const e=!s&&this.getParsed(l),r=s?a.getBasePixel():a.getPixelForValue(e.x),d=s?h.getBasePixel():h.getPixelForValue(e.y),u=this.resolveDataElementOptions(l,i),{width:c,height:g,anchorX:p,anchorY:f}=u,x={x:n(p,r,c),y:o(f,d,g),width:c,height:g,options:u};this.updateElement(t[l],l,x,i)}this.updateSharedOptions(d,i,l)}draw(){const t=this.chart.ctx,e=this.getMeta().data||[];let r,i;for(r=0,i=e.length;r<i;++r)e[r].draw(t)}}function n(t,e,r){return"left"===t||"start"===t?e:"right"===t||"end"===t?e-r:e-r/2}function o(t,e,r){return"top"===t||"start"===t?e:"bottom"===t||"end"===t?e-r:e-r/2}function s(t,e){const{x:r,y:i,width:n,height:o}=t.getProps(["x","y","width","height"],e);return{left:r,top:i,right:r+n,bottom:i+o}}function a(t,e,r){return Math.max(Math.min(t,r),e)}function h(t){const e=s(t,!1),i=e.right-e.left,n=e.bottom-e.top,o=function(t,e,i){const n=t.borderWidth;let o,s,h,l;return r.isObject(n)?(o=+n.top||0,s=+n.right||0,h=+n.bottom||0,l=+n.left||0):o=s=h=l=+n||0,{t:a(o,0,i),r:a(s,0,e),b:a(h,0,i),l:a(l,0,e)}}(t.options,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:n-o.t-o.b}}}function l(t,e,r,i){const n=null===e,o=null===r,a=!(!t||n&&o)&&s(t,i);return a&&(n||e>=a.left&&e<=a.right)&&(o||r>=a.top&&r<=a.bottom)}i.id="matrix",i.version="0.0.0-development",i.defaults={dataElementType:"matrix",animations:{numbers:{type:"number",properties:["x","y","width","height"]}}},i.overrides={interaction:{mode:"nearest",intersect:!0},scales:{x:{type:"linear",offset:!0},y:{type:"linear",reverse:!0}}};class d extends e.Element{draw(t){const e=this.options,{inner:i,outer:n}=h(this),o=r.toTRBLCorners(e.borderRadius);t.save(),n.w!==i.w||n.h!==i.h?(t.beginPath(),r.addRoundedRectPath(t,{x:n.x,y:n.y,w:n.w,h:n.h,radius:o}),r.addRoundedRectPath(t,{x:i.x,y:i.y,w:i.w,h:i.h,radius:o}),t.fillStyle=e.backgroundColor,t.fill(),t.fillStyle=e.borderColor,t.fill("evenodd")):(t.beginPath(),r.addRoundedRectPath(t,{x:i.x,y:i.y,w:i.w,h:i.h,radius:o}),t.fillStyle=e.backgroundColor,t.fill()),t.restore()}inRange(t,e,r){return l(this,t,e,r)}inXRange(t,e){return l(this,t,null,e)}inYRange(t,e){return l(this,null,t,e)}getCenterPoint(t){const{x:e,y:r,width:i,height:n}=this.getProps(["x","y","width","height"],t);return{x:e+i/2,y:r+n/2}}tooltipPosition(){return this.getCenterPoint()}getRange(t){return"x"===t?this.width/2:this.height/2}constructor(t){super(),t&&Object.assign(this,t)}}d.id="matrix",d.defaults={backgroundColor:void 0,borderColor:void 0,borderWidth:void 0,borderRadius:0,anchorX:"center",anchorY:"center",width:20,height:20},e.Chart.register(i,d),t.MatrixController=i,t.MatrixElement=d});
8
8
  //# sourceMappingURL=chartjs-chart-matrix.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chartjs-chart-matrix.min.js","sources":["../src/controller.ts","../src/helpers.ts","../src/element.ts","../src/index.ts"],"sourcesContent":["import { DatasetController, UpdateMode } from 'chart.js'\nimport { AnchorX, AnchorY, MatrixControllerDatasetOptions, MatrixDataPoint } from 'types/index.esm'\n\nimport { version } from '../package.json'\n\nimport MatrixElement from './element'\n\nexport default class MatrixController extends DatasetController<\n 'matrix',\n MatrixElement,\n MatrixElement,\n MatrixDataPoint\n> {\n static readonly id = 'matrix'\n static readonly version = version\n\n static readonly defaults = {\n dataElementType: 'matrix',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height'],\n },\n },\n }\n\n static readonly overrides = {\n interaction: {\n mode: 'nearest',\n intersect: true,\n },\n scales: {\n x: {\n type: 'linear',\n offset: true,\n },\n y: {\n type: 'linear',\n reverse: true,\n },\n },\n }\n\n options: MatrixControllerDatasetOptions\n\n override initialize() {\n this.enableOptionSharing = true\n super.initialize()\n }\n\n override update(mode: UpdateMode) {\n const meta = this._cachedMeta\n\n this.updateElements(meta.data, 0, meta.data.length, mode)\n }\n\n override updateElements(rects: MatrixElement[], start: number, count: number, mode: UpdateMode) {\n const reset = mode === 'reset'\n const { xScale, yScale } = this._cachedMeta\n const firstOpts = this.resolveDataElementOptions(start, mode)\n const sharedOptions = this.getSharedOptions(firstOpts)\n\n for (let i = start; i < start + count; i++) {\n const parsed = !reset && this.getParsed(i)\n const x = reset ? xScale.getBasePixel() : xScale.getPixelForValue(parsed.x)\n const y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(parsed.y)\n const options = this.resolveDataElementOptions(i, mode)\n const { width, height, anchorX, anchorY } = options\n const properties = {\n x: resolveX(anchorX, x, width),\n y: resolveY(anchorY, y, height),\n width,\n height,\n options,\n }\n this.updateElement(rects[i], i, properties, mode)\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts)\n }\n\n override draw() {\n const ctx = this.chart.ctx\n const data = this.getMeta().data || []\n let i: number, ilen: number\n\n for (i = 0, ilen = data.length; i < ilen; ++i) {\n data[i].draw(ctx)\n }\n }\n}\n\nfunction resolveX(anchorX: AnchorX, x: number, width: number) {\n if (anchorX === 'left' || anchorX === 'start') {\n return x\n }\n if (anchorX === 'right' || anchorX === 'end') {\n return x - width\n }\n return x - width / 2\n}\n\nfunction resolveY(anchorY: AnchorY, y: number, height: number) {\n if (anchorY === 'top' || anchorY === 'start') {\n return y\n }\n if (anchorY === 'bottom' || anchorY === 'end') {\n return y - height\n }\n return y - height / 2\n}\n","import { isObject } from 'chart.js/helpers'\nimport { MatrixOptions } from 'types/index.esm'\n\nimport MatrixElement from './element'\n\ntype Bounds = { left: number; top: number; right: number; bottom: number }\n\nfunction getBounds(element: MatrixElement, useFinalPosition: boolean): Bounds {\n const { x, y, width, height } = element.getProps(['x', 'y', 'width', 'height'], useFinalPosition)\n return { left: x, top: y, right: x + width, bottom: y + height }\n}\n\nfunction limit(value: number, min: number, max: number) {\n return Math.max(Math.min(value, max), min)\n}\n\nexport function parseBorderWidth(options: Pick<MatrixOptions, 'borderWidth'>, maxW: number, maxH: number) {\n const value = options.borderWidth\n let t: number, r: number, b: number, l: number\n\n if (isObject(value)) {\n t = +value.top || 0\n r = +value.right || 0\n b = +value.bottom || 0\n l = +value.left || 0\n } else {\n t = r = b = l = +value || 0\n }\n\n return {\n t: limit(t, 0, maxH),\n r: limit(r, 0, maxW),\n b: limit(b, 0, maxH),\n l: limit(l, 0, maxW),\n }\n}\n\nexport function boundingRects(element: MatrixElement) {\n const bounds = getBounds(element, false)\n const width = bounds.right - bounds.left\n const height = bounds.bottom - bounds.top\n const border = parseBorderWidth(element.options, width / 2, height / 2)\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n },\n }\n}\n\nexport function inRange(element: MatrixElement, x: number, y: number, useFinalPosition: boolean) {\n const skipX = x === null\n const skipY = y === null\n const bounds = !element || (skipX && skipY) ? false : getBounds(element, useFinalPosition)\n\n return (\n bounds && (skipX || (x >= bounds.left && x <= bounds.right)) && (skipY || (y >= bounds.top && y <= bounds.bottom))\n )\n}\n","import { Element } from 'chart.js'\nimport { addRoundedRectPath, toTRBLCorners } from 'chart.js/helpers'\nimport { MatrixOptions, MatrixProps } from 'types/index.esm'\n\nimport { boundingRects, inRange } from './helpers'\n\nexport default class MatrixElement extends Element<MatrixProps, MatrixOptions> {\n static readonly id = 'matrix'\n\n static override readonly defaults = {\n backgroundColor: undefined,\n borderColor: undefined,\n borderWidth: undefined,\n borderRadius: 0,\n anchorX: 'center',\n anchorY: 'center',\n width: 20,\n height: 20,\n }\n\n width: number\n height: number\n\n constructor(cfg: MatrixProps) {\n super()\n\n if (cfg) {\n Object.assign(this, cfg)\n }\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const options = this.options\n const { inner, outer } = boundingRects(this)\n const radius = toTRBLCorners(options.borderRadius)\n\n ctx.save()\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath()\n addRoundedRectPath(ctx, { x: outer.x, y: outer.y, w: outer.w, h: outer.h, radius })\n addRoundedRectPath(ctx, { x: inner.x, y: inner.y, w: inner.w, h: inner.h, radius })\n ctx.fillStyle = options.backgroundColor\n ctx.fill()\n ctx.fillStyle = options.borderColor\n ctx.fill('evenodd')\n } else {\n ctx.beginPath()\n addRoundedRectPath(ctx, { x: inner.x, y: inner.y, w: inner.w, h: inner.h, radius })\n ctx.fillStyle = options.backgroundColor\n ctx.fill()\n }\n\n ctx.restore()\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, mouseY, useFinalPosition)\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, null, useFinalPosition)\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, null, mouseY, useFinalPosition)\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const { x, y, width, height } = this.getProps(['x', 'y', 'width', 'height'], useFinalPosition)\n return {\n x: x + width / 2,\n y: y + height / 2,\n }\n }\n\n override tooltipPosition() {\n return this.getCenterPoint()\n }\n\n getRange(axis: 'x' | 'y') {\n return axis === 'x' ? this.width / 2 : this.height / 2\n }\n}\n","import { Chart } from 'chart.js'\n\nimport MatrixController from './controller.js'\nimport MatrixElement from './element.js'\n\nChart.register(MatrixController, MatrixElement)\n\nexport { MatrixController, MatrixElement }\n"],"names":["MatrixController","DatasetController","initialize","this","enableOptionSharing","super","update","mode","meta","_cachedMeta","updateElements","data","length","rects","start","count","reset","xScale","yScale","firstOpts","resolveDataElementOptions","sharedOptions","getSharedOptions","i","parsed","getParsed","x","getBasePixel","getPixelForValue","y","options","width","height","anchorX","anchorY","properties","resolveX","resolveY","updateElement","updateSharedOptions","draw","ctx","chart","getMeta","ilen","getBounds","element","useFinalPosition","getProps","left","top","right","bottom","limit","value","min","max","Math","boundingRects","bounds","border","maxW","maxH","borderWidth","t","r","b","l","isObject","parseBorderWidth","outer","w","h","inner","inRange","skipX","skipY","id","version","defaults","dataElementType","animations","numbers","type","overrides","interaction","intersect","scales","offset","reverse","MatrixElement","Element","radius","toTRBLCorners","borderRadius","save","beginPath","addRoundedRectPath","fillStyle","backgroundColor","fill","borderColor","restore","mouseX","mouseY","inXRange","inYRange","getCenterPoint","tooltipPosition","getRange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GAAK,SADFa,EAGMX,SAAW,CAClCoB,qBAAiBgB,EACjBd,iBAAac,EACbpD,iBAAaoD,EACbrB,aAAc,EACd7D,QAAS,SACTC,QAAS,SACTH,MAAO,GACPC,OAAQ,ICZZoF,EAAAA,MAAMC,SAASrH,EAAkB0F"}
1
+ {"version":3,"file":"chartjs-chart-matrix.min.js","sources":["../src/controller.ts","../src/helpers.ts","../src/element.ts","../src/index.ts"],"sourcesContent":["import { DatasetController, UpdateMode } from 'chart.js'\nimport { AnchorX, AnchorY, MatrixControllerDatasetOptions, MatrixDataPoint } from 'types/index.esm'\n\nimport { version } from '../package.json'\n\nimport MatrixElement from './element'\n\nexport default class MatrixController extends DatasetController<\n 'matrix',\n MatrixElement,\n MatrixElement,\n MatrixDataPoint\n> {\n static readonly id = 'matrix'\n static readonly version = version\n\n static readonly defaults = {\n dataElementType: 'matrix',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height'],\n },\n },\n }\n\n static readonly overrides = {\n interaction: {\n mode: 'nearest',\n intersect: true,\n },\n scales: {\n x: {\n type: 'linear',\n offset: true,\n },\n y: {\n type: 'linear',\n reverse: true,\n },\n },\n }\n\n options: MatrixControllerDatasetOptions\n\n override initialize() {\n this.enableOptionSharing = true\n super.initialize()\n }\n\n override update(mode: UpdateMode) {\n const meta = this._cachedMeta\n\n this.updateElements(meta.data, 0, meta.data.length, mode)\n }\n\n override updateElements(rects: MatrixElement[], start: number, count: number, mode: UpdateMode) {\n const reset = mode === 'reset'\n const { xScale, yScale } = this._cachedMeta\n const firstOpts = this.resolveDataElementOptions(start, mode)\n const sharedOptions = this.getSharedOptions(firstOpts)\n\n for (let i = start; i < start + count; i++) {\n const parsed = !reset && this.getParsed(i)\n const x = reset ? xScale.getBasePixel() : xScale.getPixelForValue(parsed.x)\n const y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(parsed.y)\n const options = this.resolveDataElementOptions(i, mode)\n const { width, height, anchorX, anchorY } = options\n const properties = {\n x: resolveX(anchorX, x, width),\n y: resolveY(anchorY, y, height),\n width,\n height,\n options,\n }\n this.updateElement(rects[i], i, properties, mode)\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts)\n }\n\n override draw() {\n const ctx = this.chart.ctx\n const data = this.getMeta().data || []\n let i: number, ilen: number\n\n for (i = 0, ilen = data.length; i < ilen; ++i) {\n data[i].draw(ctx)\n }\n }\n}\n\nfunction resolveX(anchorX: AnchorX, x: number, width: number) {\n if (anchorX === 'left' || anchorX === 'start') {\n return x\n }\n if (anchorX === 'right' || anchorX === 'end') {\n return x - width\n }\n return x - width / 2\n}\n\nfunction resolveY(anchorY: AnchorY, y: number, height: number) {\n if (anchorY === 'top' || anchorY === 'start') {\n return y\n }\n if (anchorY === 'bottom' || anchorY === 'end') {\n return y - height\n }\n return y - height / 2\n}\n","import { isObject } from 'chart.js/helpers'\nimport { MatrixOptions } from 'types/index.esm'\n\nimport MatrixElement from './element'\n\ntype Bounds = { left: number; top: number; right: number; bottom: number }\n\nfunction getBounds(element: MatrixElement, useFinalPosition: boolean): Bounds {\n const { x, y, width, height } = element.getProps(['x', 'y', 'width', 'height'], useFinalPosition)\n return { left: x, top: y, right: x + width, bottom: y + height }\n}\n\nfunction limit(value: number, min: number, max: number) {\n return Math.max(Math.min(value, max), min)\n}\n\nexport function parseBorderWidth(options: Pick<MatrixOptions, 'borderWidth'>, maxW: number, maxH: number) {\n const value = options.borderWidth\n let t: number, r: number, b: number, l: number\n\n if (isObject(value)) {\n t = +value.top || 0\n r = +value.right || 0\n b = +value.bottom || 0\n l = +value.left || 0\n } else {\n t = r = b = l = +value || 0\n }\n\n return {\n t: limit(t, 0, maxH),\n r: limit(r, 0, maxW),\n b: limit(b, 0, maxH),\n l: limit(l, 0, maxW),\n }\n}\n\nexport function boundingRects(element: MatrixElement) {\n const bounds = getBounds(element, false)\n const width = bounds.right - bounds.left\n const height = bounds.bottom - bounds.top\n const border = parseBorderWidth(element.options, width / 2, height / 2)\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n },\n }\n}\n\nexport function inRange(element: MatrixElement, x: number, y: number, useFinalPosition: boolean) {\n const skipX = x === null\n const skipY = y === null\n const bounds = !element || (skipX && skipY) ? false : getBounds(element, useFinalPosition)\n\n return (\n bounds && (skipX || (x >= bounds.left && x <= bounds.right)) && (skipY || (y >= bounds.top && y <= bounds.bottom))\n )\n}\n","import { Element } from 'chart.js'\nimport { addRoundedRectPath, toTRBLCorners } from 'chart.js/helpers'\nimport { MatrixOptions, MatrixProps } from 'types/index.esm'\n\nimport { boundingRects, inRange } from './helpers'\n\nexport default class MatrixElement extends Element<MatrixProps, MatrixOptions> {\n static readonly id = 'matrix'\n\n static override readonly defaults = {\n backgroundColor: undefined,\n borderColor: undefined,\n borderWidth: undefined,\n borderRadius: 0,\n anchorX: 'center',\n anchorY: 'center',\n width: 20,\n height: 20,\n }\n\n width: number\n height: number\n\n constructor(cfg: MatrixProps) {\n super()\n\n if (cfg) {\n Object.assign(this, cfg)\n }\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const options = this.options\n const { inner, outer } = boundingRects(this)\n const radius = toTRBLCorners(options.borderRadius)\n\n ctx.save()\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath()\n addRoundedRectPath(ctx, { x: outer.x, y: outer.y, w: outer.w, h: outer.h, radius })\n addRoundedRectPath(ctx, { x: inner.x, y: inner.y, w: inner.w, h: inner.h, radius })\n ctx.fillStyle = options.backgroundColor\n ctx.fill()\n ctx.fillStyle = options.borderColor\n ctx.fill('evenodd')\n } else {\n ctx.beginPath()\n addRoundedRectPath(ctx, { x: inner.x, y: inner.y, w: inner.w, h: inner.h, radius })\n ctx.fillStyle = options.backgroundColor\n ctx.fill()\n }\n\n ctx.restore()\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, mouseY, useFinalPosition)\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, null, useFinalPosition)\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, null, mouseY, useFinalPosition)\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const { x, y, width, height } = this.getProps(['x', 'y', 'width', 'height'], useFinalPosition)\n return {\n x: x + width / 2,\n y: y + height / 2,\n }\n }\n\n override tooltipPosition() {\n return this.getCenterPoint()\n }\n\n getRange(axis: 'x' | 'y') {\n return axis === 'x' ? this.width / 2 : this.height / 2\n }\n}\n","import { Chart } from 'chart.js'\n\nimport MatrixController from './controller.js'\nimport MatrixElement from './element.js'\n\nChart.register(MatrixController, MatrixElement)\n\nexport { MatrixController, MatrixElement }\n"],"names":["MatrixController","DatasetController","initialize","this","enableOptionSharing","super","update","mode","meta","_cachedMeta","updateElements","data","length","rects","start","count","reset","xScale","yScale","firstOpts","resolveDataElementOptions","sharedOptions","getSharedOptions","i","parsed","getParsed","x","getBasePixel","getPixelForValue","y","options","width","height","anchorX","anchorY","properties","resolveX","resolveY","updateElement","updateSharedOptions","draw","ctx","chart","getMeta","ilen","getBounds","element","useFinalPosition","getProps","left","top","right","bottom","limit","value","min","max","Math","boundingRects","bounds","border","maxW","maxH","borderWidth","t","r","b","l","isObject","parseBorderWidth","outer","w","h","inner","inRange","skipX","skipY","id","version","defaults","dataElementType","animations","numbers","type","overrides","interaction","intersect","scales","offset","reverse","MatrixElement","Element","radius","toTRBLCorners","borderRadius","save","beginPath","addRoundedRectPath","fillStyle","backgroundColor","fill","borderColor","restore","mouseX","mouseY","inXRange","inYRange","getCenterPoint","tooltipPosition","getRange","axis","constructor","cfg","Object","assign","undefined","Chart","register"],"mappings":";;;;;;wWAOe,MAAMA,UAAyBC,EAAAA,kBAuCnCC,UAAAA,GACPC,KAAKC,qBAAsB,EAC3BC,MAAMH,YACR,CAESI,MAAAA,CAAOC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MC,SAASrH,EAAkB0F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chartjs-chart-matrix",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Chart.js module for creating matrix charts",
5
5
  "type": "module",
6
6
  "main": "dist/chartjs-chart-matrix.cjs",
@@ -56,17 +56,16 @@
56
56
  "homepage": "https://chartjs-chart-matrix.pages.dev/",
57
57
  "devDependencies": {
58
58
  "@eslint/js": "^9.22.0",
59
- "@eslint/markdown": "^6.3.0",
60
59
  "@napi-rs/canvas": "^0.1.30",
61
- "@rollup/plugin-commonjs": "^28.0.1",
60
+ "@rollup/plugin-commonjs": "^29.0.0",
62
61
  "@rollup/plugin-json": "^6.0.0",
63
62
  "@rollup/plugin-node-resolve": "^16.0.1",
64
63
  "@rollup/plugin-swc": "^0.4.0",
65
64
  "@rollup/plugin-terser": "^0.4.4",
66
- "@swc/cli": "^0.6.0",
65
+ "@swc/cli": "^0.7.9",
67
66
  "@swc/core": "^1.11.9",
68
67
  "@types/jasmine": "^5.1.7",
69
- "@types/node": "^22.13.10",
68
+ "@types/node": "^25.0.3",
70
69
  "@typescript-eslint/eslint-plugin": "^8.26.1",
71
70
  "@typescript-eslint/parser": "^8.26.1",
72
71
  "c8": "^10.1.3",
@@ -74,7 +73,7 @@
74
73
  "chartjs-adapter-date-fns": "^3.0.0",
75
74
  "chartjs-test-utils": "^0.5.0",
76
75
  "concurrently": "^9.0.1",
77
- "cross-env": "^7.0.3",
76
+ "cross-env": "^10.1.0",
78
77
  "date-fns": "^2.19.0",
79
78
  "eslint": "^9.22.0",
80
79
  "eslint-config-chartjs": "^0.3.0",
@@ -82,7 +81,7 @@
82
81
  "eslint-plugin-prettier": "^5.2.3",
83
82
  "eslint-plugin-simple-import-sort": "^12.1.1",
84
83
  "eslint-plugin-unused-imports": "^4.1.4",
85
- "globals": "^16.0.0",
84
+ "globals": "^17.0.0",
86
85
  "jasmine": "^5.6.0",
87
86
  "jasmine-core": "^5.1.2",
88
87
  "karma": "^6.2.0",
@@ -97,6 +96,7 @@
97
96
  "rollup-plugin-analyzer": "^4.0.0",
98
97
  "rollup-plugin-cleanup": "^3.2.1",
99
98
  "rollup-plugin-istanbul": "^5.0.0",
99
+ "semantic-release": "^25.0.3",
100
100
  "typescript": "^5.3.3",
101
101
  "vuepress": "^1.9.7",
102
102
  "vuepress-plugin-flexsearch": "^0.3.0",
@@ -27,7 +27,8 @@ export interface MatrixOptions extends Omit<CommonElementOptions, 'borderWidth'>
27
27
  height: number
28
28
  }
29
29
  export interface MatrixControllerDatasetOptions
30
- extends ControllerDatasetOptions,
30
+ extends
31
+ ControllerDatasetOptions,
31
32
  ScriptableAndArrayOptions<MatrixOptions, ScriptableContext<'matrix'>>,
32
33
  ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'matrix'>> {}
33
34
 
@@ -64,8 +65,7 @@ export const MatrixController: ChartComponent & {
64
65
  }
65
66
 
66
67
  export interface MatrixElement<T extends MatrixProps = MatrixProps, O extends MatrixOptions = MatrixOptions>
67
- extends Element<T, O>,
68
- VisualElement {}
68
+ extends Element<T, O>, VisualElement {}
69
69
 
70
70
  export const MatrixElement: ChartComponent & {
71
71
  prototype: MatrixElement