chartjs-chart-wordcloud
Advanced tools
Comparing version 3.0.0-alpha.20 to 3.0.0-beta.1
108
package.json
{ | ||
"name": "chartjs-chart-wordcloud", | ||
"description": "Chart.js module for word clouds", | ||
"version": "3.0.0-alpha.20", | ||
"version": "3.0.0-beta.1", | ||
"author": { | ||
@@ -11,5 +11,5 @@ "name": "Samuel Gratzl", | ||
"license": "MIT", | ||
"homepage": "https://github.com/upsetjs/chartjs-chart-wordcloud", | ||
"homepage": "https://github.com/sgratzl/chartjs-chart-wordcloud", | ||
"bugs": { | ||
"url": "https://github.com/upsetjs/chartjs-chart-wordcloud/issues" | ||
"url": "https://github.com/sgratzl/chartjs-chart-wordcloud/issues" | ||
}, | ||
@@ -23,14 +23,18 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/upsetjs/chartjs-chart-wordcloud.git" | ||
"url": "https://github.com/sgratzl/chartjs-chart-wordcloud.git" | ||
}, | ||
"module": "dist/chartwordcloud.esm.js", | ||
"main": "dist/chartwordcloud.umd.development.js", | ||
"unpkg": "dist/chartwordcloud.umd.production.min.js", | ||
"jsdelivr": "dist/chartwordcloud.umd.production.min.js", | ||
"types": "dist/index.d.ts", | ||
"global": "ChartWordCloud", | ||
"module": "build/index.esm.js", | ||
"main": "build/index.js", | ||
"unpkg": "build/index.umd.min.js", | ||
"jsdelivr": "build/index.umd.min.js", | ||
"types": "build/index.d.ts", | ||
"sideEffects": false, | ||
"files": [ | ||
"dist", | ||
"src" | ||
"build", | ||
"src/**/*.ts" | ||
], | ||
"peerDependencies": { | ||
"chart.js": "^3.0.0-beta" | ||
}, | ||
"browserslist": [ | ||
@@ -41,19 +45,17 @@ "Firefox ESR", | ||
], | ||
"peerDependencies": { | ||
"@sgratzl/chartjs-esm-facade": "^3.0.0-alpha.20", | ||
"chart.js": "^3.0.0-alpha.2" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^14.0.0", | ||
"@sgratzl/chartjs-esm-facade": "^3.0.0-alpha.20", | ||
"@types/d3-selection": "^1.4.2", | ||
"@types/jest": "^26.0.7", | ||
"@rollup/plugin-commonjs": "^15.0.0", | ||
"@rollup/plugin-node-resolve": "^9.0.0", | ||
"@rollup/plugin-replace": "^2.3.3", | ||
"@rollup/plugin-typescript": "^5.0.2", | ||
"@types/jest": "^26.0.12", | ||
"@types/jest-image-snapshot": "^3.1.0", | ||
"@types/node": "^14.0.26", | ||
"@typescript-eslint/eslint-plugin": "^3.7.0", | ||
"@typescript-eslint/parser": "^3.7.0", | ||
"@yarnpkg/pnpify": "^2.1.0", | ||
"@types/node": "^14.6.2", | ||
"@types/seedrandom": "^2.4.28", | ||
"@typescript-eslint/eslint-plugin": "^4.0.1", | ||
"@typescript-eslint/parser": "^4.0.1", | ||
"@yarnpkg/pnpify": "^2.2.1", | ||
"canvas": "^2.6.1", | ||
"chart.js": "^3.0.0-alpha.2", | ||
"eslint": "^7.5.0", | ||
"chart.js": "^3.0.0-beta", | ||
"eslint": "^7.8.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
@@ -65,34 +67,35 @@ "eslint-config-react-app": "^5.2.1", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-react": "^7.20.4", | ||
"eslint-plugin-react-hooks": "^4.0.8", | ||
"jest-environment-jsdom-sixteen": "^1.0.3", | ||
"jest-image-snapshot": "^4.1.0", | ||
"prettier": "^2.0.5", | ||
"release-it": "^13.6.6", | ||
"eslint-plugin-react": "^7.20.6", | ||
"eslint-plugin-react-hooks": "^4.1.0", | ||
"jest": "^26.4.2", | ||
"jest-image-snapshot": "^4.2.0", | ||
"prettier": "^2.1.1", | ||
"release-it": "^13.7.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.23.0", | ||
"rollup": "^2.26.9", | ||
"rollup-plugin-cleanup": "^3.1.1", | ||
"rollup-plugin-dts": "^1.4.9", | ||
"rollup-plugin-pnp-resolve": "^2.0.0", | ||
"tsdx": "~0.13.2", | ||
"tslib": "^2.0.0", | ||
"typedoc": "^0.17.8", | ||
"typescript": "^3.9.7" | ||
"rollup-plugin-dts": "^1.4.12", | ||
"rollup-plugin-terser": "^7.0.1", | ||
"seedrandom": "^3.0.5", | ||
"ts-jest": "^26.3.0", | ||
"tslib": "^2.0.1", | ||
"typedoc": "^0.19.0", | ||
"typescript": "^4.0.2", | ||
"us-atlas": "^3.0.0", | ||
"world-atlas": "^2.0.2" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf dist node_modules \"*.tgz\"", | ||
"clean": "rimraf build node_modules \"*.tgz\"", | ||
"compile": "tsc -p tsconfig.json --noEmit", | ||
"start": "npm run watch", | ||
"watch": "tsdx watch --noClean --name ChartWordCloud --format esm,umd", | ||
"build": "npm run clean && tsdx build --name ChartWordCloud --format esm,umd && npm run typings", | ||
"typings": "rollup -c rollup.dts.config.js", | ||
"test": "tsdx test --passWithNoTests", | ||
"test:watch": "tsdx test --passWithNoTests --watch", | ||
"test:coverage": "tsdx test --passWithNoTests --coverage", | ||
"watch": "rollup -c -w", | ||
"build": "rollup -c", | ||
"test": "jest --passWithNoTests", | ||
"test:watch": "jest --passWithNoTests --watch", | ||
"test:coverage": "jest --passWithNoTests --coverage", | ||
"lint": "npm run eslint && npm run prettier", | ||
"fix": "npm run eslint:fix && npm run prettier:write", | ||
"prettier:impl": "prettier \"*.{md,json,js,yml}\" \"{.github,src,samples}/**\"", | ||
"prettier:write": "npm run prettier:impl -- --write", | ||
"prettier": "npm run prettier:impl -- --check", | ||
"eslint": "tsdx lint src --ext .ts,.tsx", | ||
"prettier:write": "prettier */** --write", | ||
"prettier": "prettier */** --check", | ||
"eslint": "eslint src --ext .ts,.tsx", | ||
"eslint:fix": "npm run eslint -- --fix", | ||
@@ -102,10 +105,9 @@ "docs": "typedoc", | ||
"release": "release-it --disable-metrics --npm.skipChecks", | ||
"release:pre": "release-it --disable-metrics --npm.skipChecks --preRelease=alpha --npm.tag=next" | ||
"release:pre": "release-it --disable-metrics --npm.skipChecks --preRelease=alpha --npm.tag=next", | ||
"release:beta": "release-it --disable-metrics --npm.skipChecks --preRelease=beta --npm.tag=next" | ||
}, | ||
"dependencies": { | ||
"@types/d3-cloud": "^1.2.3", | ||
"@types/seedrandom": "^2.4.28", | ||
"d3-cloud": "^1.2.5", | ||
"seedrandom": "^3.0.5" | ||
"d3-cloud": "^1.2.5" | ||
} | ||
} |
@@ -14,3 +14,3 @@ # Chart.js Word Clouds | ||
```bash | ||
npm install --save chart.js@next @sgratzl/chartjs-esm-facade@next chartjs-chart-wordcloud@next | ||
npm install --save chart.js@next chartjs-chart-wordcloud@next | ||
``` | ||
@@ -17,0 +17,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { IChartComponentLike, registry, IDatasetControllerChartComponent } from '@sgratzl/chartjs-esm-facade'; | ||
import { registry, IDatasetControllerChartComponent, IChartComponent } from 'chart.js'; | ||
@@ -7,8 +7,16 @@ export default function patchController<T, TYPE>( | ||
controller: IDatasetControllerChartComponent, | ||
elements: IChartComponentLike = [], | ||
scales: IChartComponentLike = [] | ||
elements: IChartComponent | IChartComponent[] = [], | ||
scales: IChartComponent | IChartComponent[] = [] | ||
): T & { type: TYPE } { | ||
registry.addControllers(controller); | ||
registry.addControllers(elements); | ||
registry.addScales(scales); | ||
if (Array.isArray(elements)) { | ||
registry.addElements(...elements); | ||
} else { | ||
registry.addElements(elements); | ||
} | ||
if (Array.isArray(scales)) { | ||
registry.addScales(...scales); | ||
} else { | ||
registry.addScales(scales); | ||
} | ||
const c = config as any; | ||
@@ -15,0 +23,0 @@ c.type = type; |
/// <reference types="jest" /> | ||
import { WordCloudController, IWordCloudControllerConfiguration } from './WordCloudController'; | ||
import { registry } from '@sgratzl/chartjs-esm-facade'; | ||
import { registry } from 'chart.js'; | ||
import { WordElement } from '../elements'; | ||
import matchChart from '../__tests__/matchChart'; | ||
import createChart from '../__tests__/createChart'; | ||
@@ -23,3 +23,3 @@ describe('default', () => { | ||
}; | ||
matchChart<number, string, IWordCloudControllerConfiguration<number, string>>( | ||
const chart = createChart<number, string, IWordCloudControllerConfiguration<number, string>>( | ||
{ | ||
@@ -33,3 +33,5 @@ type: WordCloudController.id, | ||
); | ||
return chart.toMatchImageSnapshot(); | ||
}); | ||
}); |
@@ -11,9 +11,17 @@ import { | ||
IChartConfiguration, | ||
toFont, | ||
} from '@sgratzl/chartjs-esm-facade'; | ||
} from 'chart.js'; | ||
import { toFont } from '../../chartjs-helpers/options'; | ||
import layout from 'd3-cloud'; | ||
import seedrandom from 'seedrandom'; | ||
import { WordElement, IWordElementOptions, IWordElementProps } from '../elements'; | ||
import patchController from './patchController'; | ||
function rnd(seed: string | number = Date.now()) { | ||
// Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/ | ||
let s = typeof seed === 'number' ? seed : Array.from(seed).reduce((acc, v) => acc + v.charCodeAt(0), 0); | ||
return () => { | ||
s = (s * 9301 + 49297) % 233280; | ||
return s / 233280; | ||
}; | ||
} | ||
interface ICloudWord extends IWordElementProps { | ||
@@ -86,3 +94,3 @@ options: IWordElementOptions; | ||
super.update(mode); | ||
this.rand = seedrandom(this.chart.id); | ||
this.rand = rnd(this.chart.id); | ||
const meta = this._cachedMeta; | ||
@@ -89,0 +97,0 @@ |
@@ -1,2 +0,3 @@ | ||
import { Element, IFontSpec, IVisualElement, ScriptableAndArrayOptions, toFont } from '@sgratzl/chartjs-esm-facade'; | ||
import { Element, IFontSpec, IVisualElement, ScriptableAndArrayOptions } from 'chart.js'; | ||
import { toFont } from '../../chartjs-helpers/options'; | ||
@@ -3,0 +4,0 @@ export interface IWordElementOptions extends IFontSpec { |
import { WordCloudController } from './controllers'; | ||
import { registry } from '@sgratzl/chartjs-esm-facade'; | ||
import { registry } from 'chart.js'; | ||
import { WordElement } from './elements'; | ||
@@ -4,0 +4,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3
22
0
2
175236
38
1853
1
- Removed@types/seedrandom@^2.4.28
- Removedseedrandom@^3.0.5
- Removed@sgratzl/chartjs-esm-facade@3.0.0-alpha.21(transitive)
- Removed@types/seedrandom@2.4.34(transitive)
- Removedseedrandom@3.0.5(transitive)