New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chartjs-chart-matrix

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartjs-chart-matrix - npm Package Compare versions

Comparing version 1.3.0 to 2.0.0

97

dist/chartjs-chart-matrix.esm.js
/*!
* chartjs-chart-matrix v1.3.0
* chartjs-chart-matrix v2.0.0
* https://chartjs-chart-matrix.pages.dev/
* (c) 2022 Jukka Kurkela
* (c) 2023 Jukka Kurkela
* Released under the MIT license

@@ -10,5 +10,37 @@ */

var version = "1.3.0";
var version = "2.0.0";
class MatrixController extends DatasetController {
static id = 'matrix';
static version = version;
static defaults = {
dataElementType: 'matrix',
animations: {
numbers: {
type: 'number',
properties: ['x', 'y', 'width', 'height']
}
},
};
static overrides = {
interaction: {
mode: 'nearest',
intersect: true
},
scales: {
x: {
type: 'linear',
offset: true
},
y: {
type: 'linear',
reverse: true
}
},
};
initialize() {

@@ -83,35 +115,2 @@ this.enableOptionSharing = true;

MatrixController.id = 'matrix';
MatrixController.version = version;
MatrixController.defaults = {
dataElementType: 'matrix',
animations: {
numbers: {
type: 'number',
properties: ['x', 'y', 'width', 'height']
}
},
};
MatrixController.overrides = {
interaction: {
mode: 'nearest',
intersect: true
},
scales: {
x: {
type: 'linear',
offset: true
},
y: {
type: 'linear',
reverse: true
}
},
};
/**

@@ -187,2 +186,16 @@ * Helper function to get the bounds of the rect

class MatrixElement extends Element {
static id = 'matrix';
static defaults = {
backgroundColor: undefined,
borderColor: undefined,
borderWidth: undefined,
borderRadius: 0,
anchorX: 'center',
anchorY: 'center',
width: 20,
height: 20
};
constructor(cfg) {

@@ -254,14 +267,2 @@ super();

MatrixElement.id = 'matrix';
MatrixElement.defaults = {
backgroundColor: undefined,
borderColor: undefined,
borderWidth: undefined,
borderRadius: 0,
anchorX: 'center',
anchorY: 'center',
width: 20,
height: 20
};
export { MatrixController, MatrixElement };
/*!
* chartjs-chart-matrix v1.3.0
* chartjs-chart-matrix v2.0.0
* https://chartjs-chart-matrix.pages.dev/
* (c) 2022 Jukka Kurkela
* (c) 2023 Jukka Kurkela
* Released under the MIT license

@@ -13,5 +13,37 @@ */

var version = "1.3.0";
var version = "2.0.0";
class MatrixController extends Chart.DatasetController {
static id = 'matrix';
static version = version;
static defaults = {
dataElementType: 'matrix',
animations: {
numbers: {
type: 'number',
properties: ['x', 'y', 'width', 'height']
}
},
};
static overrides = {
interaction: {
mode: 'nearest',
intersect: true
},
scales: {
x: {
type: 'linear',
offset: true
},
y: {
type: 'linear',
reverse: true
}
},
};
initialize() {

@@ -86,35 +118,2 @@ this.enableOptionSharing = true;

MatrixController.id = 'matrix';
MatrixController.version = version;
MatrixController.defaults = {
dataElementType: 'matrix',
animations: {
numbers: {
type: 'number',
properties: ['x', 'y', 'width', 'height']
}
},
};
MatrixController.overrides = {
interaction: {
mode: 'nearest',
intersect: true
},
scales: {
x: {
type: 'linear',
offset: true
},
y: {
type: 'linear',
reverse: true
}
},
};
/**

@@ -190,2 +189,16 @@ * Helper function to get the bounds of the rect

class MatrixElement extends Chart.Element {
static id = 'matrix';
static defaults = {
backgroundColor: undefined,
borderColor: undefined,
borderWidth: undefined,
borderRadius: 0,
anchorX: 'center',
anchorY: 'center',
width: 20,
height: 20
};
constructor(cfg) {

@@ -257,16 +270,4 @@ super();

MatrixElement.id = 'matrix';
MatrixElement.defaults = {
backgroundColor: undefined,
borderColor: undefined,
borderWidth: undefined,
borderRadius: 0,
anchorX: 'center',
anchorY: 'center',
width: 20,
height: 20
};
Chart.register(MatrixController, MatrixElement);
}));
/*!
* chartjs-chart-matrix v1.3.0
* chartjs-chart-matrix v2.0.0
* https://chartjs-chart-matrix.pages.dev/
* (c) 2022 Jukka Kurkela
* (c) 2023 Jukka Kurkela
* Released under the MIT license
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("chart.js"),require("chart.js/helpers")):"function"==typeof define&&define.amd?define(["chart.js","chart.js/helpers"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Chart,t.Chart.helpers)}(this,(function(t,e){"use strict";class i extends t.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,i,o){const s=this,h="reset"===o,{xScale:a,yScale:d}=s._cachedMeta,l=s.resolveDataElementOptions(e,o),u=s.getSharedOptions(o,t[e],l);for(let l=e;l<e+i;l++){const e=!h&&s.getParsed(l),i=h?a.getBasePixel():a.getPixelForValue(e.x),u=h?d.getBasePixel():d.getPixelForValue(e.y),c=s.resolveDataElementOptions(l,o),{width:g,height:p,anchorX:f,anchorY:x}=c,y={x:r(f,i,g),y:n(x,u,p),width:g,height:p,options:c};s.updateElement(t[l],l,y,o)}s.updateSharedOptions(u,o)}draw(){const t=this,e=t.getMeta().data||[];let i,r;for(i=0,r=e.length;i<r;++i)e[i].draw(t._ctx)}}function r(t,e,i){return"left"===t||"start"===t?e:"right"===t||"end"===t?e-i:e-i/2}function n(t,e,i){return"top"===t||"start"===t?e:"bottom"===t||"end"===t?e-i:e-i/2}function o(t,e){const{x:i,y:r,width:n,height:o}=t.getProps(["x","y","width","height"],e);return{left:i,top:r,right:i+n,bottom:r+o}}function s(t,e,i){return Math.max(Math.min(t,i),e)}function h(t){const i=o(t),r=i.right-i.left,n=i.bottom-i.top,h=function(t,i,r){const n=t.options.borderWidth;let o,h,a,d;return e.isObject(n)?(o=+n.top||0,h=+n.right||0,a=+n.bottom||0,d=+n.left||0):o=h=a=d=+n||0,{t:s(o,0,r),r:s(h,0,i),b:s(a,0,r),l:s(d,0,i)}}(t,r/2,n/2);return{outer:{x:i.left,y:i.top,w:r,h:n},inner:{x:i.left+h.l,y:i.top+h.t,w:r-h.l-h.r,h:n-h.t-h.b}}}function a(t,e,i,r){const n=null===e,s=null===i,h=!(!t||n&&s)&&o(t,r);return h&&(n||e>=h.left&&e<=h.right)&&(s||i>=h.top&&i<=h.bottom)}i.id="matrix",i.version="1.3.0",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 t.Element{constructor(t){super(),this.options=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const i=this.options,{inner:r,outer:n}=h(this),o=e.toTRBLCorners(i.borderRadius);t.save(),n.w!==r.w||n.h!==r.h?(t.beginPath(),e.addRoundedRectPath(t,{x:n.x,y:n.y,w:n.w,h:n.h,radius:o}),e.addRoundedRectPath(t,{x:r.x,y:r.y,w:r.w,h:r.h,radius:o}),t.fillStyle=i.backgroundColor,t.fill(),t.fillStyle=i.borderColor,t.fill("evenodd")):(t.beginPath(),e.addRoundedRectPath(t,{x:r.x,y:r.y,w:r.w,h:r.h,radius:o}),t.fillStyle=i.backgroundColor,t.fill()),t.restore()}inRange(t,e,i){return a(this,t,e,i)}inXRange(t,e){return a(this,t,null,e)}inYRange(t,e){return a(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,width:r,height:n}=this.getProps(["x","y","width","height"],t);return{x:e+r/2,y:i+n/2}}tooltipPosition(){return this.getCenterPoint()}getRange(t){return"x"===t?this.width/2:this.height/2}}d.id="matrix",d.defaults={backgroundColor:void 0,borderColor:void 0,borderWidth:void 0,borderRadius:0,anchorX:"center",anchorY:"center",width:20,height:20},t.register(i,d)}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("chart.js"),require("chart.js/helpers")):"function"==typeof define&&define.amd?define(["chart.js","chart.js/helpers"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Chart,t.Chart.helpers)}(this,(function(t,e){"use strict";class i extends t.DatasetController{static id="matrix";static version="2.0.0";static defaults={dataElementType:"matrix",animations:{numbers:{type:"number",properties:["x","y","width","height"]}}};static overrides={interaction:{mode:"nearest",intersect:!0},scales:{x:{type:"linear",offset:!0},y:{type:"linear",reverse:!0}}};initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,o){const s=this,a="reset"===o,{xScale:h,yScale:d}=s._cachedMeta,l=s.resolveDataElementOptions(e,o),c=s.getSharedOptions(o,t[e],l);for(let l=e;l<e+i;l++){const e=!a&&s.getParsed(l),i=a?h.getBasePixel():h.getPixelForValue(e.x),c=a?d.getBasePixel():d.getPixelForValue(e.y),u=s.resolveDataElementOptions(l,o),{width:g,height:p,anchorX:f,anchorY:x}=u,y={x:r(f,i,g),y:n(x,c,p),width:g,height:p,options:u};s.updateElement(t[l],l,y,o)}s.updateSharedOptions(c,o)}draw(){const t=this,e=t.getMeta().data||[];let i,r;for(i=0,r=e.length;i<r;++i)e[i].draw(t._ctx)}}function r(t,e,i){return"left"===t||"start"===t?e:"right"===t||"end"===t?e-i:e-i/2}function n(t,e,i){return"top"===t||"start"===t?e:"bottom"===t||"end"===t?e-i:e-i/2}function o(t,e){const{x:i,y:r,width:n,height:o}=t.getProps(["x","y","width","height"],e);return{left:i,top:r,right:i+n,bottom:r+o}}function s(t,e,i){return Math.max(Math.min(t,i),e)}function a(t){const i=o(t),r=i.right-i.left,n=i.bottom-i.top,a=function(t,i,r){const n=t.options.borderWidth;let o,a,h,d;return e.isObject(n)?(o=+n.top||0,a=+n.right||0,h=+n.bottom||0,d=+n.left||0):o=a=h=d=+n||0,{t:s(o,0,r),r:s(a,0,i),b:s(h,0,r),l:s(d,0,i)}}(t,r/2,n/2);return{outer:{x:i.left,y:i.top,w:r,h:n},inner:{x:i.left+a.l,y:i.top+a.t,w:r-a.l-a.r,h:n-a.t-a.b}}}function h(t,e,i,r){const n=null===e,s=null===i,a=!(!t||n&&s)&&o(t,r);return a&&(n||e>=a.left&&e<=a.right)&&(s||i>=a.top&&i<=a.bottom)}class d extends t.Element{static id="matrix";static defaults={backgroundColor:void 0,borderColor:void 0,borderWidth:void 0,borderRadius:0,anchorX:"center",anchorY:"center",width:20,height:20};constructor(t){super(),this.options=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const i=this.options,{inner:r,outer:n}=a(this),o=e.toTRBLCorners(i.borderRadius);t.save(),n.w!==r.w||n.h!==r.h?(t.beginPath(),e.addRoundedRectPath(t,{x:n.x,y:n.y,w:n.w,h:n.h,radius:o}),e.addRoundedRectPath(t,{x:r.x,y:r.y,w:r.w,h:r.h,radius:o}),t.fillStyle=i.backgroundColor,t.fill(),t.fillStyle=i.borderColor,t.fill("evenodd")):(t.beginPath(),e.addRoundedRectPath(t,{x:r.x,y:r.y,w:r.w,h:r.h,radius:o}),t.fillStyle=i.backgroundColor,t.fill()),t.restore()}inRange(t,e,i){return h(this,t,e,i)}inXRange(t,e){return h(this,t,null,e)}inYRange(t,e){return h(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,width:r,height:n}=this.getProps(["x","y","width","height"],t);return{x:e+r/2,y:i+n/2}}tooltipPosition(){return this.getCenterPoint()}getRange(t){return"x"===t?this.width/2:this.height/2}}t.register(i,d)}));
//# sourceMappingURL=chartjs-chart-matrix.min.js.map
{
"name": "chartjs-chart-matrix",
"version": "1.3.0",
"version": "2.0.0",
"description": "Chart.js module for creating matrix charts",
"main": "dist/chartjs-chart-matrix.js",
"module": "dist/chartjs-chart-matrix.esm.js",
"type": "module",
"main": "dist/chartjs-chart-matrix.esm.js",
"types": "types/index.esm.d.ts",
"jsdelivr": "dist/chartjs-chart-matrix.min.js",
"unpkg": "dist/chartjs-chart-matrix.min.js",
"exports": {
"types": "./types/index.esm.d.ts",
"import": "./dist/chartjs-chart-matrix.esm.js",
"require": "./dist/chartjs-chart-matrix.min.js"
},
"sideEffects": [
"dist/chartjs-chart-matrix.js",
"dist/chartjs-chart-matrix-min.js"
],
"scripts": {
"autobuild": "rollup -c -w",
"build": "rollup -c",
"dev": "karma start --no-signle-run --auto-watch --browsers chrome",
"dev": "karma start ./karma.conf.cjs --no-signle-run --auto-watch --browsers chrome",
"docs": "npm run build && vuepress build docs --no-cache",

@@ -20,3 +31,3 @@ "docs:dev": "npm run build && vuepress dev docs --no-cache",

"test-lint": "npm run lint",
"test-karma": "karma start --auto-watch --single-run"
"test-karma": "karma start ./karma.conf.cjs --auto-watch --single-run"
},

@@ -34,2 +45,3 @@ "repository": {

"dist/*",
"!dist/docs/**",
"types/index.esm.d.ts"

@@ -44,4 +56,2 @@ ],

"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-commonjs": "^23.0.2",

@@ -53,3 +63,2 @@ "@rollup/plugin-json": "^5.0.1",

"@typescript-eslint/parser": "^5.6.0",
"babel-loader": "^8.3.0",
"chart.js": "^4.0.1",

@@ -74,3 +83,3 @@ "chartjs-adapter-date-fns": "^2.0.0",

"karma-rollup-preprocessor": "7.0.7",
"karma-spec-reporter": "^0.0.34",
"karma-spec-reporter": "^0.0.35",
"pixelmatch": "^5.2.1",

@@ -84,4 +93,3 @@ "rollup": "^3.3.0",

"vuepress-plugin-redirect": "^1.2.5",
"vuepress-theme-chartjs": "^0.2.0",
"webpack": "^4.46.0"
"vuepress-theme-chartjs": "^0.2.0"
},

@@ -88,0 +96,0 @@ "peerDependencies": {

# chartjs-chart-matrix
[Chart.js](https://www.chartjs.org/) **v3.0.0** module for creating matrix charts
[Chart.js](https://www.chartjs.org/) **v3+, v4+** module for creating matrix charts

@@ -18,3 +18,3 @@ [![npm](https://img.shields.io/npm/v/chartjs-chart-matrix.svg)](https://www.npmjs.com/package/chartjs-chart-matrix)

You can find documentation for chartjs-chart-treemap at [https://chartjs-chart-matrix.pages.dev/](https://chartjs-chart-matrix.pages.dev/).
You can find documentation for chartjs-chart-matrix at [https://chartjs-chart-matrix.pages.dev/](https://chartjs-chart-matrix.pages.dev/).

@@ -21,0 +21,0 @@ ## Quickstart

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc