UNPKG

@icgcat/thematic-stats

Version:

Thematic-stats is a library to generate thematic styles for geospatial data visualization

2 lines (1 loc) 537 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(o,c,n,r,e){let t=["match",["get",o]];return n.forEach(function(l,a){const g=c[a];let s=r.colors[r.getRangeNum(g)];s||(s="rgba(0,0,0,0)");const u=e?parseInt(l):l;t.push(u,s)}),t.push("rgba(0,0,0,0)"),t}function i(o,c,n){let r=["step",["get",o]];return r.push("rgba(0,0,0,0)"),c.forEach(function(e,t){const l=n[t]?n[t]:"rgba(0,0,0,0)";t==0?e=parseFloat(e)-.1:e=parseFloat(e)+.1,r.push(e,l)}),r}exports.generateStyle=i;exports.generateStyleJSTAT=f;