Skip to content

The only tool you need to know what is happening and how to fix it.

1.3 KB
Raw Blame
import"./DsnmJJEf.js";import{p as G,b as j,g as r,j as v,l as u,e as z,h as g,u as O,r as b,o as _,d as w,a as T,aa as q}from"./BKFspo1J.js";import{i as A}from"./COK9M2N0.js";import{b as B,s as c}from"./DwMHXN8q.js";import{p as h,b as C}from"./CARHnQ8P.js";import{u as E,m as y,a as x,l as F}from"./I2V_l3DK.js";import{l as H}from"./DL0LKnr3.js";var I=q('<svg><path fill="none" stroke-width="1.5" stroke-opacity="0.8"></path></svg>'),J=z('<div class="w-full"><!></div>');function X(k,n){G(n,!0);let o=h(n,"data",19,()=>[]),S=h(n,"color",3,"#3b82f6"),f=h(n,"height",3,40),l=v(null),m=v(120);j(()=>{if(!r(l))return;const e=new ResizeObserver(a=>{for(const s of a)u(m,s.contentRect.width,!0)});return e.observe(r(l)),()=>e.disconnect()});const p=O(()=>{if(o().length<2||r(m)<=0)return"";const e=E().domain([y(o(),t=>t.timestamp)??new Date,x(o(),t=>t.timestamp)??new Date]).range([1,r(m)-1]),a=y(o(),t=>t.value)??0,s=x(o(),t=>t.value)??1,d=s===a?Math.abs(s)*.1||1:0,D=H().domain([a-d,s+d]).range([f()-2,2]);return F().x(t=>e(t.timestamp)).y(t=>D(t.value))(o())||""});var i=J(),M=g(i);{var R=e=>{var a=I(),s=g(a);b(a),_(()=>{c(a,"width",r(m)),c(a,"height",f()),c(s,"d",r(p)),c(s,"stroke",S())}),w(e,a)};A(M,e=>{r(p)&&e(R)})}b(i),C(i,e=>u(l,e),()=>r(l)),_(()=>B(i,`height: ${f()??""}px;`)),w(k,i),T()}export{X as S};