UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 1.16 kB
import{isSome as e}from"../../../../core/maybe.js";import{getFlowSimulationSettings as t,getOpacity as o,getSize as a,getColor as r,getMax as s,getForegroundColor as l}from"./utils.js";import{Imagery as n}from"./styles/Imagery.js";import{Particles as i}from"./styles/Particles.js";import{Stack as c}from"./styles/Stack.js";import m from"./styles/Streamlines.js";const f=4,p=1,u=.5,y=!0,d=!0,g=2.3;function w(w,h){const{flowSpeed:j,trailLength:v}=w,S=t(w);let k=null;const x={opacity:o(w),size:a(w)};let I=r(w);if("none"===w.background)x.color=I;else{"constant"===I.kind&&(I={kind:"ramp",stops:[0,1],values:[0,0,0,1,I.value[0],I.value[1],I.value[2],I.value[3]],count:2});const e={loadImagery:h.loadImagery,timeExtent:h.timeExtent,color:I,opacity:{kind:"constant",value:[1]}};k=new n(e),x.color=l()}const z={loadImagery:h.loadImagery,createFlowMesh:h.createFlowMesh,simulationSettings:S,timeExtent:h.timeExtent,trailLength:v,flowSpeed:j,featheringSize:p,featheringOffset:u,introFade:y,fadeToZero:d,decayRate:g,color:x.color,opacity:x.opacity,size:x.size},E="butt"===w.trailCap||s(a(w))<=f?new m(z):new i(z);return e(k)?new c([k,E]):E}export{w as default};