@icgcat/thematic-stats
Version:
Thematic-stats is a library to generate thematic styles for geospatial data visualization
2 lines (1 loc) • 729 B
JavaScript
(function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.stats={}))})(this,function(e){"use strict";function s(l,r,f,o,t){let n=["match",["get",l]];return f.forEach(function(i,p){const a=r[p];let c=o.colors[o.getRangeNum(a)];c||(c="rgba(0,0,0,0)");const g=t?parseInt(i):i;n.push(g,c)}),n.push("rgba(0,0,0,0)"),n}function u(l,r,f){let o=["step",["get",l]];return o.push("rgba(0,0,0,0)"),r.forEach(function(t,n){const i=f[n]?f[n]:"rgba(0,0,0,0)";n==0?t=parseFloat(t)-.1:t=parseFloat(t)+.1,o.push(t,i)}),o}e.generateStyle=u,e.generateStyleJSTAT=s,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});