"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@nivo/colors"),c=require("d3"),d=require("./Colors.js");function h(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const f=h(c);class m extends d.default{constructor(e,t,o,n,l){if(super(e,t,o,n,l),e==="index"&&(this._domain=this.data.map(s=>s[this.indexBy])),e==="id"&&(this._domain=this.keys),e==="values"){const s=o.map(i=>n.map(a=>i[a])).flatMap(i=>i).filter(i=>i!=null);this._domain=[Math.min(...s),Math.max(...s)]}this._color=f.scaleOrdinal(u.colorSchemes[this.scheme]),this._color.domain(this._domain)}getColorByValue(e){return this.colorBy==="values"?"gray":this.color(e)}getColor(e,t){return this.colorBy==="index"?this.color(t[this.indexBy]):this.colorBy==="id"?this.color(e):"gray"}getColorByIndex(e){return this.colorBy==="values"?"gray":this.color(e)}getColorByKey(e){return this.colorBy==="values"?"gray":this.color(e)}}exports.default=m;
