A?k>A?(a=K(U,V,z,D,f,k,p),c=K(H,J,F,G,f,k,p),h.moveTo(a.cx+a.x01,a.cy+a.y01),kA)||!(w>A)?h.lineTo(F,G):R>A?(a=K(F,G,H,J,r,-R,p),c=K(z,D,U,V,r,-R,p),h.lineTo(a.cx+a.x01,a.cy+a.y01),R
t(0,r=o)),[r]}class w extends x{constructor(a){super(),S(this,a,H,D,g,{})}}export{w as default};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/immutable/components/pages/_layout.svelte-eb1cc3e8.js:
--------------------------------------------------------------------------------
1 | import{S as J,i as K,s as M,k as h,q as b,a as C,l as d,m as $,r as k,h as u,c as A,n as i,C as g,b as O,D as c,B as G,E as P,F as Q,w as R,x as T,y as W,G as X,H as Y,I as Z,f as U,t as j,z as x}from"../../chunks/index-fac9d42c.js";import{p as ee}from"../../chunks/stores-10673846.js";function ae(n){let a,t,l,r,s,e,o,f,_,D,H,p,I,S,m,V;return{c(){a=h("nav"),t=h("div"),l=h("h1"),r=h("a"),s=b("Data Visualizations"),e=C(),o=h("ul"),f=h("li"),_=h("a"),D=b("Happy Faces"),H=C(),p=h("a"),I=b("Sticky Circle"),S=C(),m=h("a"),V=b("Colors"),this.h()},l(v){a=d(v,"NAV",{class:!0});var y=$(a);t=d(y,"DIV",{class:!0});var E=$(t);l=d(E,"H1",{class:!0});var z=$(l);r=d(z,"A",{href:!0,class:!0});var F=$(r);s=k(F,"Data Visualizations"),F.forEach(u),z.forEach(u),e=A(E),o=d(E,"UL",{class:!0});var L=$(o);f=d(L,"LI",{class:!0});var q=$(f);_=d(q,"A",{href:!0,class:!0});var N=$(_);D=k(N,"Happy Faces"),N.forEach(u),H=A(q),p=d(q,"A",{href:!0,class:!0});var w=$(p);I=k(w,"Sticky Circle"),w.forEach(u),S=A(q),m=d(q,"A",{href:!0,class:!0});var B=$(m);V=k(B,"Colors"),B.forEach(u),q.forEach(u),L.forEach(u),E.forEach(u),y.forEach(u),this.h()},h(){i(r,"href","/"),i(r,"class","active svelte-1mun0q1"),i(l,"class","svelte-1mun0q1"),i(_,"href","/happyfaces"),i(_,"class","svelte-1mun0q1"),g(_,"active",n[0]=="/happyfaces"),i(p,"href","/stickycircle"),i(p,"class","svelte-1mun0q1"),g(p,"active",n[0]=="/stickycircle"),i(m,"href","/colors"),i(m,"class","svelte-1mun0q1"),g(m,"active",n[0]=="/colors"),i(f,"class","svelte-1mun0q1"),i(o,"class","svelte-1mun0q1"),i(t,"class","container svelte-1mun0q1"),i(a,"class","svelte-1mun0q1")},m(v,y){O(v,a,y),c(a,t),c(t,l),c(l,r),c(r,s),c(t,e),c(t,o),c(o,f),c(f,_),c(_,D),c(f,H),c(f,p),c(p,I),c(f,S),c(f,m),c(m,V)},p(v,[y]){y&1&&g(_,"active",v[0]=="/happyfaces"),y&1&&g(p,"active",v[0]=="/stickycircle"),y&1&&g(m,"active",v[0]=="/colors")},i:G,o:G,d(v){v&&u(a)}}}function se(n,a,t){let l,r;return P(n,ee,s=>t(1,r=s)),n.$$.update=()=>{n.$$.dirty&2&&t(0,l=r.route.id)},[l,r]}class te extends J{constructor(a){super(),K(this,a,se,ae,M,{})}}function le(n){let a,t,l;a=new te({});const r=n[1].default,s=Q(r,n,n[0],null);return{c(){R(a.$$.fragment),t=C(),s&&s.c()},l(e){T(a.$$.fragment,e),t=A(e),s&&s.l(e)},m(e,o){W(a,e,o),O(e,t,o),s&&s.m(e,o),l=!0},p(e,[o]){s&&s.p&&(!l||o&1)&&X(s,r,e,e[0],l?Z(r,e[0],o,null):Y(e[0]),null)},i(e){l||(U(a.$$.fragment,e),U(s,e),l=!0)},o(e){j(a.$$.fragment,e),j(s,e),l=!1},d(e){x(a,e),e&&u(t),s&&s.d(e)}}}function re(n,a,t){let{$$slots:l={},$$scope:r}=a;return n.$$set=s=>{"$$scope"in s&&t(0,r=s.$$scope)},[r,l]}class oe extends J{constructor(a){super(),K(this,a,re,le,M,{})}}export{oe as default};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/immutable/components/pages/_page.svelte-fa763652.js:
--------------------------------------------------------------------------------
1 | import{S as E,i as b,s as C,k as o,q as h,a as q,l as u,m as d,r as p,h as i,c as A,n as g,b as V,D as t,B as w}from"../../chunks/index-fac9d42c.js";function z(y){let e,l,f,m,a,_,s,v,x;return{c(){e=o("div"),l=o("h1"),f=h("Data Visualizations"),m=q(),a=o("p"),_=h("A Svelte recasting of the "),s=o("a"),v=h("Excellent Series"),x=h(" by Curran Kelleher using D3 with React."),this.h()},l(n){e=u(n,"DIV",{class:!0});var r=d(e);l=u(r,"H1",{});var D=d(l);f=p(D,"Data Visualizations"),D.forEach(i),m=A(r),a=u(r,"P",{});var c=d(a);_=p(c,"A Svelte recasting of the "),s=u(c,"A",{href:!0});var S=d(s);v=p(S,"Excellent Series"),S.forEach(i),x=p(c," by Curran Kelleher using D3 with React."),c.forEach(i),r.forEach(i),this.h()},h(){g(s,"href","https://www.youtube.com/channel/UCSwd_9jyX4YtDYm9p9MxQqw"),g(e,"class","container")},m(n,r){V(n,e,r),t(e,l),t(l,f),t(e,m),t(e,a),t(a,_),t(a,s),t(s,v),t(a,x)},p:w,i:w,o:w,d(n){n&&i(e)}}}class P extends E{constructor(e){super(),b(this,e,null,z,C,{})}}export{P as default};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/immutable/components/pages/colors/_page.svelte-fb9a2599.js:
--------------------------------------------------------------------------------
1 | import{S as A,i as I,s as P,k as R,J as u,l as y,m as f,K as _,h as o,n as c,b as k,D as p,B as m,L as B}from"../../../chunks/index-fac9d42c.js";import{a as D}from"../../../chunks/transform-0199f17a.js";function E(r,t,n){const l=r.slice();return l[5]=t[n],l[7]=n,l}function b(r){let t;return{c(){t=u("path"),this.h()},l(n){t=_(n,"path",{fill:!0,d:!0}),f(t).forEach(o),this.h()},h(){c(t,"fill",r[5]["RGB hex value"]),c(t,"d",r[3]({startAngle:r[7]/r[0].length*2*Math.PI,endAngle:(r[7]+1)/r[0].length*2*Math.PI}))},m(n,l){k(n,t,l)},p:m,d(n){n&&o(t)}}}function M(r){let t,n,l,i=r[0],s=[];for(let a=0;a{"data"in e&&n(4,l=e.data)},[i,s,a,h,l]}class C extends A{constructor(t){super(),I(this,t,S,M,P,{data:4})}}export{C as default};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/immutable/components/pages/happyfaces/_page.svelte-93850a70.js:
--------------------------------------------------------------------------------
1 | import{S as X,i as w,s as M,J as W,a as D,K as Y,m as R,h as o,c as S,n as u,b as _,B as d,w as E,x as b,D as q,y as v,f as y,t as O,z as A,k as z,l as F,d as J,L as K,g as L}from"../../../chunks/index-fac9d42c.js";import{a as V}from"../../../chunks/transform-0199f17a.js";function j(f){let e,i,r,t,a,s;return{c(){e=W("circle"),r=D(),t=W("circle"),this.h()},l(h){e=Y(h,"circle",{cx:!0,cy:!0,r:!0}),R(e).forEach(o),r=S(h),t=Y(h,"circle",{cx:!0,cy:!0,r:!0}),R(t).forEach(o),this.h()},h(){u(e,"cx",f[0]),u(e,"cy",i=-f[1]),u(e,"r",f[2]),u(t,"cx",a=-f[0]),u(t,"cy",s=-f[1]),u(t,"r",f[2])},m(h,n){_(h,e,n),_(h,r,n),_(h,t,n)},p(h,[n]){n&1&&u(e,"cx",h[0]),n&2&&i!==(i=-h[1])&&u(e,"cy",i),n&4&&u(e,"r",h[2]),n&1&&a!==(a=-h[0])&&u(t,"cx",a),n&2&&s!==(s=-h[1])&&u(t,"cy",s),n&4&&u(t,"r",h[2])},i:d,o:d,d(h){h&&o(e),h&&o(r),h&&o(t)}}}function G(f,e,i){let{eyeOffsetX:r}=e,{eyeOffsetY:t}=e,{eyeRadius:a}=e;return f.$$set=s=>{"eyeOffsetX"in s&&i(0,r=s.eyeOffsetX),"eyeOffsetY"in s&&i(1,t=s.eyeOffsetY),"eyeRadius"in s&&i(2,a=s.eyeRadius)},[r,t,a]}class H extends X{constructor(e){super(),w(this,e,G,j,M,{eyeOffsetX:0,eyeOffsetY:1,eyeRadius:2})}}function N(f){let e;return{c(){e=W("path"),this.h()},l(i){e=Y(i,"path",{d:!0}),R(e).forEach(o),this.h()},h(){u(e,"d",f[0]())},m(i,r){_(i,e,r)},p:d,i:d,o:d,d(i){i&&o(e)}}}function Q(f,e,i){let{mouthRadius:r}=e,{mouthWidth:t}=e;const a=V().innerRadius(r).outerRadius(r+t).startAngle(Math.PI/2).endAngle(Math.PI*3/2);return f.$$set=s=>{"mouthRadius"in s&&i(1,r=s.mouthRadius),"mouthWidth"in s&&i(2,t=s.mouthWidth)},[a,r,t]}class T extends X{constructor(e){super(),w(this,e,Q,N,M,{mouthRadius:1,mouthWidth:2})}}function U(f){let e,i;return{c(){e=W("circle"),this.h()},l(r){e=Y(r,"circle",{r:!0,fill:!0,stroke:!0,"stroke-width":!0}),R(e).forEach(o),this.h()},h(){u(e,"r",i=f[1]-f[0]/2),u(e,"fill","yellow"),u(e,"stroke","black"),u(e,"stroke-width",f[0])},m(r,t){_(r,e,t)},p(r,[t]){t&3&&i!==(i=r[1]-r[0]/2)&&u(e,"r",i),t&1&&u(e,"stroke-width",r[0])},i:d,o:d,d(r){r&&o(e)}}}function Z(f,e,i){let{strokeWidth:r}=e,{centerY:t}=e;return f.$$set=a=>{"strokeWidth"in a&&i(0,r=a.strokeWidth),"centerY"in a&&i(1,t=a.centerY)},[r,t]}class x extends X{constructor(e){super(),w(this,e,Z,U,M,{strokeWidth:0,centerY:1})}}function p(f){let e,i,r,t,a,s,h;return r=new x({props:{centerY:f[3],strokeWidth:f[4]}}),t=new H({props:{eyeOffsetX:f[5],eyeOffsetY:f[6],eyeRadius:f[7]}}),a=new T({props:{mouthRadius:f[8],mouthWidth:f[9]}}),{c(){e=W("svg"),i=W("g"),E(r.$$.fragment),E(t.$$.fragment),E(a.$$.fragment),this.h()},l(n){e=Y(n,"svg",{width:!0,height:!0});var c=R(e);i=Y(c,"g",{transform:!0});var m=R(i);b(r.$$.fragment,m),b(t.$$.fragment,m),b(a.$$.fragment,m),m.forEach(o),c.forEach(o),this.h()},h(){u(i,"transform",s=`translate(${f[2]},${f[3]})`),u(e,"width",f[0]),u(e,"height",f[1])},m(n,c){_(n,e,c),q(e,i),v(r,i,null),v(t,i,null),v(a,i,null),h=!0},p(n,[c]){const m={};c&8&&(m.centerY=n[3]),c&16&&(m.strokeWidth=n[4]),r.$set(m);const g={};c&32&&(g.eyeOffsetX=n[5]),c&64&&(g.eyeOffsetY=n[6]),c&128&&(g.eyeRadius=n[7]),t.$set(g);const k={};c&256&&(k.mouthRadius=n[8]),c&512&&(k.mouthWidth=n[9]),a.$set(k),(!h||c&12&&s!==(s=`translate(${n[2]},${n[3]})`))&&u(i,"transform",s),(!h||c&1)&&u(e,"width",n[0]),(!h||c&2)&&u(e,"height",n[1])},i(n){h||(y(r.$$.fragment,n),y(t.$$.fragment,n),y(a.$$.fragment,n),h=!0)},o(n){O(r.$$.fragment,n),O(t.$$.fragment,n),O(a.$$.fragment,n),h=!1},d(n){n&&o(e),A(r),A(t),A(a)}}}function $(f,e,i){let{width:r}=e,{height:t}=e,{centerX:a}=e,{centerY:s}=e,{strokeWidth:h}=e,{eyeOffsetX:n}=e,{eyeOffsetY:c}=e,{eyeRadius:m}=e,{mouthRadius:g}=e,{mouthWidth:k}=e;return f.$$set=l=>{"width"in l&&i(0,r=l.width),"height"in l&&i(1,t=l.height),"centerX"in l&&i(2,a=l.centerX),"centerY"in l&&i(3,s=l.centerY),"strokeWidth"in l&&i(4,h=l.strokeWidth),"eyeOffsetX"in l&&i(5,n=l.eyeOffsetX),"eyeOffsetY"in l&&i(6,c=l.eyeOffsetY),"eyeRadius"in l&&i(7,m=l.eyeRadius),"mouthRadius"in l&&i(8,g=l.mouthRadius),"mouthWidth"in l&&i(9,k=l.mouthWidth)},[r,t,a,s,h,n,c,m,g,k]}class ee extends X{constructor(e){super(),w(this,e,$,p,M,{width:0,height:1,centerX:2,centerY:3,strokeWidth:4,eyeOffsetX:5,eyeOffsetY:6,eyeRadius:7,mouthRadius:8,mouthWidth:9})}}function B(f,e,i){const r=f.slice();return r[2]=e[i],r}function I(f){let e,i;return e=new ee({props:{width:P,height:C,centerX:f[0],centerY:f[1],strokeWidth:ne+Math.random()*3,eyeOffsetX:ie+Math.random()*9,eyeOffsetY:re+Math.random()*15,eyeRadius:se+Math.random()*10,mouthWidth:fe+Math.random()*9,mouthRadius:he+Math.random()*10}}),{c(){E(e.$$.fragment)},l(r){b(e.$$.fragment,r)},m(r,t){v(e,r,t),i=!0},p:d,i(r){i||(y(e.$$.fragment,r),i=!0)},o(r){O(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function te(f){let e,i,r=Array(18),t=[];for(let s=0;sO(t[s],1,1,()=>{t[s]=null});return{c(){e=z("div");for(let s=0;s{const{clientX:l,clientY:h}=r;t(0,e.x=l,e),t(0,e.y=h,e)};return t(0,e={x:p/2,y:y/2}),[e,n]}class C extends x{constructor(s){super(),w(this,s,q,b,E,{})}}export{C as default};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/immutable/start-cac21a0c.js:
--------------------------------------------------------------------------------
1 | import{S as rt,i as ot,s as st,a as it,e as B,c as lt,b as J,g as de,t as F,d as pe,f as M,h as G,j as ct,o as Ie,k as ft,l as ut,m as dt,n as be,p as V,q as pt,r as ht,u as mt,v as X,w as Z,x as Pe,y as x,z as Q,A as fe}from"./chunks/index-fac9d42c.js";import{S as et,I as C,g as Je,f as Ke,a as Ee,b as ue,s as q,i as ze,c as ae,P as We,d as _t,e as gt,h as yt}from"./chunks/singletons-8aa67421.js";function wt(a,e){return a==="/"||e==="ignore"?a:e==="never"?a.endsWith("/")?a.slice(0,-1):a:e==="always"&&!a.endsWith("/")?a+"/":a}function vt(a){return a.split("%25").map(decodeURI).join("%25")}function bt(a){for(const e in a)a[e]=decodeURIComponent(a[e]);return a}const Et=["href","pathname","search","searchParams","toString","toJSON"];function kt(a,e){const n=new URL(a);for(const i of Et){let o=n[i];Object.defineProperty(n,i,{get(){return e(),o},enumerable:!0,configurable:!0})}return Rt(n),n}function Rt(a){Object.defineProperty(a,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const St="/__data.json";function Lt(a){return a.replace(/\/$/,"")+St}function It(a){let e=5381;if(typeof a=="string"){let n=a.length;for(;n;)e=e*33^a.charCodeAt(--n)}else if(ArrayBuffer.isView(a)){const n=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);let i=n.length;for(;i;)e=e*33^n[--i]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}const he=window.fetch;window.fetch=(a,e)=>((a instanceof Request?a.method:(e==null?void 0:e.method)||"GET")!=="GET"&&re.delete(Ue(a)),he(a,e));const re=new Map;function At(a,e){const n=Ue(a,e),i=document.querySelector(n);if(i!=null&&i.textContent){const{body:o,...d}=JSON.parse(i.textContent),t=i.getAttribute("data-ttl");return t&&re.set(n,{body:o,init:d,ttl:1e3*Number(t)}),Promise.resolve(new Response(o,d))}return he(a,e)}function Ot(a,e,n){if(re.size>0){const i=Ue(a,n),o=re.get(i);if(o){if(performance.now(){const o=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(o)return e.push({name:o[1],matcher:o[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const d=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(d)return e.push({name:d[1],matcher:d[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const t=i.split(/\[(.+?)\](?!\])/);return"/"+t.map((_,h)=>{if(h%2){if(_.startsWith("x+"))return ke(String.fromCharCode(parseInt(_.slice(2),16)));if(_.startsWith("u+"))return ke(String.fromCharCode(..._.slice(2).split("-").map(I=>parseInt(I,16))));const g=Pt.exec(_);if(!g)throw new Error(`Invalid param: ${_}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,w,S,T,D]=g;return e.push({name:T,matcher:D,optional:!!w,rest:!!S,chained:S?h===1&&t[0]==="":!1}),S?"(.*?)":w?"([^/]*)?":"([^/]+?)"}return ke(_)}).join("")}).join("")}/?$`),params:e}}function $t(a){return!/^\([^)]+\)$/.test(a)}function Nt(a){return a.slice(1).split("/").filter($t)}function Tt(a,e,n){const i={},o=a.slice(1);let d="";for(let t=0;t=t;)o[h]=o[h-1],h-=1;continue}return}i[f.name]=_}}if(!d)return i}function ke(a){return a.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt(a,e,n,i){const o=new Set(e);return Object.entries(n).map(([f,[_,h,g]])=>{const{pattern:w,params:S}=Ut(f),T={id:f,exec:D=>{const I=w.exec(D);if(I)return Tt(I,S,i)},errors:[1,...g||[]].map(D=>a[D]),layouts:[0,...h||[]].map(t),leaf:d(_)};return T.errors.length=T.layouts.length=Math.max(T.errors.length,T.layouts.length),T});function d(f){const _=f<0;return _&&(f=~f),[_,a[f]]}function t(f){return f===void 0?f:[o.has(f),a[f]]}}function Dt(a){let e,n,i;var o=a[0][0];function d(t){return{props:{data:t[2],form:t[1]}}}return o&&(e=X(o,d(a))),{c(){e&&Z(e.$$.fragment),n=B()},l(t){e&&Pe(e.$$.fragment,t),n=B()},m(t,f){e&&x(e,t,f),J(t,n,f),i=!0},p(t,f){const _={};if(f&4&&(_.data=t[2]),f&2&&(_.form=t[1]),o!==(o=t[0][0])){if(e){de();const h=e;F(h.$$.fragment,1,0,()=>{Q(h,1)}),pe()}o?(e=X(o,d(t)),Z(e.$$.fragment),M(e.$$.fragment,1),x(e,n.parentNode,n)):e=null}else o&&e.$set(_)},i(t){i||(e&&M(e.$$.fragment,t),i=!0)},o(t){e&&F(e.$$.fragment,t),i=!1},d(t){t&&G(n),e&&Q(e,t)}}}function Ct(a){let e,n,i;var o=a[0][0];function d(t){return{props:{data:t[2],$$slots:{default:[Vt]},$$scope:{ctx:t}}}}return o&&(e=X(o,d(a))),{c(){e&&Z(e.$$.fragment),n=B()},l(t){e&&Pe(e.$$.fragment,t),n=B()},m(t,f){e&&x(e,t,f),J(t,n,f),i=!0},p(t,f){const _={};if(f&4&&(_.data=t[2]),f&523&&(_.$$scope={dirty:f,ctx:t}),o!==(o=t[0][0])){if(e){de();const h=e;F(h.$$.fragment,1,0,()=>{Q(h,1)}),pe()}o?(e=X(o,d(t)),Z(e.$$.fragment),M(e.$$.fragment,1),x(e,n.parentNode,n)):e=null}else o&&e.$set(_)},i(t){i||(e&&M(e.$$.fragment,t),i=!0)},o(t){e&&F(e.$$.fragment,t),i=!1},d(t){t&&G(n),e&&Q(e,t)}}}function Vt(a){let e,n,i;var o=a[0][1];function d(t){return{props:{data:t[3],form:t[1]}}}return o&&(e=X(o,d(a))),{c(){e&&Z(e.$$.fragment),n=B()},l(t){e&&Pe(e.$$.fragment,t),n=B()},m(t,f){e&&x(e,t,f),J(t,n,f),i=!0},p(t,f){const _={};if(f&8&&(_.data=t[3]),f&2&&(_.form=t[1]),o!==(o=t[0][1])){if(e){de();const h=e;F(h.$$.fragment,1,0,()=>{Q(h,1)}),pe()}o?(e=X(o,d(t)),Z(e.$$.fragment),M(e.$$.fragment,1),x(e,n.parentNode,n)):e=null}else o&&e.$set(_)},i(t){i||(e&&M(e.$$.fragment,t),i=!0)},o(t){e&&F(e.$$.fragment,t),i=!1},d(t){t&&G(n),e&&Q(e,t)}}}function Ye(a){let e,n=a[5]&&Xe(a);return{c(){e=ft("div"),n&&n.c(),this.h()},l(i){e=ut(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=dt(e);n&&n.l(o),o.forEach(G),this.h()},h(){be(e,"id","svelte-announcer"),be(e,"aria-live","assertive"),be(e,"aria-atomic","true"),V(e,"position","absolute"),V(e,"left","0"),V(e,"top","0"),V(e,"clip","rect(0 0 0 0)"),V(e,"clip-path","inset(50%)"),V(e,"overflow","hidden"),V(e,"white-space","nowrap"),V(e,"width","1px"),V(e,"height","1px")},m(i,o){J(i,e,o),n&&n.m(e,null)},p(i,o){i[5]?n?n.p(i,o):(n=Xe(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&G(e),n&&n.d()}}}function Xe(a){let e;return{c(){e=pt(a[6])},l(n){e=ht(n,a[6])},m(n,i){J(n,e,i)},p(n,i){i&64&&mt(e,n[6])},d(n){n&&G(e)}}}function qt(a){let e,n,i,o,d;const t=[Ct,Dt],f=[];function _(g,w){return g[0][1]?0:1}e=_(a),n=f[e]=t[e](a);let h=a[4]&&Ye(a);return{c(){n.c(),i=it(),h&&h.c(),o=B()},l(g){n.l(g),i=lt(g),h&&h.l(g),o=B()},m(g,w){f[e].m(g,w),J(g,i,w),h&&h.m(g,w),J(g,o,w),d=!0},p(g,[w]){let S=e;e=_(g),e===S?f[e].p(g,w):(de(),F(f[S],1,1,()=>{f[S]=null}),pe(),n=f[e],n?n.p(g,w):(n=f[e]=t[e](g),n.c()),M(n,1),n.m(i.parentNode,i)),g[4]?h?h.p(g,w):(h=Ye(g),h.c(),h.m(o.parentNode,o)):h&&(h.d(1),h=null)},i(g){d||(M(n),d=!0)},o(g){F(n),d=!1},d(g){f[e].d(g),g&&G(i),h&&h.d(g),g&&G(o)}}}function Bt(a,e,n){let{stores:i}=e,{page:o}=e,{components:d}=e,{form:t}=e,{data_0:f=null}=e,{data_1:_=null}=e;ct(i.page.notify);let h=!1,g=!1,w=null;return Ie(()=>{const S=i.page.subscribe(()=>{h&&(n(5,g=!0),n(6,w=document.title||"untitled page"))});return n(4,h=!0),S}),a.$$set=S=>{"stores"in S&&n(7,i=S.stores),"page"in S&&n(8,o=S.page),"components"in S&&n(0,d=S.components),"form"in S&&n(1,t=S.form),"data_0"in S&&n(2,f=S.data_0),"data_1"in S&&n(3,_=S.data_1)},a.$$.update=()=>{a.$$.dirty&384&&i.page.set(o)},[d,t,f,_,h,g,w,i,o]}class Ft extends rt{constructor(e){super(),ot(this,e,Bt,qt,st,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const Mt="modulepreload",Gt=function(a,e){return new URL(a,e).href},Ze={},W=function(e,n,i){if(!n||n.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(n.map(d=>{if(d=Gt(d,i),d in Ze)return;Ze[d]=!0;const t=d.endsWith(".css"),f=t?'[rel="stylesheet"]':"";if(!!i)for(let g=o.length-1;g>=0;g--){const w=o[g];if(w.href===d&&(!t||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${f}`))return;const h=document.createElement("link");if(h.rel=t?"stylesheet":Mt,t||(h.as="script",h.crossOrigin=""),h.href=d,document.head.appendChild(h),t)return new Promise((g,w)=>{h.addEventListener("load",g),h.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})})).then(()=>e())},Ht={},me=[()=>W(()=>import("./chunks/0-494c4032.js"),["./chunks/0-494c4032.js","./components/pages/_layout.svelte-eb1cc3e8.js","./chunks/index-fac9d42c.js","./chunks/stores-10673846.js","./chunks/singletons-8aa67421.js","./assets/_layout-7f5e19c9.css"],import.meta.url),()=>W(()=>import("./chunks/1-ec1787f8.js"),["./chunks/1-ec1787f8.js","./components/error.svelte-246cf555.js","./chunks/index-fac9d42c.js","./chunks/stores-10673846.js","./chunks/singletons-8aa67421.js"],import.meta.url),()=>W(()=>import("./chunks/2-d35ac8cc.js"),["./chunks/2-d35ac8cc.js","./components/pages/_page.svelte-fa763652.js","./chunks/index-fac9d42c.js"],import.meta.url),()=>W(()=>import("./chunks/3-e77bb67b.js"),["./chunks/3-e77bb67b.js","./components/pages/colors/_page.svelte-fb9a2599.js","./chunks/index-fac9d42c.js","./chunks/transform-0199f17a.js"],import.meta.url),()=>W(()=>import("./chunks/4-ebbcc64a.js"),["./chunks/4-ebbcc64a.js","./components/pages/happyfaces/_page.svelte-93850a70.js","./chunks/index-fac9d42c.js","./chunks/transform-0199f17a.js"],import.meta.url),()=>W(()=>import("./chunks/5-4f31fec2.js"),["./chunks/5-4f31fec2.js","./components/pages/stickycircle/_page.svelte-1aed0162.js","./chunks/index-fac9d42c.js"],import.meta.url)],tt=[],Jt={"/":[-3],"/colors":[-4],"/happyfaces":[4],"/stickycircle":[5]},Kt={handleError:({error:a})=>{console.error(a)}};let Ae=class{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},xe=class{constructor(e,n){this.status=e,this.location=n}};async function zt(a){var e;for(const n in a)if(typeof((e=a[n])==null?void 0:e.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(a).map(async([i,o])=>[i,await o])));return a}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");const Wt=-1,Yt=-2,Xt=-3,Zt=-4,xt=-5,Qt=-6;function en(a){if(typeof a=="number")return i(a,!0);if(!Array.isArray(a)||a.length===0)throw new Error("Invalid input");const e=a,n=Array(e.length);function i(o,d=!1){if(o===Wt)return;if(o===Xt)return NaN;if(o===Zt)return 1/0;if(o===xt)return-1/0;if(o===Qt)return-0;if(d)throw new Error("Invalid input");if(o in n)return n[o];const t=e[o];if(!t||typeof t!="object")n[o]=t;else if(Array.isArray(t))if(typeof t[0]=="string")switch(t[0]){case"Date":n[o]=new Date(t[1]);break;case"Set":const _=new Set;n[o]=_;for(let w=1;we!=null)}const Re=jt(me,tt,Jt,Ht),nt=me[0],Oe=me[1];nt();Oe();let Y={};try{Y=JSON.parse(sessionStorage[et])}catch{}function Se(a){Y[a]=ae()}function nn({target:a,base:e}){var Me;const n=document.documentElement,i=[];let o=null;const d={before_navigate:[],after_navigate:[]};let t={branch:[],error:null,url:null},f=!1,_=!1,h=!0,g=!1,w=!1,S=!1,T=!1,D,I=(Me=history.state)==null?void 0:Me[C];I||(I=Date.now(),history.replaceState({...history.state,[C]:I},"",location.href));const _e=Y[I];_e&&(history.scrollRestoration="manual",scrollTo(_e.x,_e.y));let H,$e,oe;async function Ne(){oe=oe||Promise.resolve(),await oe,oe=null;const r=new URL(location.href),s=le(r,!0);o=null,await je(s,r,[])}async function ge(r,{noScroll:s=!1,replaceState:c=!1,keepFocus:l=!1,state:p={},invalidateAll:u=!1},m,b){return typeof r=="string"&&(r=new URL(r,Je(document))),ce({url:r,scroll:s?ae():null,keepfocus:l,redirect_chain:m,details:{state:p,replaceState:c},nav_token:b,accepted:()=>{u&&(T=!0)},blocked:()=>{},type:"goto"})}async function Te(r){const s=le(r,!1);if(!s)throw new Error(`Attempted to preload a URL that does not belong to this app: ${r}`);return o={id:s.id,promise:Ve(s).then(c=>(c.type==="loaded"&&c.state.error&&(o=null),c))},o.promise}async function se(...r){const c=Re.filter(l=>r.some(p=>l.exec(p))).map(l=>Promise.all([...l.layouts,l.leaf].map(p=>p==null?void 0:p[1]())));await Promise.all(c)}async function je(r,s,c,l,p={},u){var b,v;$e=p;let m=r&&await Ve(r);if(m||(m=await Fe(s,{id:null},await ne(new Error(`Not found: ${s.pathname}`),{url:s,params:{},route:{id:null}}),404)),s=(r==null?void 0:r.url)||s,$e!==p)return!1;if(m.type==="redirect")if(c.length>10||c.includes(s.pathname))m=await ie({status:500,error:await ne(new Error("Redirect loop"),{url:s,params:{},route:{id:null}}),url:s,route:{id:null}});else return ge(new URL(m.location,s).href,{},[...c,s.pathname],p),!1;else((v=(b=m.props)==null?void 0:b.page)==null?void 0:v.status)>=400&&await q.updated.check()&&await te(s);if(i.length=0,T=!1,g=!0,l&&l.details){const{details:y}=l,k=y.replaceState?0:1;y.state[C]=I+=k,history[y.replaceState?"replaceState":"pushState"](y.state,"",s)}if(o=null,_?(t=m.state,m.props.page&&(m.props.page.url=s),D.$set(m.props)):De(m),l){const{scroll:y,keepfocus:k}=l,{activeElement:P}=document;await fe();const j=document.activeElement!==P&&document.activeElement!==document.body;if(!k&&!j&&await Le(),h){const L=s.hash&&document.getElementById(s.hash.slice(1));y?scrollTo(y.x,y.y):L?L.scrollIntoView():scrollTo(0,0)}}else await fe();h=!0,m.props.page&&(H=m.props.page),u&&u(),g=!1}function De(r){var l;t=r.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),H=r.props.page,D=new Ft({target:a,props:{...r.props,stores:q},hydrate:!0});const c={from:null,to:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter"};d.after_navigate.forEach(p=>p(c)),_=!0}async function ee({url:r,params:s,branch:c,status:l,error:p,route:u,form:m}){let b="never";for(const L of c)(L==null?void 0:L.slash)!==void 0&&(b=L.slash);r.pathname=wt(r.pathname,b),r.search=r.search;const v={type:"loaded",state:{url:r,params:s,branch:c,error:p,route:u},props:{components:tn(c).map(L=>L.node.component)}};m!==void 0&&(v.props.form=m);let y={},k=!H,P=0;for(let L=0;L(b.params.add(U),E[U])}),data:(u==null?void 0:u.data)??null,url:kt(c,()=>{b.url=!0}),async fetch(E,U){let N;E instanceof Request?(N=E.url,U={body:E.method==="GET"||E.method==="HEAD"?void 0:await E.blob(),cache:E.cache,credentials:E.credentials,headers:E.headers,integrity:E.integrity,keepalive:E.keepalive,method:E.method,mode:E.mode,redirect:E.redirect,referrer:E.referrer,referrerPolicy:E.referrerPolicy,signal:E.signal,...U}):N=E;const R=new URL(N,c).href;return j(R),_?Ot(N,R,U):At(N,U)},setHeaders:()=>{},depends:j,parent(){return b.parent=!0,s()}};m=await v.universal.load.call(null,L)??null,m=m?await zt(m):null}return{node:v,loader:r,server:u,universal:(k=v.universal)!=null&&k.load?{type:"data",data:m,uses:b}:null,data:m??(u==null?void 0:u.data)??null,slash:((P=v.universal)==null?void 0:P.trailingSlash)??(u==null?void 0:u.slash)}}function Ce(r,s,c,l,p){if(T)return!0;if(!l)return!1;if(l.parent&&r||l.route&&s||l.url&&c)return!0;for(const u of l.params)if(p[u]!==t.params[u])return!0;for(const u of l.dependencies)if(i.some(m=>m(new URL(u))))return!0;return!1}function we(r,s){return(r==null?void 0:r.type)==="data"?{type:"data",data:r.data,uses:{dependencies:new Set(r.uses.dependencies??[]),params:new Set(r.uses.params??[]),parent:!!r.uses.parent,route:!!r.uses.route,url:!!r.uses.url},slash:r.slash}:(r==null?void 0:r.type)==="skip"?s??null:null}async function Ve({id:r,invalidating:s,url:c,params:l,route:p}){if((o==null?void 0:o.id)===r)return o.promise;const{errors:u,layouts:m,leaf:b}=p,v=[...m,b];u.forEach(R=>R==null?void 0:R().catch(()=>{})),v.forEach(R=>R==null?void 0:R[1]().catch(()=>{}));let y=null;const k=t.url?r!==t.url.pathname+t.url.search:!1,P=t.route?p.id!==t.route.id:!1,j=v.reduce((R,O,$)=>{var z;const A=t.branch[$],K=!!(O!=null&&O[0])&&((A==null?void 0:A.loader)!==O[1]||Ce(R.some(Boolean),P,k,(z=A.server)==null?void 0:z.uses,l));return R.push(K),R},[]);if(j.some(Boolean)){try{y=await Qe(c,j)}catch(R){return ie({status:500,error:await ne(R,{url:c,params:l,route:{id:p.id}}),url:c,route:p})}if(y.type==="redirect")return y}const L=y==null?void 0:y.nodes;let E=!1;const U=v.map(async(R,O)=>{var z;if(!R)return;const $=t.branch[O],A=L==null?void 0:L[O];if((!A||A.type==="skip")&&R[1]===($==null?void 0:$.loader)&&!Ce(E,P,k,(z=$.universal)==null?void 0:z.uses,l))return $;if(E=!0,(A==null?void 0:A.type)==="error")throw A;return ye({loader:R[1],url:c,params:l,route:p,parent:async()=>{var He;const Ge={};for(let ve=0;ve{});const N=[];for(let R=0;RPromise.resolve({}),server_data_node:we(u)}),v={node:await Oe(),loader:Oe,universal:null,server:null,data:null};return await ee({url:c,params:p,branch:[b,v],status:r,error:s,route:null})}function le(r,s){if(ze(r,e))return;const c=vt(r.pathname.slice(e.length)||"/");for(const l of Re){const p=l.exec(c);if(p)return{id:r.pathname+r.search,invalidating:s,route:l,params:bt(p),url:r}}}function Be({url:r,type:s,intent:c,delta:l}){var b,v;let p=!1;const u={from:{params:t.params,route:{id:((b=t.route)==null?void 0:b.id)??null},url:t.url},to:{params:(c==null?void 0:c.params)??null,route:{id:((v=c==null?void 0:c.route)==null?void 0:v.id)??null},url:r},willUnload:!c,type:s};l!==void 0&&(u.delta=l);const m={...u,cancel:()=>{p=!0}};return w||d.before_navigate.forEach(y=>y(m)),p?null:u}async function ce({url:r,scroll:s,keepfocus:c,redirect_chain:l,details:p,type:u,delta:m,nav_token:b,accepted:v,blocked:y}){const k=le(r,!1),P=Be({url:r,type:u,delta:m,intent:k});if(!P){y();return}Se(I),v(),w=!0,_&&q.navigating.set(P),await je(k,r,l,{scroll:s,keepfocus:c,details:p},b,()=>{w=!1,d.after_navigate.forEach(j=>j(P)),q.navigating.set(null)})}async function Fe(r,s,c,l){return r.origin===location.origin&&r.pathname===location.pathname&&!f?await ie({status:l,error:c,url:r,route:s}):await te(r)}function te(r){return location.href=r.href,new Promise(()=>{})}function at(){let r;n.addEventListener("mousemove",u=>{const m=u.target;clearTimeout(r),r=setTimeout(()=>{l(m,2)},20)});function s(u){l(u.composedPath()[0],1)}n.addEventListener("mousedown",s),n.addEventListener("touchstart",s,{passive:!0});const c=new IntersectionObserver(u=>{for(const m of u)m.isIntersecting&&(se(new URL(m.target.href).pathname),c.unobserve(m.target))},{threshold:0});function l(u,m){const b=Ke(u,n);if(!b)return;const{url:v,external:y}=Ee(b,e);if(y)return;const k=ue(b);k.reload||(m<=k.preload_data?Te(v):m<=k.preload_code&&se(v.pathname))}function p(){c.disconnect();for(const u of n.querySelectorAll("a")){const{url:m,external:b}=Ee(u,e);if(b)continue;const v=ue(u);v.reload||(v.preload_code===We.viewport&&c.observe(u),v.preload_code===We.eager&&se(m.pathname))}}d.after_navigate.push(p),p()}return{after_navigate:r=>{Ie(()=>(d.after_navigate.push(r),()=>{const s=d.after_navigate.indexOf(r);d.after_navigate.splice(s,1)}))},before_navigate:r=>{Ie(()=>(d.before_navigate.push(r),()=>{const s=d.before_navigate.indexOf(r);d.before_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(g||!_)&&(h=!1)},goto:(r,s={})=>ge(r,s,[]),invalidate:r=>{if(typeof r=="function")i.push(r);else{const{href:s}=new URL(r,location.href);i.push(c=>c.href===s)}return Ne()},invalidateAll:()=>(T=!0,Ne()),preload_data:async r=>{const s=new URL(r,Je(document));await Te(s)},preload_code:se,apply_action:async r=>{if(r.type==="error"){const s=new URL(location.href),{branch:c,route:l}=t;if(!l)return;const p=await qe(t.branch.length,c,l.errors);if(p){const u=await ee({url:s,params:t.params,branch:c.slice(0,p.idx).concat(p.node),status:r.status??500,error:r.error,route:l});t=u.state,D.$set(u.props),fe().then(Le)}}else if(r.type==="redirect")ge(r.location,{invalidateAll:!0},[]);else{const s={form:r.data,page:{...H,form:r.data,status:r.status}};D.$set(s),r.type==="success"&&fe().then(Le)}},_start_router:()=>{var r;history.scrollRestoration="manual",addEventListener("beforeunload",s=>{var l;let c=!1;if(!w){const p={from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url},to:null,willUnload:!0,type:"leave",cancel:()=>c=!0};d.before_navigate.forEach(u=>u(p))}c?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){Se(I);try{sessionStorage[et]=JSON.stringify(Y)}catch{}}}),(r=navigator.connection)!=null&&r.saveData||at(),n.addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const c=Ke(s.composedPath()[0],n);if(!c)return;const{url:l,external:p,target:u}=Ee(c,e);if(!l)return;if(u==="_parent"||u==="_top"){if(window.parent!==window)return}else if(u&&u!=="_self")return;const m=ue(c);if(!(c instanceof SVGAElement)&&l.protocol!==location.protocol&&!(l.protocol==="https:"||l.protocol==="http:"))return;if(p||m.reload){Be({url:l,type:"link"})||s.preventDefault(),w=!0;return}const[v,y]=l.href.split("#");if(y!==void 0&&v===location.href.split("#")[0]){S=!0,Se(I),t.url=l,q.page.set({...H,url:l}),q.page.notify();return}ce({url:l,scroll:m.noscroll?ae():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:l.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault(),type:"link"})}),n.addEventListener("submit",s=>{if(s.defaultPrevented)return;const c=HTMLFormElement.prototype.cloneNode.call(s.target),l=s.submitter;if(((l==null?void 0:l.formMethod)||c.method)!=="get")return;const u=new URL((l==null?void 0:l.hasAttribute("formaction"))&&(l==null?void 0:l.formAction)||c.action);if(ze(u,e))return;const m=s.target,{noscroll:b,reload:v}=ue(m);if(v)return;s.preventDefault(),s.stopPropagation();const y=new FormData(m),k=l==null?void 0:l.getAttribute("name");k&&y.append(k,(l==null?void 0:l.getAttribute("value"))??""),u.search=new URLSearchParams(y).toString(),ce({url:u,scroll:b?ae():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:!1},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",s=>{var c;if((c=s.state)!=null&&c[C]){if(s.state[C]===I)return;const l=Y[s.state[C]];if(t.url.href.split("#")[0]===location.href.split("#")[0]){Y[I]=ae(),I=s.state[C],scrollTo(l.x,l.y);return}const p=s.state[C]-I;ce({url:new URL(location.href),scroll:l,keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{I=s.state[C]},blocked:()=>{history.go(-p)},type:"popstate",delta:p})}}),addEventListener("hashchange",()=>{S&&(S=!1,history.replaceState({...history.state,[C]:++I},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&q.navigating.set(null)})},_hydrate:async({status:r=200,error:s,node_ids:c,params:l,route:p,data:u,form:m})=>{f=!0;const b=new URL(location.href);({params:l={},route:p={id:null}}=le(b,!1)||{});let v;try{const y=c.map(async(k,P)=>{const j=u[P];return ye({loader:me[k],url:b,params:l,route:p,parent:async()=>{const L={};for(let E=0;Ek===p.id)??null})}catch(y){if(y instanceof xe){await te(new URL(y.location,location.href));return}v=await ie({status:y instanceof Ae?y.status:500,error:await ne(y,{url:b,params:l,route:p}),url:b,route:p})}De(v)}}}async function Qe(a,e){var d;const n=new URL(a);n.pathname=Lt(a.pathname),n.searchParams.append("x-sveltekit-invalidated",e.map(t=>t?"1":"").join("_"));const i=await he(n.href),o=await i.json();if(!i.ok)throw new Error(o);return(d=o.nodes)==null||d.forEach(t=>{(t==null?void 0:t.type)==="data"&&(t.data=en(t.data),t.uses={dependencies:new Set(t.uses.dependencies??[]),params:new Set(t.uses.params??[]),parent:!!t.uses.parent,route:!!t.uses.route,url:!!t.uses.url})}),o}function ne(a,e){return a instanceof Ae?a.body:Kt.handleError({error:a,event:e})??{message:e.route.id!=null?"Internal Error":"Not Found"}}function Le(){const a=document.querySelector("[autofocus]");if(a)a.focus();else{const e=document.body,n=e.getAttribute("tabindex");return e.tabIndex=-1,e.focus({preventScroll:!0}),n!==null?e.setAttribute("tabindex",n):e.removeAttribute("tabindex"),new Promise(i=>{setTimeout(()=>{var o;i((o=getSelection())==null?void 0:o.removeAllRanges())})})}}async function ln({env:a,hydrate:e,paths:n,target:i,version:o}){_t(n),yt(o);const d=nn({target:i,base:n.base});gt({client:d}),e?await d._hydrate(e):d.goto(location.href,{replaceState:!0}),d._start_router()}export{ln as start};
2 |
--------------------------------------------------------------------------------
/.svelte-kit/output/client/_app/version.json:
--------------------------------------------------------------------------------
1 | {"version":"1674915924012"}
--------------------------------------------------------------------------------
/.svelte-kit/output/client/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biscotty666/SvelteDataVisualization/716f8f16b70e524b9a8aaa6b0f68c0f5eb1a75f0/.svelte-kit/output/client/favicon.png
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/index.js:
--------------------------------------------------------------------------------
1 | function noop() {
2 | }
3 | function run(fn) {
4 | return fn();
5 | }
6 | function blank_object() {
7 | return /* @__PURE__ */ Object.create(null);
8 | }
9 | function run_all(fns) {
10 | fns.forEach(run);
11 | }
12 | function safe_not_equal(a, b) {
13 | return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function");
14 | }
15 | function subscribe(store, ...callbacks) {
16 | if (store == null) {
17 | return noop;
18 | }
19 | const unsub = store.subscribe(...callbacks);
20 | return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
21 | }
22 | let current_component;
23 | function set_current_component(component) {
24 | current_component = component;
25 | }
26 | function get_current_component() {
27 | if (!current_component)
28 | throw new Error("Function called outside component initialization");
29 | return current_component;
30 | }
31 | function setContext(key, context) {
32 | get_current_component().$$.context.set(key, context);
33 | return context;
34 | }
35 | function getContext(key) {
36 | return get_current_component().$$.context.get(key);
37 | }
38 | Promise.resolve();
39 | const ATTR_REGEX = /[&"]/g;
40 | const CONTENT_REGEX = /[&<]/g;
41 | function escape(value, is_attr = false) {
42 | const str = String(value);
43 | const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
44 | pattern.lastIndex = 0;
45 | let escaped = "";
46 | let last = 0;
47 | while (pattern.test(str)) {
48 | const i = pattern.lastIndex - 1;
49 | const ch = str[i];
50 | escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<");
51 | last = i + 1;
52 | }
53 | return escaped + str.substring(last);
54 | }
55 | function each(items, fn) {
56 | let str = "";
57 | for (let i = 0; i < items.length; i += 1) {
58 | str += fn(items[i], i);
59 | }
60 | return str;
61 | }
62 | const missing_component = {
63 | $$render: () => ""
64 | };
65 | function validate_component(component, name) {
66 | if (!component || !component.$$render) {
67 | if (name === "svelte:component")
68 | name += " this={...}";
69 | throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);
70 | }
71 | return component;
72 | }
73 | let on_destroy;
74 | function create_ssr_component(fn) {
75 | function $$render(result, props, bindings, slots, context) {
76 | const parent_component = current_component;
77 | const $$ = {
78 | on_destroy,
79 | context: new Map(context || (parent_component ? parent_component.$$.context : [])),
80 | // these will be immediately discarded
81 | on_mount: [],
82 | before_update: [],
83 | after_update: [],
84 | callbacks: blank_object()
85 | };
86 | set_current_component({ $$ });
87 | const html = fn(result, props, bindings, slots);
88 | set_current_component(parent_component);
89 | return html;
90 | }
91 | return {
92 | render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => {
93 | on_destroy = [];
94 | const result = { title: "", head: "", css: /* @__PURE__ */ new Set() };
95 | const html = $$render(result, props, {}, $$slots, context);
96 | run_all(on_destroy);
97 | return {
98 | html,
99 | css: {
100 | code: Array.from(result.css).map((css) => css.code).join("\n"),
101 | map: null
102 | // TODO
103 | },
104 | head: result.title + result.head
105 | };
106 | },
107 | $$render
108 | };
109 | }
110 | function add_attribute(name, value, boolean) {
111 | if (value == null || boolean && !value)
112 | return "";
113 | const assignment = boolean && value === true ? "" : `="${escape(value, true)}"`;
114 | return ` ${name}${assignment}`;
115 | }
116 | export {
117 | setContext as a,
118 | subscribe as b,
119 | create_ssr_component as c,
120 | add_attribute as d,
121 | escape as e,
122 | each as f,
123 | getContext as g,
124 | missing_component as m,
125 | noop as n,
126 | safe_not_equal as s,
127 | validate_component as v
128 | };
129 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/internal.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, a as setContext, v as validate_component, m as missing_component } from "./index.js";
2 | let assets = "";
3 | let base = "";
4 | let version = "";
5 | let public_env = {};
6 | function set_paths(paths) {
7 | base = paths.base;
8 | assets = paths.assets || base;
9 | }
10 | function set_building(value) {
11 | }
12 | function set_private_env(environment) {
13 | }
14 | function set_public_env(environment) {
15 | public_env = environment;
16 | }
17 | function set_version(value) {
18 | version = value;
19 | }
20 | function afterUpdate() {
21 | }
22 | const Root = create_ssr_component(($$result, $$props, $$bindings, slots) => {
23 | let { stores } = $$props;
24 | let { page } = $$props;
25 | let { components } = $$props;
26 | let { form } = $$props;
27 | let { data_0 = null } = $$props;
28 | let { data_1 = null } = $$props;
29 | {
30 | setContext("__svelte__", stores);
31 | }
32 | afterUpdate(stores.page.notify);
33 | if ($$props.stores === void 0 && $$bindings.stores && stores !== void 0)
34 | $$bindings.stores(stores);
35 | if ($$props.page === void 0 && $$bindings.page && page !== void 0)
36 | $$bindings.page(page);
37 | if ($$props.components === void 0 && $$bindings.components && components !== void 0)
38 | $$bindings.components(components);
39 | if ($$props.form === void 0 && $$bindings.form && form !== void 0)
40 | $$bindings.form(form);
41 | if ($$props.data_0 === void 0 && $$bindings.data_0 && data_0 !== void 0)
42 | $$bindings.data_0(data_0);
43 | if ($$props.data_1 === void 0 && $$bindings.data_1 && data_1 !== void 0)
44 | $$bindings.data_1(data_1);
45 | {
46 | stores.page.set(page);
47 | }
48 | return `
49 |
50 |
51 | ${components[1] ? `${validate_component(components[0] || missing_component, "svelte:component").$$render($$result, { data: data_0 }, {}, {
52 | default: () => {
53 | return `${validate_component(components[1] || missing_component, "svelte:component").$$render($$result, { data: data_1, form }, {}, {})}`;
54 | }
55 | })}` : `${validate_component(components[0] || missing_component, "svelte:component").$$render($$result, { data: data_0, form }, {}, {})}`}
56 |
57 | ${``}`;
58 | });
59 | set_paths({ "base": "", "assets": "" });
60 | set_version("1674915924012");
61 | const options = {
62 | csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } },
63 | csrf_check_origin: true,
64 | embedded: false,
65 | env_public_prefix: "PUBLIC_",
66 | hooks: null,
67 | // added lazily, via `get_hooks`
68 | root: Root,
69 | service_worker: false,
70 | templates: {
71 | app: ({ head, body, assets: assets2, nonce, env }) => '\n\n
\n \n \n \n \n \n ' + head + '\n \n \n \n ' + body + "
\n \n\n",
72 | error: ({ status, message }) => '\n\n \n \n ' + message + `
73 |
74 |
114 |
115 |
116 |
117 |
` + status + '\n
\n
' + message + "
\n \n
\n \n\n"
118 | }
119 | };
120 | function get_hooks() {
121 | return {};
122 | }
123 | export {
124 | assets as a,
125 | base as b,
126 | set_building as c,
127 | set_paths as d,
128 | set_private_env as e,
129 | get_hooks as g,
130 | options as o,
131 | public_env as p,
132 | set_public_env as s,
133 | version as v
134 | };
135 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/chunks/stores.js:
--------------------------------------------------------------------------------
1 | import { g as getContext } from "./index.js";
2 | const getStores = () => {
3 | const stores = getContext("__svelte__");
4 | return {
5 | page: {
6 | subscribe: stores.page.subscribe
7 | },
8 | navigating: {
9 | subscribe: stores.navigating.subscribe
10 | },
11 | updated: stores.updated
12 | };
13 | };
14 | const page = {
15 | /** @param {(value: any) => void} fn */
16 | subscribe(fn) {
17 | const store = getStores().page;
18 | return store.subscribe(fn);
19 | }
20 | };
21 | export {
22 | page as p
23 | };
24 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/fallbacks/error.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, b as subscribe, e as escape } from "../../chunks/index.js";
2 | import { p as page } from "../../chunks/stores.js";
3 | const Error = create_ssr_component(($$result, $$props, $$bindings, slots) => {
4 | let $page, $$unsubscribe_page;
5 | $$unsubscribe_page = subscribe(page, (value) => $page = value);
6 | $$unsubscribe_page();
7 | return `${escape($page.status)}
8 | ${escape($page.error?.message)}
`;
9 | });
10 | export {
11 | Error as default
12 | };
13 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/_layout.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, b as subscribe, v as validate_component } from "../../chunks/index.js";
2 | import { p as page } from "../../chunks/stores.js";
3 | const Navbar_svelte_svelte_type_style_lang = "";
4 | const css = {
5 | code: "nav.svelte-1mun0q1{background-color:#212529;color:white}.container.svelte-1mun0q1{display:flex;align-items:center}a.svelte-1mun0q1{color:#aaa;text-decoration:none;padding-left:5px}.active.svelte-1mun0q1{color:white}ul.svelte-1mun0q1{display:flex;list-style:none;margin-left:auto;font-size:1em}li.svelte-1mun0q1{margin-right:20px}h1.svelte-1mun0q1{margin:0;font-size:1.1em;font-weight:normal}",
6 | map: null
7 | };
8 | const Navbar = create_ssr_component(($$result, $$props, $$bindings, slots) => {
9 | let routeId;
10 | let $page, $$unsubscribe_page;
11 | $$unsubscribe_page = subscribe(page, (value) => $page = value);
12 | $$result.css.add(css);
13 | routeId = $page.route.id;
14 | $$unsubscribe_page();
15 | return ``;
20 | });
21 | const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
22 | return `${validate_component(Navbar, "Navbar").$$render($$result, {}, {}, {})}
23 | ${slots.default ? slots.default({}) : ``}`;
24 | });
25 | export {
26 | Layout as default
27 | };
28 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/_page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3";
2 | const csvUrl = "https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/639388c2cbc2120a14dcf466e85730eb8be498bb/iris.csv";
3 | const load = async () => {
4 | const getFlowers = async () => {
5 | const row = (d) => {
6 | d.sepal_length = +d.sepal_length;
7 | d.sepal_width = +d.sepal_width;
8 | d.petal_length = +d.petal_length;
9 | d.petal_width = +d.petal_width;
10 | return d;
11 | };
12 | const data = await csv(csvUrl, row);
13 | return data;
14 | };
15 | return {
16 | flowers: getFlowers()
17 | };
18 | };
19 | export {
20 | load
21 | };
22 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/_page.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component } from "../../chunks/index.js";
2 | const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
3 | return `Data Visualizations
4 |
A Svelte recasting of the Excellent Series by Curran Kelleher using D3 with React.
5 |
`;
6 | });
7 | export {
8 | Page as default
9 | };
10 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/colors/_page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3";
2 | const csvUrl = "https://gist.githubusercontent.com/curran/b236990081a24761f7000567094914e0/raw/cssNamedColors.csv";
3 | const load = async () => {
4 | const getColors = async () => {
5 | const data = await csv(csvUrl);
6 | console.log(data);
7 | return data;
8 | };
9 | return {
10 | colors: getColors()
11 | };
12 | };
13 | export {
14 | load
15 | };
16 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/colors/_page.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, d as add_attribute, f as each } from "../../../chunks/index.js";
2 | import { arc } from "d3";
3 | const width = 960;
4 | const height = 500;
5 | const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
6 | let { data } = $$props;
7 | const { colors } = data;
8 | const centerX = width / 2;
9 | const centerY = height / 2;
10 | const pieArc = arc().innerRadius(0).outerRadius(width);
11 | if ($$props.data === void 0 && $$bindings.data && data !== void 0)
12 | $$bindings.data(data);
13 | return `
23 |
`;
24 | });
25 | export {
26 | Page as default
27 | };
28 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/happyfaces/_page.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, d as add_attribute, v as validate_component, f as each } from "../../../chunks/index.js";
2 | import { arc } from "d3";
3 | const Eyes = create_ssr_component(($$result, $$props, $$bindings, slots) => {
4 | let { eyeOffsetX: eyeOffsetX2 } = $$props;
5 | let { eyeOffsetY: eyeOffsetY2 } = $$props;
6 | let { eyeRadius: eyeRadius2 } = $$props;
7 | if ($$props.eyeOffsetX === void 0 && $$bindings.eyeOffsetX && eyeOffsetX2 !== void 0)
8 | $$bindings.eyeOffsetX(eyeOffsetX2);
9 | if ($$props.eyeOffsetY === void 0 && $$bindings.eyeOffsetY && eyeOffsetY2 !== void 0)
10 | $$bindings.eyeOffsetY(eyeOffsetY2);
11 | if ($$props.eyeRadius === void 0 && $$bindings.eyeRadius && eyeRadius2 !== void 0)
12 | $$bindings.eyeRadius(eyeRadius2);
13 | return `
14 | `;
15 | });
16 | const Mouth = create_ssr_component(($$result, $$props, $$bindings, slots) => {
17 | let { mouthRadius: mouthRadius2 } = $$props;
18 | let { mouthWidth: mouthWidth2 } = $$props;
19 | const mouthArc = arc().innerRadius(mouthRadius2).outerRadius(mouthRadius2 + mouthWidth2).startAngle(Math.PI / 2).endAngle(Math.PI * 3 / 2);
20 | if ($$props.mouthRadius === void 0 && $$bindings.mouthRadius && mouthRadius2 !== void 0)
21 | $$bindings.mouthRadius(mouthRadius2);
22 | if ($$props.mouthWidth === void 0 && $$bindings.mouthWidth && mouthWidth2 !== void 0)
23 | $$bindings.mouthWidth(mouthWidth2);
24 | return ``;
25 | });
26 | const BackgroundCircle = create_ssr_component(($$result, $$props, $$bindings, slots) => {
27 | let { strokeWidth: strokeWidth2 } = $$props;
28 | let { centerY } = $$props;
29 | if ($$props.strokeWidth === void 0 && $$bindings.strokeWidth && strokeWidth2 !== void 0)
30 | $$bindings.strokeWidth(strokeWidth2);
31 | if ($$props.centerY === void 0 && $$bindings.centerY && centerY !== void 0)
32 | $$bindings.centerY(centerY);
33 | return ``;
34 | });
35 | const Face = create_ssr_component(($$result, $$props, $$bindings, slots) => {
36 | let { width: width2 } = $$props;
37 | let { height: height2 } = $$props;
38 | let { centerX } = $$props;
39 | let { centerY } = $$props;
40 | let { strokeWidth: strokeWidth2 } = $$props;
41 | let { eyeOffsetX: eyeOffsetX2 } = $$props;
42 | let { eyeOffsetY: eyeOffsetY2 } = $$props;
43 | let { eyeRadius: eyeRadius2 } = $$props;
44 | let { mouthRadius: mouthRadius2 } = $$props;
45 | let { mouthWidth: mouthWidth2 } = $$props;
46 | if ($$props.width === void 0 && $$bindings.width && width2 !== void 0)
47 | $$bindings.width(width2);
48 | if ($$props.height === void 0 && $$bindings.height && height2 !== void 0)
49 | $$bindings.height(height2);
50 | if ($$props.centerX === void 0 && $$bindings.centerX && centerX !== void 0)
51 | $$bindings.centerX(centerX);
52 | if ($$props.centerY === void 0 && $$bindings.centerY && centerY !== void 0)
53 | $$bindings.centerY(centerY);
54 | if ($$props.strokeWidth === void 0 && $$bindings.strokeWidth && strokeWidth2 !== void 0)
55 | $$bindings.strokeWidth(strokeWidth2);
56 | if ($$props.eyeOffsetX === void 0 && $$bindings.eyeOffsetX && eyeOffsetX2 !== void 0)
57 | $$bindings.eyeOffsetX(eyeOffsetX2);
58 | if ($$props.eyeOffsetY === void 0 && $$bindings.eyeOffsetY && eyeOffsetY2 !== void 0)
59 | $$bindings.eyeOffsetY(eyeOffsetY2);
60 | if ($$props.eyeRadius === void 0 && $$bindings.eyeRadius && eyeRadius2 !== void 0)
61 | $$bindings.eyeRadius(eyeRadius2);
62 | if ($$props.mouthRadius === void 0 && $$bindings.mouthRadius && mouthRadius2 !== void 0)
63 | $$bindings.mouthRadius(mouthRadius2);
64 | if ($$props.mouthWidth === void 0 && $$bindings.mouthWidth && mouthWidth2 !== void 0)
65 | $$bindings.mouthWidth(mouthWidth2);
66 | return ``;
67 | });
68 | const width = 160;
69 | const height = 160;
70 | const strokeWidth = 6;
71 | const eyeOffsetX = 20;
72 | const eyeOffsetY = 20;
73 | const eyeRadius = 5;
74 | const mouthWidth = 7;
75 | const mouthRadius = 30;
76 | const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
77 | const centerX = width / 2;
78 | const centerY = height / 2;
79 | return `${each(Array(6 * 3), (_) => {
80 | return `${validate_component(Face, "Face").$$render(
81 | $$result,
82 | {
83 | width,
84 | height,
85 | centerX,
86 | centerY,
87 | strokeWidth: strokeWidth + Math.random() * 3,
88 | eyeOffsetX: eyeOffsetX + Math.random() * 9,
89 | eyeOffsetY: eyeOffsetY + Math.random() * 15,
90 | eyeRadius: eyeRadius + Math.random() * 10,
91 | mouthWidth: mouthWidth + Math.random() * 9,
92 | mouthRadius: mouthRadius + Math.random() * 10
93 | },
94 | {},
95 | {}
96 | )}`;
97 | })}
98 |
`;
99 | });
100 | export {
101 | Page as default
102 | };
103 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/entries/pages/stickycircle/_page.svelte.js:
--------------------------------------------------------------------------------
1 | import { c as create_ssr_component, d as add_attribute } from "../../../chunks/index.js";
2 | const width = 960;
3 | const height = 500;
4 | const circleRadius = 30;
5 | const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
6 | let mousePosition;
7 | mousePosition = { x: width / 2, y: height / 2 };
8 | return `
9 |
`;
10 | });
11 | export {
12 | Page as default
13 | };
14 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/internal.js:
--------------------------------------------------------------------------------
1 | import { g, o, c, d, e, s } from "./chunks/internal.js";
2 | export {
3 | g as get_hooks,
4 | o as options,
5 | c as set_building,
6 | d as set_paths,
7 | e as set_private_env,
8 | s as set_public_env
9 | };
10 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/manifest-full.js:
--------------------------------------------------------------------------------
1 | export const manifest = {
2 | appDir: "_app",
3 | appPath: "_app",
4 | assets: new Set(["favicon.png"]),
5 | mimeTypes: {".png":"image/png"},
6 | _: {
7 | entry: {"file":"_app/immutable/start-cac21a0c.js","imports":["_app/immutable/start-cac21a0c.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/singletons-8aa67421.js"],"stylesheets":[],"fonts":[]},
8 | nodes: [
9 | () => import('./nodes/0.js'),
10 | () => import('./nodes/1.js'),
11 | () => import('./nodes/2.js'),
12 | () => import('./nodes/3.js'),
13 | () => import('./nodes/4.js'),
14 | () => import('./nodes/5.js')
15 | ],
16 | routes: [
17 | {
18 | id: "/",
19 | pattern: /^\/$/,
20 | params: [],
21 | page: { layouts: [0], errors: [1], leaf: 2 },
22 | endpoint: null
23 | },
24 | {
25 | id: "/colors",
26 | pattern: /^\/colors\/?$/,
27 | params: [],
28 | page: { layouts: [0], errors: [1], leaf: 3 },
29 | endpoint: null
30 | },
31 | {
32 | id: "/happyfaces",
33 | pattern: /^\/happyfaces\/?$/,
34 | params: [],
35 | page: { layouts: [0], errors: [1], leaf: 4 },
36 | endpoint: null
37 | },
38 | {
39 | id: "/stickycircle",
40 | pattern: /^\/stickycircle\/?$/,
41 | params: [],
42 | page: { layouts: [0], errors: [1], leaf: 5 },
43 | endpoint: null
44 | }
45 | ],
46 | matchers: async () => {
47 |
48 | return { };
49 | }
50 | }
51 | };
52 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/manifest.js:
--------------------------------------------------------------------------------
1 | export const manifest = {
2 | appDir: "_app",
3 | appPath: "_app",
4 | assets: new Set(["favicon.png"]),
5 | mimeTypes: {".png":"image/png"},
6 | _: {
7 | entry: {"file":"_app/immutable/start-cac21a0c.js","imports":["_app/immutable/start-cac21a0c.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/singletons-8aa67421.js"],"stylesheets":[],"fonts":[]},
8 | nodes: [
9 | () => import('./nodes/0.js'),
10 | () => import('./nodes/1.js'),
11 | () => import('./nodes/2.js'),
12 | () => import('./nodes/3.js'),
13 | () => import('./nodes/4.js'),
14 | () => import('./nodes/5.js')
15 | ],
16 | routes: [
17 | {
18 | id: "/",
19 | pattern: /^\/$/,
20 | params: [],
21 | page: { layouts: [0], errors: [1], leaf: 2 },
22 | endpoint: null
23 | },
24 | {
25 | id: "/colors",
26 | pattern: /^\/colors\/?$/,
27 | params: [],
28 | page: { layouts: [0], errors: [1], leaf: 3 },
29 | endpoint: null
30 | },
31 | {
32 | id: "/happyfaces",
33 | pattern: /^\/happyfaces\/?$/,
34 | params: [],
35 | page: { layouts: [0], errors: [1], leaf: 4 },
36 | endpoint: null
37 | },
38 | {
39 | id: "/stickycircle",
40 | pattern: /^\/stickycircle\/?$/,
41 | params: [],
42 | page: { layouts: [0], errors: [1], leaf: 5 },
43 | endpoint: null
44 | }
45 | ],
46 | matchers: async () => {
47 |
48 | return { };
49 | }
50 | }
51 | };
52 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/0.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | export const index = 0;
4 | export const component = async () => (await import('../entries/pages/_layout.svelte.js')).default;
5 | export const file = '_app/immutable/components/pages/_layout.svelte-eb1cc3e8.js';
6 | export const imports = ["_app/immutable/components/pages/_layout.svelte-eb1cc3e8.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/stores-10673846.js","_app/immutable/chunks/singletons-8aa67421.js"];
7 | export const stylesheets = ["_app/immutable/assets/_layout-7f5e19c9.css"];
8 | export const fonts = [];
9 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/1.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | export const index = 1;
4 | export const component = async () => (await import('../entries/fallbacks/error.svelte.js')).default;
5 | export const file = '_app/immutable/components/error.svelte-246cf555.js';
6 | export const imports = ["_app/immutable/components/error.svelte-246cf555.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/stores-10673846.js","_app/immutable/chunks/singletons-8aa67421.js"];
7 | export const stylesheets = [];
8 | export const fonts = [];
9 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/2.js:
--------------------------------------------------------------------------------
1 | import * as server from '../entries/pages/_page.server.js';
2 |
3 | export const index = 2;
4 | export const component = async () => (await import('../entries/pages/_page.svelte.js')).default;
5 | export const file = '_app/immutable/components/pages/_page.svelte-fa763652.js';
6 | export { server };
7 | export const imports = ["_app/immutable/components/pages/_page.svelte-fa763652.js","_app/immutable/chunks/index-fac9d42c.js"];
8 | export const stylesheets = [];
9 | export const fonts = [];
10 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/3.js:
--------------------------------------------------------------------------------
1 | import * as server from '../entries/pages/colors/_page.server.js';
2 |
3 | export const index = 3;
4 | export const component = async () => (await import('../entries/pages/colors/_page.svelte.js')).default;
5 | export const file = '_app/immutable/components/pages/colors/_page.svelte-fb9a2599.js';
6 | export { server };
7 | export const imports = ["_app/immutable/components/pages/colors/_page.svelte-fb9a2599.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/transform-0199f17a.js"];
8 | export const stylesheets = [];
9 | export const fonts = [];
10 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/4.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | export const index = 4;
4 | export const component = async () => (await import('../entries/pages/happyfaces/_page.svelte.js')).default;
5 | export const file = '_app/immutable/components/pages/happyfaces/_page.svelte-93850a70.js';
6 | export const imports = ["_app/immutable/components/pages/happyfaces/_page.svelte-93850a70.js","_app/immutable/chunks/index-fac9d42c.js","_app/immutable/chunks/transform-0199f17a.js"];
7 | export const stylesheets = [];
8 | export const fonts = [];
9 |
--------------------------------------------------------------------------------
/.svelte-kit/output/server/nodes/5.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | export const index = 5;
4 | export const component = async () => (await import('../entries/pages/stickycircle/_page.svelte.js')).default;
5 | export const file = '_app/immutable/components/pages/stickycircle/_page.svelte-1aed0162.js';
6 | export const imports = ["_app/immutable/components/pages/stickycircle/_page.svelte-1aed0162.js","_app/immutable/chunks/index-fac9d42c.js"];
7 | export const stylesheets = [];
8 | export const fonts = [];
9 |
--------------------------------------------------------------------------------
/.svelte-kit/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "$lib": [
5 | "../src/lib"
6 | ],
7 | "$lib/*": [
8 | "../src/lib/*"
9 | ]
10 | },
11 | "rootDirs": [
12 | "..",
13 | "./types"
14 | ],
15 | "importsNotUsedAsValues": "error",
16 | "isolatedModules": true,
17 | "preserveValueImports": true,
18 | "lib": [
19 | "esnext",
20 | "DOM",
21 | "DOM.Iterable"
22 | ],
23 | "moduleResolution": "node",
24 | "module": "esnext",
25 | "target": "esnext"
26 | },
27 | "include": [
28 | "ambient.d.ts",
29 | "./types/**/$types.d.ts",
30 | "../vite.config.ts",
31 | "../src/**/*.js",
32 | "../src/**/*.ts",
33 | "../src/**/*.svelte",
34 | "../tests/**/*.js",
35 | "../tests/**/*.ts",
36 | "../tests/**/*.svelte"
37 | ],
38 | "exclude": [
39 | "../node_modules/**",
40 | "./[!ambient.d.ts]**",
41 | "../src/service-worker.js",
42 | "../src/service-worker.ts",
43 | "../src/service-worker.d.ts"
44 | ]
45 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 biscotty666
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Since people seem to be following this I should say that I'm not working on it right now because I'm doing some stuff with R. It would be great if someone picked up where I left off. If not I do plan to finish, just not yet.
2 |
3 | # Project running at
4 |
5 | ### [Project (Vercel)](https://sveltekit-1-biscotty666.vercel.app/)
6 |
7 | ### [Project (GitHub)](https://sveltekit-1-biscotty666.vercel.app/)
8 |
9 | # D3 With Svelte
10 |
11 | Based on [Curran Kelleher's](https://www.youtube.com/channel/UCSwd_9jyX4YtDYm9p9MxQqw) excellent Series using D3 with React.
12 |
13 | ## Project data resources
14 |
15 | [Missing Migrants Project](https://missingmigrants.iom.int/data)
16 |
17 | [Simplemaps World Cities Database](https://simplemaps.com/data/world-cities)
18 |
19 | [UN World Population Prospects](https://population.un.org/wpp/Download/Standard/MostUsed/)
20 |
21 | [Data Canvas: Sense Your City](https://grayarea.org/initiative/data-canvas-sense-your-city/)
22 |
23 | [Curran's Sense Your City Data]('https://gist.githubusercontent.com/curran/90240a6d88bdb1411467b21ea0769029/raw/7d4c3914cc6a29a7f5165f7d5d82b735d97bcfe4/week_temperature_sf.csv')
24 |
25 | [Natural Earth TopoJSON](https://github.com/topojson/world-atlas)
26 |
27 | [unpkg world-atlas ](https://unpkg.com/world-atlas@2.0.2/countries-50m.json)
28 |
29 | ## Tech Resources
30 |
31 | [Sunlight Foundation Data Visualization Style Guide](https://sunlightfoundation.com/2014/03/12/datavizguide/)
32 |
33 | [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG)
34 |
35 | ## Finding Visualizations
36 |
37 | [Reuters Graphics](https://www.reuters.com/graphics/)
38 |
39 | [The Upshot (NYT)](https://www.nytimes.com/section/upshot)
40 |
41 | [The Pudding](https://pudding.cool/)
42 |
43 | [FiveThirtyEight](https://fivethirtyeight.com/tag/data-visualization/)
44 |
45 | [FLOWINGDATA](https://flowingdata.com/)
46 |
47 | [Data Is Beautiful (Reddit)](https://www.reddit.com/r/dataisbeautiful/)
48 |
49 | [Information is Beautiful](https://informationisbeautiful.net/)
50 |
51 | [Information is Beautiful Awards](https://www.informationisbeautifulawards.com/)
52 |
53 | [Graphic Detail (The Economist)](https://www.economist.com/graphic-detail)
54 |
55 | [#dataviz (Twitter)](https://twitter.com/hashtag/dataviz)
56 |
57 | [Data Visualization Society (twitter)](https://twitter.com/DataVizSociety)
58 |
59 | [Our World in Data](https://ourworldindata.org/)
60 |
61 | ## Components
62 |
63 | [Blockbuilder Search (obsereablehq)](https://observablehq.com/@enjalot/blockbuilder-search-data)
64 |
65 | ## Coronavirus
66 |
67 | ### Existing Resources
68 |
69 | [Johns Hopkins CV Dataset](https://coronavirus.jhu.edu/)
70 |
71 | [Johns Hopkins Github](https://github.com/CSSEGISandData/COVID-19)
72 |
73 | [Our World in Data CV Visualizations](https://ourworldindata.org/explorers/coronavirus-data-explorer?zoomToSelection=true&country=~OWID_WRL&hideControls=true&Interval=Cumulative&Relative+to+Population=false&Metric=Confirmed+deaths&Color+by+test+positivity=false)
74 |
75 | [Our World in Data Github](https://github.com/owid/covid-19-data/tree/master/public/data)
76 |
77 | [Financial Times](https://www.ft.com/content/a2901ce8-5eb7-4633-b89c-cbdf5b386938)
78 |
79 | [Information is Beautiful Visualizations](https://informationisbeautiful.net/visualizations/covid-19-coronavirus-infographic-datapack/)
80 |
81 | [Information is Beautiful CV Dataset](https://covid.cd2h.org/node/71)
82 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Data Visualizations
8 |
14 |
15 | %sveltekit.head%
16 |
17 |
18 |
19 | %sveltekit.body%
20 |
21 |
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "datavizsvelte",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite dev",
7 | "build": "vite build",
8 | "preview": "vite preview",
9 | "lint": "prettier --plugin-search-dir . --check . && eslint .",
10 | "format": "prettier --plugin-search-dir . --write ."
11 | },
12 | "devDependencies": {
13 | "@sveltejs/adapter-auto": "^1.0.0",
14 | "@sveltejs/kit": "^1.0.0",
15 | "eslint": "^8.28.0",
16 | "eslint-config-prettier": "^8.5.0",
17 | "eslint-plugin-svelte3": "^4.0.0",
18 | "prettier": "^2.8.0",
19 | "prettier-plugin-svelte": "^2.8.1",
20 | "svelte": "^3.54.0",
21 | "vite": "^4.0.0"
22 | },
23 | "type": "module",
24 | "dependencies": {
25 | "ajax": "^0.0.4",
26 | "d3": "^7.8.2",
27 | "flowbite-svelte": "^0.29.12",
28 | "rxjs": "^7.8.0",
29 | "sveltestrap": "^5.10.0",
30 | "topojson-client": "^3.1.0",
31 | "topojson-server": "^3.0.1",
32 | "topojson-simplify": "^3.0.3"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 | %sveltekit.head%
15 |
16 |
17 |
18 | %sveltekit.body%
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/lib/stores:
--------------------------------------------------------------------------------
1 | import { writable } from "svelte/store";
2 |
3 | export const createSearchStore = (data) => {
4 | const { subscribe, set, update} = writable({
5 | data,
6 | filtered: data,
7 | search: "",
8 | })
9 |
10 | return {
11 | subscribe,
12 | set,
13 | update
14 | }
15 | }
16 |
17 | export const searchHandler = (store) => {
18 | const searchTerm = store.search.toLowerCase() || ""
19 | store.filtered = store.data.filter((item) => {
20 | return item.searchTerms.toLowerCase().includes(searchTerm)
21 | })
22 | }
--------------------------------------------------------------------------------
/src/routes/+layout.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/routes/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | const csvUrl = 'https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/639388c2cbc2120a14dcf466e85730eb8be498bb/iris.csv'
4 |
5 | export const load = async () => {
6 |
7 | const getFlowers = async () => {
8 | const row = d => {
9 | d.sepal_length = +d.sepal_length
10 | d.sepal_width = +d.sepal_width
11 | d.petal_length = +d.petal_length
12 | d.petal_width = +d.petal_width
13 | return d
14 | }
15 | const data = await csv(csvUrl, row)
16 | return data
17 | };
18 |
19 | return {
20 | flowers: getFlowers()
21 | }
22 | }
--------------------------------------------------------------------------------
/src/routes/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
Data Visualizations
7 |
Project running at:
8 |
9 |
10 |
Project Repository
11 |
12 |
13 |
README.md
14 |
15 |
16 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/src/routes/Navbar.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
22 |
23 |
61 |
--------------------------------------------------------------------------------
/src/routes/demos/+layout.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/routes/demos/NavbarDemos.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
22 |
23 |
61 |
--------------------------------------------------------------------------------
/src/routes/demos/colors/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | const csvUrl = 'https://gist.githubusercontent.com/curran/b236990081a24761f7000567094914e0/raw/cssNamedColors.csv'
4 |
5 | export const load = async () => {
6 |
7 | const getColors = async () => {
8 | // const row = d => {
9 | // d.sepal_length = +d.sepal_length
10 | // d.sepal_width = +d.sepal_width
11 | // d.petal_length = +d.petal_length
12 | // d.petal_width = +d.petal_width
13 | // return d
14 | // }
15 | const data = await csv(csvUrl)
16 | console.log(data)
17 | return data
18 | };
19 |
20 | return {
21 | colors: getColors()
22 | }
23 | }
--------------------------------------------------------------------------------
/src/routes/demos/colors/+page.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
An SVG color wheel of named CSS Colors
18 |
28 |
Demonstrates data loading with d3 and svelte as well as working with svg
29 |
30 |
31 |
37 |
--------------------------------------------------------------------------------
/src/routes/demos/happyfaces/+page.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
Random Faces
18 | {#each Array(6 * 3) as _}
19 |
29 | {/each}
30 |
Demonstrates looping and component management with Svelte
31 |
32 |
33 |
39 |
--------------------------------------------------------------------------------
/src/routes/demos/happyfaces/BackgroundCircle.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
--------------------------------------------------------------------------------
/src/routes/demos/happyfaces/Eyes.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
17 |
--------------------------------------------------------------------------------
/src/routes/demos/happyfaces/Face.svelte:
--------------------------------------------------------------------------------
1 |
17 |
18 |
--------------------------------------------------------------------------------
/src/routes/demos/happyfaces/Mouth.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/routes/demos/menus/+page.svelte:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
22 |
27 |
28 |
29 | Selected {selected['id']}
30 |
31 |
32 |
33 |
43 |
--------------------------------------------------------------------------------
/src/routes/demos/sfline/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | const csvUrl = 'https://gist.githubusercontent.com/curran/90240a6d88bdb1411467b21ea0769029/raw/7d4c3914cc6a29a7f5165f7d5d82b735d97bcfe4/week_temperature_sf.csv'
4 |
5 | export const load = async () => {
6 |
7 | const prepareData = async () => {
8 | const row = d => {
9 | d.temperature = +d.temperature
10 | d.timestamp = new Date(d.timestamp)
11 | return d
12 | }
13 | const data = await csv(csvUrl, row)
14 | console.log(data)
15 | return data
16 | };
17 |
18 | return {
19 | theData: prepareData()
20 | }
21 | }
--------------------------------------------------------------------------------
/src/routes/demos/sfline/+page.svelte:
--------------------------------------------------------------------------------
1 |
40 |
41 | {#if data}
42 |
43 |
82 |
83 | {:else}
84 | Loading...
85 | {/if}
86 |
87 |
103 |
--------------------------------------------------------------------------------
/src/routes/demos/sfline/AxisBottom.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 | {#each xScale.ticks() as tickValue}
9 |
14 |
15 |
16 | {tickFormat(tickValue)}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/demos/sfline/AxisLeft.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {#each yScale.ticks() as tickValue}
8 |
9 |
10 |
16 | {tickValue}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/demos/sfline/Marks.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 | {#each theData as d}
15 | xScale(xValue(d)))
19 | .y(d => yScale(yValue(d)))
20 | .curve(curveNatural)(theData)}
21 | />
22 |
27 | {tooltipFormat(xValue(d))}
28 |
29 |
30 | {/each}
31 |
32 |
--------------------------------------------------------------------------------
/src/routes/demos/stickycircle/+page.svelte:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
Sticky Circle
21 |
28 |
Demonstrates state management in Svelte
29 |
30 |
31 |
40 |
--------------------------------------------------------------------------------
/src/routes/demos/worldmap/+page.server.js:
--------------------------------------------------------------------------------
1 | import { json } from "d3"
2 | import { mesh } from "topojson-client"
3 | import { feature } from "topojson-client"
4 |
5 | const jsonUrl = 'https://unpkg.com/world-atlas@2.0.2/countries-50m.json'
6 |
7 | export const load = async () => {
8 |
9 | const prepareData = async () => {
10 | const data = await json(jsonUrl)
11 | const { countries, land } = data.objects
12 | const features = feature(data, countries)
13 |
14 | return {
15 | land: feature(data, land),
16 | interiors: mesh(data, countries, (a,b) => a !== b)
17 | }
18 | };
19 |
20 | // console.log(prepareData())
21 |
22 | return {
23 | theData: prepareData()
24 | }
25 | }
--------------------------------------------------------------------------------
/src/routes/demos/worldmap/+page.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 | {#if data}
13 |
14 |
A Map of the Globe
15 |
20 |
Demonstrates working with spatial data (topojson) in d3 and Svelte using svg
21 |
22 | {:else}
23 | Loading...
24 | {/if}
25 |
26 |
32 |
--------------------------------------------------------------------------------
/src/routes/demos/worldmap/Marks.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | {#each land.features as feature}
16 |
20 | {/each}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/routes/histmm/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | // const csvUrl = 'https://gist.githubusercontent.com/curran/90240a6d88bdb1411467b21ea0769029/raw/7d4c3914cc6a29a7f5165f7d5d82b735d97bcfe4/week_temperature_sf.csv'
4 | const csvUrl = 'https://gist.githubusercontent.com/curran/a9656d711a8ad31d812b8f9963ac441c/raw/c22144062566de911ba32509613c84af2a99e8e2/MissingMigrants-Global-2019-10-08T09-47-14-subset.csv'
5 |
6 | export const load = async () => {
7 |
8 | const prepareData = async () => {
9 | const row = d => {
10 | d.temperature = +d['Total Dead and Missing']
11 | d.timestamp = new Date(d['Reported Date'])
12 | return d
13 | }
14 | const data = await csv(csvUrl, row)
15 | console.log(data[0])
16 | return data
17 | };
18 |
19 | return {
20 | theData: prepareData()
21 | }
22 | }
--------------------------------------------------------------------------------
/src/routes/histmm/+page.svelte:
--------------------------------------------------------------------------------
1 |
41 |
42 | {#if data}
43 |
44 |
83 |
84 | {:else}
85 | Loading...
86 | {/if}
87 |
88 |
104 |
--------------------------------------------------------------------------------
/src/routes/histmm/AxisBottom.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 | {#each xScale.ticks() as tickValue}
9 |
14 |
15 |
16 | {tickFormat(tickValue)}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/histmm/AxisLeft.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {#each yScale.ticks() as tickValue}
8 |
9 |
10 |
16 | {tickValue}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/histmm/Marks.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 | {#each theData as d}
15 | xScale(xValue(d)))
19 | .y(d => yScale(yValue(d)))
20 | .curve(curveNatural)(theData)}
21 | />
22 |
27 | {tooltipFormat(xValue(d))}
28 |
29 |
30 | {/each}
31 |
32 |
--------------------------------------------------------------------------------
/src/routes/irisscatter/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | const csvUrl = 'https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv'
4 |
5 | export const load = async () => {
6 |
7 | const getFlowers = async () => {
8 | const row = d => {
9 | d.sepal_length = +d.sepal_length
10 | d.sepal_width = +d.sepal_width
11 | d.petal_length = +d.petal_length
12 | d.petal_width = +d.petal_width
13 | return d
14 | }
15 | const data = await csv(csvUrl, row)
16 | // console.log(data)
17 | return data
18 | };
19 |
20 | return {
21 | flowers: getFlowers()
22 | }
23 | }
--------------------------------------------------------------------------------
/src/routes/irisscatter/+page.svelte:
--------------------------------------------------------------------------------
1 |
115 |
116 | The Iris Dataset
117 | {#if data}
118 |
119 |
120 |
142 |
179 |
180 | {#if flowers}
181 |
182 |
183 |
Species
184 |
185 |
188 | {#each colorDomain as color, i}
189 |
190 |
{filter(colors[i])}}
193 | on:mouseleave={() => {unFilter()}}
194 | >
195 | reactiveFilter(colors[i])}
199 | >•
201 | {color}
202 |
203 | {/each}
204 |
Hover to view species
205 |
206 |
207 | {/if}
208 |
209 | {:else}
210 | Loading...
211 | {/if}
212 |
213 |
275 |
--------------------------------------------------------------------------------
/src/routes/irisscatter/AxisBottom.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 | {#each xScale.ticks() as tickValue}
9 |
14 |
15 |
16 | {tickFormat(tickValue)}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/irisscatter/AxisLeft.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {#each yScale.ticks() as tickValue}
8 |
9 |
10 |
16 | {tickValue}
17 |
18 |
19 | {/each}
20 |
21 |
30 |
--------------------------------------------------------------------------------
/src/routes/irisscatter/ColorLegend.svelte:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | {#if flowers}
20 | Legend
21 | Click to Filter
22 | {#each flowers as flower, i}
23 |
24 | -->
26 | {flower}
27 |
28 | {/each}
29 | {/if}
30 |
--------------------------------------------------------------------------------
/src/routes/irisscatter/Marks.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 | {#each filteredFlowers as d}
16 |
24 | {tooltipFormat(xValue(d))}
25 |
26 |
27 | {/each}
28 |
29 |
--------------------------------------------------------------------------------
/src/routes/newplot/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/routes/popbarchart/+page.server.js:
--------------------------------------------------------------------------------
1 | import { csv } from "d3"
2 |
3 | const csvUrl = 'https://gist.githubusercontent.com/biscotty666/9dcc3e250f5772e16e2b5112e02aada0/raw/a37dc899e9aca6dcaf0ca21b53e6620992169f20/UNPopProj.csv'
4 |
5 | export const load = async () => {
6 |
7 | const getPop = async () => {
8 | const row = d => {
9 | d.Population = +d['2100'] * 1000
10 | // d.sepal_length = +d.sepal_length
11 | // d.sepal_width = +d.sepal_width
12 | // d.petal_length = +d.petal_length
13 | // d.petal_width = +d.petal_width
14 | return d
15 | }
16 | const data = await csv(csvUrl, row)
17 | console.log(data[0])
18 | return data.slice(0,10)
19 | };
20 |
21 | return {
22 | pop: getPop()
23 | }
24 | }
--------------------------------------------------------------------------------
/src/routes/popbarchart/+page.svelte:
--------------------------------------------------------------------------------
1 |
33 | {#if data}
34 |
35 |
Top Ten Countries By Population in 2100
36 |
37 |
62 |
63 | {:else}
64 | Loading...
65 | {/if}
66 |
--------------------------------------------------------------------------------
/src/routes/popbarchart/AxisBottom.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {#each xScale.ticks() as tickValue}
8 |
13 |
14 |
15 | {tickFormat(tickValue)}
16 |
17 |
18 | {/each}
19 |
20 |
29 |
--------------------------------------------------------------------------------
/src/routes/popbarchart/AxisLeft.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 | {#each yScale.domain() as tickValue}
6 | {tickValue}
13 |
14 | {/each}
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/src/routes/popbarchart/Marks.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 | {#each pop as d}
11 |
17 | {tooltipFormat(xValue(d))}
18 |
19 |
20 | {/each}
21 |
22 |
--------------------------------------------------------------------------------
/src/routes/worldmapcities/+page.server.js:
--------------------------------------------------------------------------------
1 | import { json, csv } from "d3"
2 | import { mesh } from "topojson-client"
3 | import { feature } from "topojson-client"
4 |
5 | const countriesUrl = 'https://unpkg.com/world-atlas@2.0.2/countries-50m.json'
6 | const citiesUrl = 'https://gist.githubusercontent.com/biscotty666/5ba7671e8c72b3147d387035bb5624a9/raw/b10d3742b41d28def93466fbce80a4f0a5a0a71d/WorldCities'
7 |
8 | export const load = async () => {
9 |
10 | const prepareCountries = async () => {
11 | const data = await json(countriesUrl)
12 | const { countries, land } = data.objects
13 | const features = feature(data, countries)
14 |
15 | return {
16 | land: feature(data, land),
17 | interiors: mesh(data, countries, (a,b) => a !== b)
18 | }
19 | };
20 |
21 | const row = d => {
22 | d.lat = +d.lat
23 | d.lng = +d.lng
24 | return d
25 | }
26 |
27 | const prepareCities = async () => {
28 | const data = await csv(citiesUrl, row)
29 | console.log(data)
30 |
31 | return {
32 | cities: data,
33 | }
34 | };
35 |
36 | // console.log(prepareData())
37 |
38 | return {
39 | countriesData: prepareCountries(),
40 | citiesData: prepareCities()
41 | }
42 | }
--------------------------------------------------------------------------------
/src/routes/worldmapcities/+page.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 | {#if data}
13 |
14 |
World Cities
15 | Population greater than 50,000 people
16 |
19 |
20 | {:else}
21 | Loading...
22 | {/if}
23 |
24 |
30 |
--------------------------------------------------------------------------------
/src/routes/worldmapcities/Marks.svelte:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 | {#each land.features as feature}
28 |
32 | {/each}
33 |
34 | {#each cities as d}
35 |
36 | {/each}
37 |
38 |
--------------------------------------------------------------------------------
/src/routes/worldmapcitiessize/+page.server.js:
--------------------------------------------------------------------------------
1 | import { json, csv } from "d3"
2 | import { mesh } from "topojson-client"
3 | import { feature } from "topojson-client"
4 |
5 | const countriesUrl = 'https://unpkg.com/world-atlas@2.0.2/countries-50m.json'
6 | const citiesUrl = 'https://gist.githubusercontent.com/biscotty666/5ba7671e8c72b3147d387035bb5624a9/raw/b10d3742b41d28def93466fbce80a4f0a5a0a71d/WorldCities'
7 |
8 | export const load = async () => {
9 |
10 | const prepareCountries = async () => {
11 | const data = await json(countriesUrl)
12 | const { countries, land } = data.objects
13 | const features = feature(data, countries)
14 |
15 | return {
16 | land: feature(data, land),
17 | interiors: mesh(data, countries, (a,b) => a !== b)
18 | }
19 | };
20 |
21 | const row = d => {
22 | d.lat = +d.lat
23 | d.lng = +d.lng
24 | d.population = +d.population
25 | return d
26 | }
27 |
28 | const prepareCities = async () => {
29 | const data = await csv(citiesUrl, row)
30 |
31 | return {
32 | cities: data,
33 | }
34 | };
35 |
36 | // console.log(prepareData())
37 |
38 | return {
39 | countriesData: prepareCountries(),
40 | citiesData: prepareCities()
41 | }
42 | }
--------------------------------------------------------------------------------
/src/routes/worldmapcitiessize/+page.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 | {#if data}
17 |
18 |
World Cities
19 |
Population greater than 50,000 people
20 |
City Size shown by size of the dots.
21 |
24 |
25 | {:else}
26 | Loading...
27 | {/if}
28 |
29 |
35 |
--------------------------------------------------------------------------------
/src/routes/worldmapcitiessize/Marks.svelte:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
40 | {#each land.features as feature}
41 |
45 | {/each}
46 |
47 | {#each cities as d}
48 |
49 | {/each}
50 |
51 |
--------------------------------------------------------------------------------
/src/routes/worldmapmm/+page.server.js:
--------------------------------------------------------------------------------
1 | import { json, csv } from "d3"
2 | import { mesh } from "topojson-client"
3 | import { feature } from "topojson-client"
4 |
5 | const countriesUrl = 'https://unpkg.com/world-atlas@2.0.2/countries-50m.json'
6 | const citiesUrl = 'https://gist.githubusercontent.com/biscotty666/5ba7671e8c72b3147d387035bb5624a9/raw/b10d3742b41d28def93466fbce80a4f0a5a0a71d/WorldCities'
7 |
8 | export const load = async () => {
9 |
10 | const prepareCountries = async () => {
11 | const data = await json(countriesUrl)
12 | const { countries, land } = data.objects
13 | const features = feature(data, countries)
14 |
15 | return {
16 | land: feature(data, land),
17 | interiors: mesh(data, countries, (a,b) => a !== b)
18 | }
19 | };
20 |
21 | const row = d => {
22 | d.lat = +d.lat
23 | d.lng = +d.lng
24 | d.population = +d.population
25 | return d
26 | }
27 |
28 | const prepareCities = async () => {
29 | const data = await csv(citiesUrl, row)
30 |
31 | return {
32 | cities: data,
33 | }
34 | };
35 |
36 | // console.log(prepareData())
37 |
38 | return {
39 | countriesData: prepareCountries(),
40 | citiesData: prepareCities()
41 | }
42 | }
--------------------------------------------------------------------------------
/src/routes/worldmapmm/+page.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 | {#if data}
17 |
18 |
World Cities
19 |
Population greater than 50,000 people
20 |
City Size shown by size of the dots.
21 |
24 |
25 | {:else}
26 | Loading...
27 | {/if}
28 |
29 |
35 |
--------------------------------------------------------------------------------
/src/routes/worldmapmm/Marks.svelte:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
40 | {#each land.features as feature}
41 |
45 | {/each}
46 |
47 | {#each cities as d}
48 |
49 | {/each}
50 |
51 |
--------------------------------------------------------------------------------
/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biscotty666/SvelteDataVisualization/716f8f16b70e524b9a8aaa6b0f68c0f5eb1a75f0/static/favicon.png
--------------------------------------------------------------------------------
/svelte.config.js:
--------------------------------------------------------------------------------
1 | import adapter from '@sveltejs/adapter-auto';
2 |
3 | /** @type {import('@sveltejs/kit').Config} */
4 | const config = {
5 | kit: {
6 | adapter: adapter()
7 | }
8 | };
9 |
10 | export default config;
11 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { sveltekit } from '@sveltejs/kit/vite';
2 |
3 | const config = {
4 | plugins: [sveltekit()]
5 | };
6 |
7 | export default config;
8 |
--------------------------------------------------------------------------------