d3-scale-cluster
Advanced tools
Comparing version 1.3.1 to 2.0.0
module.exports = { | ||
extends: 'standard', | ||
rules: { | ||
semi: ['error', 'always'] | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
node: true, | ||
'jest/globals': true, | ||
}, | ||
extends: ['standard', 'plugin:prettier/recommended'], | ||
plugins: ['jest'], | ||
globals: { | ||
d3: true | ||
} | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2015, | ||
}, | ||
rules: {}, | ||
}; |
# Changelog | ||
### 2.0.0 | ||
- Update ckmeans package to remove native code dependency, check out the ckmeans-native package if want a faster native version of this algorithm. | ||
### 1.3.1 | ||
* Split ckmeans into its own package | ||
- Split ckmeans into its own package | ||
### 1.3.0 | ||
* Significant perf improvements in Node via NAPI (see #5, thanks @furstenheim) | ||
- Significant perf improvements in Node via NAPI (see #5, thanks @furstenheim) | ||
### 1.2.0 | ||
* Add helpers for computation in web worker (thanks @furstenheim) | ||
- Add helpers for computation in web worker (thanks @furstenheim) | ||
### 1.1.7 | ||
* Add support for RequireJS/AMD (thanks @kimxogus) | ||
- Add support for RequireJS/AMD (thanks @kimxogus) | ||
### 1.1.0 | ||
* Ported [Ckmeans 3.4.6](https://cran.r-project.org/web/packages/Ckmeans.1d.dp/) to JavaScript for a [~10x performance boost](https://cloud.githubusercontent.com/assets/875591/19367940/67688548-9152-11e6-9c2e-01e3e800bb65.png) | ||
- Ported [Ckmeans 3.4.6](https://cran.r-project.org/web/packages/Ckmeans.1d.dp/) to JavaScript for a [~10x performance boost](https://cloud.githubusercontent.com/assets/875591/19367940/67688548-9152-11e6-9c2e-01e3e800bb65.png) | ||
### 1.0.1 | ||
* Initial release | ||
- Initial release |
{ | ||
"name": "d3-scale-cluster", | ||
"version": "1.3.1", | ||
"version": "2.0.0", | ||
"description": "D3 scale that clusters data into discrete groups", | ||
"repository": "schnerd/d3-scale-cluster", | ||
"main": "src/index.js", | ||
"author": "David Schnurr", | ||
"license": "MIT", | ||
"main": "dist/d3-scale-cluster.cjs.js", | ||
"module": "dist/d3-scale-cluster.esm.js", | ||
"browser": "dist/d3-scale-cluster.umd.js", | ||
"scripts": { | ||
"test": "npm run lint && node spec/index.js", | ||
"build": "webpack", | ||
"lint": "eslint src/* spec/*" | ||
"test": "npm run lint && npm run jest", | ||
"jest": "jest", | ||
"lint": "eslint src", | ||
"build": "rollup -c" | ||
}, | ||
"author": "David Schnurr", | ||
"license": "MIT", | ||
"dependencies": { | ||
"ckmeans": "^1.0.1" | ||
"ckmeans": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.15.0", | ||
"eslint-config-standard": "^11.0.0-beta.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-node": "^5.2.1", | ||
"eslint-plugin-promise": "^3.6.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"jasmine": "^2.5.1", | ||
"jasmine-console-reporter": "^1.2.7", | ||
"sinon": "^4.2.2", | ||
"webpack": "^3.10.0" | ||
}, | ||
"gypfile": true | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"eslint": "^7.0.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jest": "^23.11.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"jest": "^26.0.1", | ||
"prettier": "^2.0.5", | ||
"rollup": "^2.9.1" | ||
} | ||
} |
@@ -13,2 +13,4 @@ # d3-scale-cluster | ||
For more direct access to the ckmeans algorithm (not as a D3 scale), check out [ckmeans](https://www.npmjs.com/package/ckmeans) or its native sibling [ckmeans-native](https://www.npmjs.com/package/ckmeans-native). | ||
### Getting Started | ||
@@ -47,2 +49,3 @@ | ||
``` | ||
### Example Usage | ||
@@ -53,5 +56,6 @@ | ||
```js | ||
var scale = d3.scaleCluster() | ||
.domain([1, 2, 4, 5, 12, 43, 52, 123, 234, 1244]) | ||
.range(['#E5D6EA', '#C798D3', '#9E58AF', '#7F3391', '#581F66', '#30003A']); | ||
var scale = d3 | ||
.scaleCluster() | ||
.domain([1, 2, 4, 5, 12, 43, 52, 123, 234, 1244]) | ||
.range(['#E5D6EA', '#C798D3', '#9E58AF', '#7F3391', '#581F66', '#30003A']); | ||
@@ -116,3 +120,3 @@ var clusters = scale.clusters(); // [12, 43, 123, 234, 1244] | ||
worker.onmessage = function (event) { | ||
const scale = scaleCluster().import(event.data.scale) | ||
const scale = scaleCluster().import(event.data.scale); | ||
}; | ||
@@ -136,4 +140,3 @@ ``` | ||
npm run test # run tests | ||
npm run test-node-modern # run tests (with ckmeans native) | ||
npm run build # build distributable file for browser | ||
npm run build # build distributable file | ||
``` | ||
@@ -140,0 +143,0 @@ |
var ckmeans = require('ckmeans'); | ||
function d3scaleCluster () { | ||
function d3scaleCluster() { | ||
var isReady = false; | ||
@@ -20,3 +20,3 @@ var domain = []; | ||
function rescale () { | ||
function rescale() { | ||
if (range.length <= 2) { | ||
@@ -82,3 +82,3 @@ return; | ||
range: range, | ||
breakpoints: breakpoints | ||
breakpoints: breakpoints, | ||
}; | ||
@@ -106,2 +106,3 @@ }; | ||
if (typeof d3 === 'object') { | ||
// eslint-disable-next-line no-undef | ||
d3.scaleCluster = d3scaleCluster; | ||
@@ -108,0 +109,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
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
33001
14
725
147
14
+ Addedckmeans@2.1.0(transitive)
- Removedbindings@1.5.0(transitive)
- Removedckmeans@1.0.1(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removednode-addon-api@1.7.2(transitive)
Updatedckmeans@^2.0.1