"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("d3");function c(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=c(d);class u{constructor(t){const{breaks:e,defaultFillColor:s,defaultBorderColor:n,defaultSize:h}=t;this.breaks=e,this.defaultFillColor=s,this.defaultBorderColor=n,this.defaultSize=h;const a=e.filter(r=>r.type!=="graterThan"),l=e.filter(r=>r.type==="graterThan");l.length>0&&(this.graterThanStyle=l[0]),this.domain=a.map(r=>Number(r.end)),this.sizeScale=o.scaleThreshold().domain(this.domain).range(a.map(r=>r.size)),this.colorScale=o.scaleThreshold().domain(a.map(r=>r.end)).range(e.map(r=>r.color)),this.getSize=this.getSize.bind(this),this.getColor=this.getColor.bind(this)}getSize(t){let e=0;if(this.breaks.length>0){if(t>Math.max(...this.domain))return this.graterThanStyle.size;e=this.defaultSize+this.sizeScale(t)}else e=this.defaultSize;return console.log("size",e),e}getColor(t,e){return this.breaks.length>0?t>Math.max(...this.domain)?this.graterThanStyle.color:this.colorScale(t):this.defaultFillColor}}exports.default=u;
