2025-03-13 17:55:37 +01:00

4 lines
14 KiB
JavaScript

const __vite__fileDeps=["./vega-embed.module-dxUHibG-.js","./vega-tooltip.module-Ct3zdFkl.js","./index-C7PS0jJm.js","./index-Bo0Yq5bb.css","./dsv-DB8NKgIY.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
import{_ as Ve}from"./index-C7PS0jJm.js";import{B as je}from"./Block-DZqtZLFP.js";import{B as qe}from"./BlockTitle-BIcnzvtg.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import{E as Ie}from"./Empty-CxRQfWXb.js";import"./MarkdownCode.svelte_svelte_type_style_lang-3tofWDHK.js";import{L as Be}from"./LineChart-CKh1Fdep.js";import{S as De}from"./index-B1gfMDT9.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import"./svelte/svelte.js";import"./Info-DcCn6tHi.js";import"./MarkdownCode-DJM7o_VY.js";import"./prism-python-qapVsvY8.js";import"./IconButton-B-aAVSzy.js";import"./Clear-By3xiIwg.js";const{SvelteComponent:Ne,append:Me,assign:Re,attr:we,binding_callbacks:He,check_outros:be,create_component:M,destroy_component:R,detach:W,element:Fe,empty:ze,flush:_,get_spread_object:Ue,get_spread_update:Xe,group_outros:ye,init:Ye,insert:L,mount_component:H,noop:xe,safe_not_equal:Ge,set_data:Pe,space:re,text:Se,transition_in:w,transition_out:P}=window.__gradio__svelte__internal,{onMount:Je}=window.__gradio__svelte__internal;function ve(r){let e,l;const i=[{autoscroll:r[3].autoscroll},{i18n:r[3].i18n},r[11]];let n={};for(let s=0;s<i.length;s+=1)n=Re(n,i[s]);return e=new De({props:n}),e.$on("clear_status",r[41]),{c(){M(e.$$.fragment)},m(s,c){H(e,s,c),l=!0},p(s,c){const d=c[0]&2056?Xe(i,[c[0]&8&&{autoscroll:s[3].autoscroll},c[0]&8&&{i18n:s[3].i18n},c[0]&2048&&Ue(s[11])]):{};e.$set(d)},i(s){l||(w(e.$$.fragment,s),l=!0)},o(s){P(e.$$.fragment,s),l=!1},d(s){R(e,s)}}}function Ke(r){let e;return{c(){e=Se(r[4])},m(l,i){L(l,e,i)},p(l,i){i[0]&16&&Pe(e,l[4])},d(l){l&&W(e)}}}function Qe(r){let e,l;return e=new Ie({props:{unpadded_box:!0,$$slots:{default:[pe]},$$scope:{ctx:r}}}),{c(){M(e.$$.fragment)},m(i,n){H(e,i,n),l=!0},p(i,n){const s={};n[1]&33554432&&(s.$$scope={dirty:n,ctx:i}),e.$set(s)},i(i){l||(w(e.$$.fragment,i),l=!0)},o(i){P(e.$$.fragment,i),l=!1},d(i){R(e,i)}}}function Ze(r){let e,l,i,n=r[2]&&ke(r);return{c(){e=Fe("div"),l=re(),n&&n.c(),i=ze(),we(e,"class","svelte-19qacdz")},m(s,c){L(s,e,c),r[42](e),L(s,l,c),n&&n.m(s,c),L(s,i,c)},p(s,c){s[2]?n?n.p(s,c):(n=ke(s),n.c(),n.m(i.parentNode,i)):n&&(n.d(1),n=null)},i:xe,o:xe,d(s){s&&(W(e),W(l),W(i)),r[42](null),n&&n.d(s)}}}function pe(r){let e,l;return e=new Be({}),{c(){M(e.$$.fragment)},m(i,n){H(e,i,n),l=!0},i(i){l||(w(e.$$.fragment,i),l=!0)},o(i){P(e.$$.fragment,i),l=!1},d(i){R(e,i)}}}function ke(r){let e,l;return{c(){e=Fe("p"),l=Se(r[2]),we(e,"class","caption svelte-19qacdz")},m(i,n){L(i,e,n),Me(e,l)},p(i,n){n[0]&4&&Pe(l,i[2])},d(i){i&&W(e)}}}function $e(r){let e,l,i,n,s,c,d,o=r[11]&&ve(r);l=new qe({props:{root:r[1],show_label:r[8],info:void 0,$$slots:{default:[Ke]},$$scope:{ctx:r}}});const g=[Ze,Qe],u=[];function f(a,m){return a[0]&&a[14]?0:1}return n=f(r),s=u[n]=g[n](r),{c(){o&&o.c(),e=re(),M(l.$$.fragment),i=re(),s.c(),c=ze()},m(a,m){o&&o.m(a,m),L(a,e,m),H(l,a,m),L(a,i,m),u[n].m(a,m),L(a,c,m),d=!0},p(a,m){a[11]?o?(o.p(a,m),m[0]&2048&&w(o,1)):(o=ve(a),o.c(),w(o,1),o.m(e.parentNode,e)):o&&(ye(),P(o,1,1,()=>{o=null}),be());const F={};m[0]&2&&(F.root=a[1]),m[0]&256&&(F.show_label=a[8]),m[0]&16|m[1]&33554432&&(F.$$scope={dirty:m,ctx:a}),l.$set(F);let S=n;n=f(a),n===S?u[n].p(a,m):(ye(),P(u[S],1,1,()=>{u[S]=null}),be(),s=u[n],s?s.p(a,m):(s=u[n]=g[n](a),s.c()),w(s,1),s.m(c.parentNode,c))},i(a){d||(w(o),w(l.$$.fragment,a),w(s),d=!0)},o(a){P(o),P(l.$$.fragment,a),P(s),d=!1},d(a){a&&(W(e),W(i),W(c)),o&&o.d(a),R(l,a),u[n].d(a)}}}function et(r){let e,l;return e=new je({props:{visible:r[7],elem_id:r[5],elem_classes:r[6],scale:r[9],min_width:r[10],allow_overflow:!1,padding:!0,height:r[12],$$slots:{default:[$e]},$$scope:{ctx:r}}}),{c(){M(e.$$.fragment)},m(i,n){H(e,i,n),l=!0},p(i,n){const s={};n[0]&128&&(s.visible=i[7]),n[0]&32&&(s.elem_id=i[5]),n[0]&64&&(s.elem_classes=i[6]),n[0]&512&&(s.scale=i[9]),n[0]&1024&&(s.min_width=i[10]),n[0]&4096&&(s.height=i[12]),n[0]&10527|n[1]&33554432&&(s.$$scope={dirty:n,ctx:i}),e.$set(s)},i(i){l||(w(e.$$.fragment,i),l=!0)},o(i){P(e.$$.fragment,i),l=!1},d(i){R(e,i)}}}function tt(r,e,l){let i,n,s,c,d,{value:o}=e,{x:g}=e,{y:u}=e,{color:f=null}=e,{root:a}=e,{title:m=null}=e,{x_title:F=null}=e,{y_title:S=null}=e,{color_title:ee=null}=e,{x_bin:z=null}=e,{y_aggregate:I=void 0}=e,{color_map:U=null}=e,{x_lim:V=null}=e,{y_lim:X=null}=e,{x_label_angle:Y=null}=e,{y_label_angle:G=null}=e,{x_axis_labels_visible:J=!0}=e,{caption:oe=null}=e,{sort:te=null}=e,{tooltip:A="axis"}=e;function Ae(t){if(t==="x")return"ascending";if(t==="-x")return"descending";if(t==="y")return{field:u,order:"ascending"};if(t==="-y")return{field:u,order:"descending"};if(t===null)return;if(Array.isArray(t))return t}let{_selectable:K=!1}=e,Q,{gradio:j}=e,E,le=!1;const Ee={s:1,m:60,h:60*60,d:24*60*60};let B,q;function Ce(t){if(A=="all"||Array.isArray(A))return t.data.map(v=>{const h={};return t.columns.forEach(($,N)=>{h[$]=v[N]}),h});let y=t.columns.indexOf(g),O=t.columns.indexOf(u),x=f?t.columns.indexOf(f):null;return t.data.map(v=>{const h={[g]:v[y],[u]:v[O]};return f&&x!==null&&(h[f]=v[x]),h})}const Oe=typeof window<"u";let b,C,Z=!1,ae,p,ie;async function _e(){if(C&&C.finalize(),!o||!b)return;ae=b.offsetWidth;const t=We();t&&(p=new ResizeObserver(y=>{!y[0].target||!(y[0].target instanceof HTMLElement)||(ae===0&&b.offsetWidth!==0&&o.datatypes[g]==="nominal"?_e():C.signal("width",y[0].target.offsetWidth).run())}),ie||(ie=(await Ve(()=>import("./vega-embed.module-dxUHibG-.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).default),ie(b,t,{actions:!1}).then(function(y){C=y.view,p.observe(b);var O;C.addEventListener("dblclick",()=>{j.dispatch("double_click")}),b.addEventListener("mousedown",function(x){x.detail>1&&x.preventDefault()},!1),K&&C.addSignalListener("brush",function(x,v){if(Object.keys(v).length===0)return;clearTimeout(O);let h=v[Object.keys(v)[0]];s&&(h=[h[0]/1e3,h[1]/1e3]),le?l(38,D=()=>{j.dispatch("select",{value:h,index:h,selected:!0})}):O=setTimeout(function(){j.dispatch("select",{value:h,index:h,selected:!0})},250)})}))}let D=null;Je(()=>(l(37,Z=!0),()=>{l(37,Z=!1),C&&C.finalize(),p&&p.disconnect()}));function We(){if(!o||!d)return null;let t=d.getPropertyValue("--color-accent"),y=d.getPropertyValue("--body-text-color"),O=d.getPropertyValue("--border-color-primary"),x=d.fontFamily,v=d.getPropertyValue("--block-title-text-weight");const h=T=>T.endsWith("px")?parseFloat(T.slice(0,-2)):12;let $=h(d.getPropertyValue("--text-md")),N=h(d.getPropertyValue("--text-sm"));return{$schema:"https://vega.github.io/schema/vega-lite/v5.17.0.json",background:"transparent",config:{autosize:{type:"fit",contains:"padding"},axis:{labelFont:x,labelColor:y,titleFont:x,titleColor:y,titlePadding:8,tickColor:O,labelFontSize:N,gridColor:O,titleFontWeight:"normal",titleFontSize:N,labelFontWeight:"normal",domain:!1,labelAngle:0},legend:{labelColor:y,labelFont:x,titleColor:y,titleFont:x,titleFontWeight:"normal",titleFontSize:N,labelFontWeight:"normal",offset:2},title:{color:y,font:x,fontSize:$,fontWeight:v,anchor:"middle"},view:{stroke:O},mark:{stroke:o.mark!=="bar"?t:void 0,fill:o.mark==="bar"?t:void 0,cursor:"crosshair"}},data:{name:"data"},datasets:{data:Q},layer:["plot",...o.mark==="line"?["hover"]:[]].map(T=>({encoding:{size:o.mark==="line"?T=="plot"?{condition:{empty:!1,param:"hoverPlot",value:3},value:2}:{condition:{empty:!1,param:"hover",value:100},value:0}:void 0,opacity:T==="plot"?void 0:{condition:{empty:!1,param:"hover",value:1},value:0},x:{axis:{...Y!==null&&{labelAngle:Y},labels:J,ticks:J},field:g,title:F||g,type:o.datatypes[g],scale:c?{domain:c}:void 0,bin:E?{step:E}:void 0,sort:n},y:{axis:G?{labelAngle:G}:{},field:u,title:S||u,type:o.datatypes[u],scale:X?{domain:X}:void 0,aggregate:q?B:void 0},color:f?{field:f,legend:{orient:"bottom",title:ee},scale:o.datatypes[f]==="nominal"?{domain:i,range:U?i.map(k=>U[k]):void 0}:{range:[100,200,300,400,500,600,700,800,900].map(k=>d.getPropertyValue("--primary-"+k)),interpolate:"hsl"},type:o.datatypes[f]}:void 0,tooltip:A=="none"?void 0:[{field:u,type:o.datatypes[u],aggregate:q?B:void 0,title:S||u},{field:g,type:o.datatypes[g],title:F||g,format:s?"%Y-%m-%d %H:%M:%S":void 0,bin:E?{step:E}:void 0},...f?[{field:f,type:o.datatypes[f]}]:[],...A==="axis"?[]:o?.columns.filter(k=>k!==g&&k!==u&&k!==f&&(A==="all"||A.includes(k))).map(k=>({field:k,type:o.datatypes[k]}))]},strokeDash:{},mark:{clip:!0,type:T==="hover"?"point":o.mark},name:T})),params:[...o.mark==="line"?[{name:"hoverPlot",select:{clear:"mouseout",fields:f?[f]:[],nearest:!0,on:"mouseover",type:"point"},views:["hover"]},{name:"hover",select:{clear:"mouseout",nearest:!0,on:"mouseover",type:"point"},views:["hover"]}]:[],...K?[{name:"brush",select:{encodings:["x"],mark:{fill:"gray",fillOpacity:.3,stroke:"none"},type:"interval"},views:["plot"]}]:[]],width:b.offsetWidth,height:se?"container":void 0,title:m||void 0}}let{label:ce="Textbox"}=e,{elem_id:ue=""}=e,{elem_classes:fe=[]}=e,{visible:me=!0}=e,{show_label:de}=e,{scale:ge=null}=e,{min_width:he=void 0}=e,{loading_status:ne=void 0}=e,{height:se=void 0}=e;const Le=()=>j.dispatch("clear_status",ne);function Te(t){He[t?"unshift":"push"](()=>{b=t,l(13,b)})}return r.$$set=t=>{"value"in t&&l(0,o=t.value),"x"in t&&l(15,g=t.x),"y"in t&&l(16,u=t.y),"color"in t&&l(17,f=t.color),"root"in t&&l(1,a=t.root),"title"in t&&l(18,m=t.title),"x_title"in t&&l(19,F=t.x_title),"y_title"in t&&l(20,S=t.y_title),"color_title"in t&&l(21,ee=t.color_title),"x_bin"in t&&l(22,z=t.x_bin),"y_aggregate"in t&&l(23,I=t.y_aggregate),"color_map"in t&&l(24,U=t.color_map),"x_lim"in t&&l(25,V=t.x_lim),"y_lim"in t&&l(26,X=t.y_lim),"x_label_angle"in t&&l(27,Y=t.x_label_angle),"y_label_angle"in t&&l(28,G=t.y_label_angle),"x_axis_labels_visible"in t&&l(29,J=t.x_axis_labels_visible),"caption"in t&&l(2,oe=t.caption),"sort"in t&&l(30,te=t.sort),"tooltip"in t&&l(31,A=t.tooltip),"_selectable"in t&&l(32,K=t._selectable),"gradio"in t&&l(3,j=t.gradio),"label"in t&&l(4,ce=t.label),"elem_id"in t&&l(5,ue=t.elem_id),"elem_classes"in t&&l(6,fe=t.elem_classes),"visible"in t&&l(7,me=t.visible),"show_label"in t&&l(8,de=t.show_label),"scale"in t&&l(9,ge=t.scale),"min_width"in t&&l(10,he=t.min_width),"loading_status"in t&&l(11,ne=t.loading_status),"height"in t&&l(12,se=t.height)},r.$$.update=()=>{r.$$.dirty[0]&1&&l(33,Q=o?Ce(o):[]),r.$$.dirty[0]&131073|r.$$.dirty[1]&4&&(i=f&&o&&o.datatypes[f]==="nominal"?Array.from(new Set(Q.map(t=>t[f]))):[]),r.$$.dirty[0]&1073741824&&(n=Ae(te)),r.$$.dirty[0]&32769&&l(39,s=o&&o.datatypes[g]==="temporal"),r.$$.dirty[0]&33554432|r.$$.dirty[1]&256&&(c=V&&s?[V[0]*1e3,V[1]*1e3]:V),r.$$.dirty[0]&4194304&&l(34,E=z?typeof z=="string"?1e3*parseInt(z.substring(0,z.length-1))*Ee[z[z.length-1]]:z:void 0),r.$$.dirty[0]&8421377|r.$$.dirty[1]&40&&o&&(o.mark==="point"?(l(36,q=E!==void 0),l(35,B=I||q?"sum":void 0)):(l(36,q=E!==void 0||o.datatypes[g]==="nominal"),l(35,B=I||"sum"))),r.$$.dirty[0]&8192&&l(40,d=b?window.getComputedStyle(b):null),r.$$.dirty[0]&8192|r.$$.dirty[1]&192&&Z&&b&&(b.addEventListener("mousedown",()=>{le=!0}),b.addEventListener("mouseup",()=>{le=!1,D&&(D(),l(38,D=null))})),r.$$.dirty[0]&1199546373|r.$$.dirty[1]&592&&d&&requestAnimationFrame(_e)},[o,a,oe,j,ce,ue,fe,me,de,ge,he,ne,se,b,Oe,g,u,f,m,F,S,ee,z,I,U,V,X,Y,G,J,te,A,K,Q,E,B,q,Z,D,s,d,Le,Te]}class bt extends Ne{constructor(e){super(),Ye(this,e,tt,et,Ge,{value:0,x:15,y:16,color:17,root:1,title:18,x_title:19,y_title:20,color_title:21,x_bin:22,y_aggregate:23,color_map:24,x_lim:25,y_lim:26,x_label_angle:27,y_label_angle:28,x_axis_labels_visible:29,caption:2,sort:30,tooltip:31,_selectable:32,gradio:3,label:4,elem_id:5,elem_classes:6,visible:7,show_label:8,scale:9,min_width:10,loading_status:11,height:12},null,[-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),_()}get x(){return this.$$.ctx[15]}set x(e){this.$$set({x:e}),_()}get y(){return this.$$.ctx[16]}set y(e){this.$$set({y:e}),_()}get color(){return this.$$.ctx[17]}set color(e){this.$$set({color:e}),_()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),_()}get title(){return this.$$.ctx[18]}set title(e){this.$$set({title:e}),_()}get x_title(){return this.$$.ctx[19]}set x_title(e){this.$$set({x_title:e}),_()}get y_title(){return this.$$.ctx[20]}set y_title(e){this.$$set({y_title:e}),_()}get color_title(){return this.$$.ctx[21]}set color_title(e){this.$$set({color_title:e}),_()}get x_bin(){return this.$$.ctx[22]}set x_bin(e){this.$$set({x_bin:e}),_()}get y_aggregate(){return this.$$.ctx[23]}set y_aggregate(e){this.$$set({y_aggregate:e}),_()}get color_map(){return this.$$.ctx[24]}set color_map(e){this.$$set({color_map:e}),_()}get x_lim(){return this.$$.ctx[25]}set x_lim(e){this.$$set({x_lim:e}),_()}get y_lim(){return this.$$.ctx[26]}set y_lim(e){this.$$set({y_lim:e}),_()}get x_label_angle(){return this.$$.ctx[27]}set x_label_angle(e){this.$$set({x_label_angle:e}),_()}get y_label_angle(){return this.$$.ctx[28]}set y_label_angle(e){this.$$set({y_label_angle:e}),_()}get x_axis_labels_visible(){return this.$$.ctx[29]}set x_axis_labels_visible(e){this.$$set({x_axis_labels_visible:e}),_()}get caption(){return this.$$.ctx[2]}set caption(e){this.$$set({caption:e}),_()}get sort(){return this.$$.ctx[30]}set sort(e){this.$$set({sort:e}),_()}get tooltip(){return this.$$.ctx[31]}set tooltip(e){this.$$set({tooltip:e}),_()}get _selectable(){return this.$$.ctx[32]}set _selectable(e){this.$$set({_selectable:e}),_()}get gradio(){return this.$$.ctx[3]}set gradio(e){this.$$set({gradio:e}),_()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),_()}get elem_id(){return this.$$.ctx[5]}set elem_id(e){this.$$set({elem_id:e}),_()}get elem_classes(){return this.$$.ctx[6]}set elem_classes(e){this.$$set({elem_classes:e}),_()}get visible(){return this.$$.ctx[7]}set visible(e){this.$$set({visible:e}),_()}get show_label(){return this.$$.ctx[8]}set show_label(e){this.$$set({show_label:e}),_()}get scale(){return this.$$.ctx[9]}set scale(e){this.$$set({scale:e}),_()}get min_width(){return this.$$.ctx[10]}set min_width(e){this.$$set({min_width:e}),_()}get loading_status(){return this.$$.ctx[11]}set loading_status(e){this.$$set({loading_status:e}),_()}get height(){return this.$$.ctx[12]}set height(e){this.$$set({height:e}),_()}}export{bt as default};
//# sourceMappingURL=Index-Cd6Hblfy.js.map