Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geoclassify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoclassify - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

geostats.js

2

index.js

@@ -1,1 +0,1 @@

const a=require('geostats'),b={type:'Jenks',level:5};class c{constructor(c){this.options=Object.assign(b,c||{}),this.classify=new a,this.classify.silent=!0,this.seriesArray=null}setData(a){a&&a.length&&Array.isArray(a)||console.error('classify.setData needs ds argument'),this.ds=a;let b=this.options.type;'Jenks'===b?a.length<=this.options.level&&(this.options.level=a.length-1):a.length<=this.options.level&&(this.options.level=a.length),this.classify.setSerie(a),this.setClassify()}setPattern(a){a&&a.length&&Array.isArray(a)||console.error('classify.setPattern needs pattern argument'),this.pattern=a}getPattern(a){let b=this.getIndex(a),c=this.options.level;return b>=this.pattern.length?this.pattern[this.pattern.length-1]:this.pattern[b]}getIndex(a){let b=0,c=this.seriesArray.length;for(let d=0;d<c;d++){if(a===this.seriesArray[c-1]){b=1===c?c-1:c-2;break}if(this.seriesArray[d]<=a&&a<this.seriesArray[d+1]){b=d;break}}return b}setClassify(){let a=this.options,b=a.type,c=a.level;switch(b){case'EqInterval':this.seriesArray=this.classify.getEqInterval(c);break;case'StdDeviation':this.seriesArray=this.classify.getStdDeviation(c);break;case'Arithmetic':this.seriesArray=this.classify.getArithmeticProgression(c);break;case'Geometric':this.seriesArray=this.classify.getGeometricProgression(c);break;case'Quantile':this.seriesArray=this.classify.getQuantile(c);break;case'Jenks':this.seriesArray=this.classify.getJenks(c);break;case'UniqueValues':this.seriesArray=this.classify.getUniqueValues(c);break;default:this.seriesArray=this.classify.getJenks(c);}}setLevel(a){this.options.level=a,this.ds&&this.setData(this.ds)}setPrecision(a){this.classify.setPrecisiond(a)}getEqInterval(){this.options.type='EqInterval',this.setClassify()}getStdDeviation(){this.options.type='StdDeviation',this.setClassify()}getArithmeticProgression(){this.options.type='Arithmetic',this.setClassify()}getGeometricProgression(){this.options.type='Geometric',this.setClassify()}getQuantile(){this.options.type='Quantile',this.setClassify()}getJenks(){this.options.type='Jenks',this.setClassify()}getUniqueValues(){this.options.type='UniqueValues',this.setClassify()}}module.exports=c;
const a=require('./geostats');const b={type:'Jenks',level:5};class c{constructor(c){this.options=Object.assign(b,c||{}),this.classify=new a,this.classify.silent=!0,this.seriesArray=null}setData(a){a&&a.length&&Array.isArray(a)||console.error('classify.setData needs ds argument'),this.ds=a;let b=this.options.type;b==='Jenks'?a.length<=this.options.level&&(this.options.level=a.length-1):a.length<=this.options.level&&(this.options.level=a.length),this.classify.setSerie(a),this.setClassify()}setPattern(a){a&&a.length&&Array.isArray(a)||console.error('classify.setPattern needs pattern argument'),this.pattern=a}getPattern(b){let a=this.getIndex(b);let c=this.options.level;return a>=this.pattern.length?this.pattern[this.pattern.length-1]:this.pattern[a]}getIndex(c){let b=0;let a=this.seriesArray.length;for(let d=0;d<a;d++){if(c===this.seriesArray[a-1]){a===1?b=a-1:b=a-2;break}if(this.seriesArray[d]<=c&&c<this.seriesArray[d+1]){b=d;break}}return b}setClassify(){let b=this.options;let c=b.type;let a=b.level;switch(c){case'EqInterval':this.seriesArray=this.classify.getEqInterval(a);break;case'StdDeviation':this.seriesArray=this.classify.getStdDeviation(a);break;case'Arithmetic':this.seriesArray=this.classify.getArithmeticProgression(a);break;case'Geometric':this.seriesArray=this.classify.getGeometricProgression(a);break;case'Quantile':this.seriesArray=this.classify.getQuantile(a);break;case'Jenks':this.seriesArray=this.classify.getJenks(a);break;case'UniqueValues':this.seriesArray=this.classify.getUniqueValues(a);break;default:this.seriesArray=this.classify.getJenks(a);break}}setLevel(a){this.options.level=a,this.ds&&this.setData(this.ds)}setPrecision(a){this.classify.setPrecisiond(a)}getEqInterval(){this.options.type='EqInterval',this.setClassify()}getStdDeviation(){this.options.type='StdDeviation',this.setClassify()}getArithmeticProgression(){this.options.type='Arithmetic',this.setClassify()}getGeometricProgression(){this.options.type='Geometric',this.setClassify()}getQuantile(){this.options.type='Quantile',this.setClassify()}getJenks(){this.options.type='Jenks',this.setClassify()}getUniqueValues(){this.options.type='UniqueValues',this.setClassify()}}module.exports=c
{
"name": "geoclassify",
"version": "0.0.3",
"version": "0.0.4",
"description": "classify statistics",

@@ -14,6 +14,4 @@ "main": "index.js",

"license": "MIT",
"dependencies": {
"geostats": "1.5.0"
},
"dependencies": {},
"devDependencies": {}
}
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